diff --git a/build.sbt b/build.sbt index 93e9a205..a0370a59 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "com.google.code.gson" % "gson" % "2.9.1", "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", - "org.openapitools" % "jackson-databind-nullable" % "0.2.6", + "org.openapitools" % "jackson-databind-nullable" % "0.2.10", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", diff --git a/docs/AddMicrosoftTeamsChatTabTaskParams.md b/docs/AddMicrosoftTeamsChatTabTaskParams.md new file mode 100644 index 00000000..bfddec88 --- /dev/null +++ b/docs/AddMicrosoftTeamsChatTabTaskParams.md @@ -0,0 +1,24 @@ + + +# AddMicrosoftTeamsChatTabTaskParams + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskType** | [**TaskTypeEnum**](#TaskTypeEnum) | | [optional] | +|**chat** | [**AddActionItemTaskParamsPostToSlackChannelsInner**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | | +|**title** | **String** | The tab title | | +|**link** | **String** | The tab link | | + + + +## Enum: TaskTypeEnum + +| Name | Value | +|---- | -----| +| ADD_MICROSOFT_TEAMS_CHAT_TAB | "add_microsoft_teams_chat_tab" | + + + diff --git a/docs/AlertTriggerParamsAlertPayloadConditions.md b/docs/AlertTriggerParamsAlertPayloadConditions.md new file mode 100644 index 00000000..573c7ba4 --- /dev/null +++ b/docs/AlertTriggerParamsAlertPayloadConditions.md @@ -0,0 +1,24 @@ + + +# AlertTriggerParamsAlertPayloadConditions + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**logic** | [**LogicEnum**](#LogicEnum) | | [optional] | +|**conditions** | [**List<AlertTriggerParamsAlertPayloadConditionsConditionsInner>**](AlertTriggerParamsAlertPayloadConditionsConditionsInner.md) | | [optional] | + + + +## Enum: LogicEnum + +| Name | Value | +|---- | -----| +| ALL | "ALL" | +| ANY | "ANY" | +| NONE | "NONE" | + + + diff --git a/docs/AlertTriggerParamsAlertPayloadConditionsConditionsInner.md b/docs/AlertTriggerParamsAlertPayloadConditionsConditionsInner.md new file mode 100644 index 00000000..8406b750 --- /dev/null +++ b/docs/AlertTriggerParamsAlertPayloadConditionsConditionsInner.md @@ -0,0 +1,32 @@ + + +# AlertTriggerParamsAlertPayloadConditionsConditionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**query** | **String** | | | +|**operator** | [**OperatorEnum**](#OperatorEnum) | | | +|**values** | **List<String>** | | [optional] | +|**useRegexp** | **Boolean** | | [optional] | + + + +## Enum: OperatorEnum + +| Name | Value | +|---- | -----| +| IS | "IS" | +| IS_NOT | "IS NOT" | +| ANY | "ANY" | +| CONTAINS | "CONTAINS" | +| CONTAINS_ALL | "CONTAINS_ALL" | +| CONTAINS_NONE | "CONTAINS_NONE" | +| NONE | "NONE" | +| SET | "SET" | +| UNSET | "UNSET" | + + + diff --git a/docs/ApiKey.md b/docs/ApiKey.md new file mode 100644 index 00000000..5f9ce7f5 --- /dev/null +++ b/docs/ApiKey.md @@ -0,0 +1,32 @@ + + +# ApiKey + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the API key | | +|**description** | **String** | A description of the API key | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | The kind of the API key | | +|**roleId** | **String** | The role ID | [optional] | +|**onCallRoleId** | **String** | The on-call role ID | [optional] | +|**createdAt** | **String** | Date of creation | | +|**updatedAt** | **String** | Date of last update | | +|**expiresAt** | **String** | Expiration date | [optional] | +|**lastUsedAt** | **String** | Date of last use | [optional] | +|**gracePeriodEndsAt** | **String** | Grace period end date | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| PERSONAL | "personal" | +| TEAM | "team" | +| ORGANIZATION | "organization" | + + + diff --git a/docs/ApiKeyList.md b/docs/ApiKeyList.md new file mode 100644 index 00000000..3847164d --- /dev/null +++ b/docs/ApiKeyList.md @@ -0,0 +1,15 @@ + + +# ApiKeyList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<ApiKeyResponseData>**](ApiKeyResponseData.md) | | | +|**links** | [**Links**](Links.md) | | | +|**meta** | [**Meta**](Meta.md) | | | + + + diff --git a/docs/ApiKeyResponse.md b/docs/ApiKeyResponse.md new file mode 100644 index 00000000..3c9e8412 --- /dev/null +++ b/docs/ApiKeyResponse.md @@ -0,0 +1,13 @@ + + +# ApiKeyResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**ApiKeyResponseData**](ApiKeyResponseData.md) | | | + + + diff --git a/docs/ApiKeyResponseData.md b/docs/ApiKeyResponseData.md new file mode 100644 index 00000000..4cfe1c59 --- /dev/null +++ b/docs/ApiKeyResponseData.md @@ -0,0 +1,23 @@ + + +# ApiKeyResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the API key | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**ApiKey**](ApiKey.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| API_KEYS | "api_keys" | + + + diff --git a/docs/ApiKeyWithTokenResponse.md b/docs/ApiKeyWithTokenResponse.md new file mode 100644 index 00000000..a5be96d4 --- /dev/null +++ b/docs/ApiKeyWithTokenResponse.md @@ -0,0 +1,13 @@ + + +# ApiKeyWithTokenResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**ApiKeyWithTokenResponseData**](ApiKeyWithTokenResponseData.md) | | | + + + diff --git a/docs/ApiKeyWithTokenResponseData.md b/docs/ApiKeyWithTokenResponseData.md new file mode 100644 index 00000000..6e68b146 --- /dev/null +++ b/docs/ApiKeyWithTokenResponseData.md @@ -0,0 +1,23 @@ + + +# ApiKeyWithTokenResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the API key | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**ApiKeyWithTokenResponseDataAttributes**](ApiKeyWithTokenResponseDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| API_KEYS | "api_keys" | + + + diff --git a/docs/ApiKeyWithTokenResponseDataAttributes.md b/docs/ApiKeyWithTokenResponseDataAttributes.md new file mode 100644 index 00000000..796c1914 --- /dev/null +++ b/docs/ApiKeyWithTokenResponseDataAttributes.md @@ -0,0 +1,33 @@ + + +# ApiKeyWithTokenResponseDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the API key | | +|**description** | **String** | A description of the API key | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | The kind of the API key | | +|**roleId** | **String** | The role ID | [optional] | +|**onCallRoleId** | **String** | The on-call role ID | [optional] | +|**createdAt** | **String** | Date of creation | | +|**updatedAt** | **String** | Date of last update | | +|**expiresAt** | **String** | Expiration date | [optional] | +|**lastUsedAt** | **String** | Date of last use | [optional] | +|**gracePeriodEndsAt** | **String** | Grace period end date | [optional] | +|**token** | **String** | The API key token (only shown once) | | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| PERSONAL | "personal" | +| TEAM | "team" | +| ORGANIZATION | "organization" | + + + diff --git a/docs/ApiKeysApi.md b/docs/ApiKeysApi.md new file mode 100644 index 00000000..55ed6e94 --- /dev/null +++ b/docs/ApiKeysApi.md @@ -0,0 +1,475 @@ +# ApiKeysApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createApiKey**](ApiKeysApi.md#createApiKey) | **POST** /v1/api_keys | Creates an API key | +| [**deleteApiKey**](ApiKeysApi.md#deleteApiKey) | **DELETE** /v1/api_keys/{id} | Revoke an API key | +| [**getApiKey**](ApiKeysApi.md#getApiKey) | **GET** /v1/api_keys/{id} | Retrieves an API key | +| [**listApiKeys**](ApiKeysApi.md#listApiKeys) | **GET** /v1/api_keys | List API keys | +| [**rotateApiKey**](ApiKeysApi.md#rotateApiKey) | **POST** /v1/api_keys/{id}/rotate | Rotate an API key | +| [**updateApiKey**](ApiKeysApi.md#updateApiKey) | **PUT** /v1/api_keys/{id} | Update an API key | + + + +# **createApiKey** +> ApiKeyWithTokenResponse createApiKey(newApiKey) + +Creates an API key + +Creates a new API key and returns it with the plaintext token. **The token is only returned once** — store it securely, as it cannot be retrieved again. **Kinds and required fields:** - `personal` — created for the authenticated user. No additional fields required. - `team` — scoped to a team (group). Requires `group_id`. A service account is automatically created with permissions derived from group membership. - `organization` — organization-wide access. Requires owner or admin role. Optionally set `role_id` and `on_call_role_id` to control the service account's permissions. **Expiration:** All keys require an `expires_at` date set in the future (maximum 5 years). Names must be unique within their kind and scope. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.ApiKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + ApiKeysApi apiInstance = new ApiKeysApi(defaultClient); + NewApiKey newApiKey = new NewApiKey(); // NewApiKey | + try { + ApiKeyWithTokenResponse result = apiInstance.createApiKey(newApiKey); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiKeysApi#createApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newApiKey** | [**NewApiKey**](NewApiKey.md)| | | + +### Return type + +[**ApiKeyWithTokenResponse**](ApiKeyWithTokenResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | API key created | - | +| **422** | invalid request | - | +| **401** | responds with unauthorized for invalid token | - | + + +# **deleteApiKey** +> ApiKeyResponse deleteApiKey(id) + +Revoke an API key + +Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. This action cannot be undone. For `team` and `organization` keys, the associated service account is also deleted. Any active sessions using this key will fail on the next request. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.ApiKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + ApiKeysApi apiInstance = new ApiKeysApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | + try { + ApiKeyResponse result = apiInstance.deleteApiKey(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiKeysApi#deleteApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| | | + +### Return type + +[**ApiKeyResponse**](ApiKeyResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API key revoked | - | +| **404** | API key not found | - | + + +# **getApiKey** +> ApiKeyResponse getApiKey(id, include) + +Retrieves an API key + +Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, last usage timestamp, and the grace period status — the secret token is never included. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.ApiKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + ApiKeysApi apiInstance = new ApiKeysApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | + String include = "include_example"; // String | Comma-separated list of relationships to include (role, on_call_role, created_by, groups) + try { + ApiKeyResponse result = apiInstance.getApiKey(id, include); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiKeysApi#getApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| | | +| **include** | **String**| Comma-separated list of relationships to include (role, on_call_role, created_by, groups) | [optional] | + +### Return type + +[**ApiKeyResponse**](ApiKeyResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API key found | - | +| **404** | API key not found | - | + + +# **listApiKeys** +> ApiKeyList listApiKeys(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort) + +List API keys + +List API keys for the current organization. Returns key metadata including name, kind, expiration, and last usage — the secret token value is never included in the response. **API key kinds:** - `personal` — tied to a specific user, inherits that user's permissions. - `team` — scoped to one or more teams (groups), creates a service account with permissions derived from group membership. - `organization` — organization-wide, creates a service account with a configurable role and on-call role. **Automated rotation workflow:** Use `filter[expires_at][lt]` to find keys approaching expiration, then call the rotate endpoint to issue a new token before the old one expires. Combine with `filter[active]=true` to exclude already-expired keys. **Sorting:** Use the `sort` parameter with a field name (e.g., `sort=expires_at`). Prefix with `-` for descending order (e.g., `sort=-created_at`). Allowed fields: `name`, `kind`, `created_at`, `updated_at`, `expires_at`, `last_used_at`. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.ApiKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + ApiKeysApi apiInstance = new ApiKeysApi(defaultClient); + String include = "include_example"; // String | Comma-separated list of relationships to include (role, on_call_role, created_by, groups) + Integer pageNumber = 56; // Integer | + Integer pageSize = 56; // Integer | + String filterKind = "filterKind_example"; // String | Filter by API key kind: personal, team, organization + String filterSearch = "filterSearch_example"; // String | Search by name (case-insensitive partial match) + String filterName = "filterName_example"; // String | Filter by exact name + String filterUserId = "filterUserId_example"; // String | Filter by the user ID that owns the key + String filterGroupIds = "filterGroupIds_example"; // String | Filter team keys by group IDs (comma-separated) + String filterRoleId = "filterRoleId_example"; // String | Filter by role ID + Boolean filterActive = true; // Boolean | When true, return only non-expired keys + Boolean filterExpired = true; // Boolean | When true, return only expired keys + String filterCreatedAtGt = "filterCreatedAtGt_example"; // String | Created after (ISO 8601) + String filterCreatedAtGte = "filterCreatedAtGte_example"; // String | Created at or after (ISO 8601) + String filterCreatedAtLt = "filterCreatedAtLt_example"; // String | Created before (ISO 8601) + String filterCreatedAtLte = "filterCreatedAtLte_example"; // String | Created at or before (ISO 8601) + String filterExpiresAtGt = "filterExpiresAtGt_example"; // String | Expires after (ISO 8601) + String filterExpiresAtGte = "filterExpiresAtGte_example"; // String | Expires at or after (ISO 8601) + String filterExpiresAtLt = "filterExpiresAtLt_example"; // String | Expires before (ISO 8601). Useful for finding keys approaching expiration. + String filterExpiresAtLte = "filterExpiresAtLte_example"; // String | Expires at or before (ISO 8601) + String filterLastUsedAtGt = "filterLastUsedAtGt_example"; // String | Last used after (ISO 8601) + String filterLastUsedAtGte = "filterLastUsedAtGte_example"; // String | Last used at or after (ISO 8601) + String filterLastUsedAtLt = "filterLastUsedAtLt_example"; // String | Last used before (ISO 8601) + String filterLastUsedAtLte = "filterLastUsedAtLte_example"; // String | Last used at or before (ISO 8601) + String sort = "sort_example"; // String | Sort by field. Prefix with - for descending (e.g., -created_at, expires_at) + try { + ApiKeyList result = apiInstance.listApiKeys(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiKeysApi#listApiKeys"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **include** | **String**| Comma-separated list of relationships to include (role, on_call_role, created_by, groups) | [optional] | +| **pageNumber** | **Integer**| | [optional] | +| **pageSize** | **Integer**| | [optional] | +| **filterKind** | **String**| Filter by API key kind: personal, team, organization | [optional] | +| **filterSearch** | **String**| Search by name (case-insensitive partial match) | [optional] | +| **filterName** | **String**| Filter by exact name | [optional] | +| **filterUserId** | **String**| Filter by the user ID that owns the key | [optional] | +| **filterGroupIds** | **String**| Filter team keys by group IDs (comma-separated) | [optional] | +| **filterRoleId** | **String**| Filter by role ID | [optional] | +| **filterActive** | **Boolean**| When true, return only non-expired keys | [optional] | +| **filterExpired** | **Boolean**| When true, return only expired keys | [optional] | +| **filterCreatedAtGt** | **String**| Created after (ISO 8601) | [optional] | +| **filterCreatedAtGte** | **String**| Created at or after (ISO 8601) | [optional] | +| **filterCreatedAtLt** | **String**| Created before (ISO 8601) | [optional] | +| **filterCreatedAtLte** | **String**| Created at or before (ISO 8601) | [optional] | +| **filterExpiresAtGt** | **String**| Expires after (ISO 8601) | [optional] | +| **filterExpiresAtGte** | **String**| Expires at or after (ISO 8601) | [optional] | +| **filterExpiresAtLt** | **String**| Expires before (ISO 8601). Useful for finding keys approaching expiration. | [optional] | +| **filterExpiresAtLte** | **String**| Expires at or before (ISO 8601) | [optional] | +| **filterLastUsedAtGt** | **String**| Last used after (ISO 8601) | [optional] | +| **filterLastUsedAtGte** | **String**| Last used at or after (ISO 8601) | [optional] | +| **filterLastUsedAtLt** | **String**| Last used before (ISO 8601) | [optional] | +| **filterLastUsedAtLte** | **String**| Last used at or before (ISO 8601) | [optional] | +| **sort** | **String**| Sort by field. Prefix with - for descending (e.g., -created_at, expires_at) | [optional] | + +### Return type + +[**ApiKeyList**](ApiKeyList.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | success | - | +| **401** | responds with unauthorized for invalid token | - | + + +# **rotateApiKey** +> ApiKeyWithTokenResponse rotateApiKey(id, rotateApiKey) + +Rotate an API key + +Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown once**, so store it securely. **Self-only:** You can only rotate the API key that was used to authenticate this request. Attempting to rotate a different key returns `403 Forbidden`. **Grace period:** When enabled for your organization, the previous token remains valid after rotation, giving you time to deploy the new token without downtime. Pass `grace_period_minutes` (integer, 0–1440, default 30) to control how long the old token stays valid. Set to 0 to immediately invalidate the old token. The `grace_period_ends_at` field in the response confirms the exact time the old token will stop working. **Expiration:** Optionally provide a new `expires_at` date (ISO 8601, up to 5 years). Defaults to 90 days from now if omitted. Dates in the past are rejected. **Typical rotation workflow:** 1. Call this endpoint to get a new token (optionally with a custom `grace_period_minutes`). 2. Deploy the new token to your systems. 3. The old token continues working for `grace_period_minutes` (if grace period is enabled). 4. After the grace period, the old token is automatically invalidated. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.ApiKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + ApiKeysApi apiInstance = new ApiKeysApi(defaultClient); + String id = "id_example"; // String | + RotateApiKey rotateApiKey = new RotateApiKey(); // RotateApiKey | + try { + ApiKeyWithTokenResponse result = apiInstance.rotateApiKey(id, rotateApiKey); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiKeysApi#rotateApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | +| **rotateApiKey** | [**RotateApiKey**](RotateApiKey.md)| | [optional] | + +### Return type + +[**ApiKeyWithTokenResponse**](ApiKeyWithTokenResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API key rotated | - | +| **404** | API key not found | - | + + +# **updateApiKey** +> ApiKeyResponse updateApiKey(id, updateApiKey) + +Update an API key + +Update an API key's mutable attributes: `name`, `description`, and `expires_at`. The key's `kind`, `role_id`, `on_call_role_id`, and token cannot be changed after creation. To issue a new token, use the rotate endpoint. To change the role or kind, revoke the key and create a new one. The new `expires_at` must be in the future and within 5 years. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.ApiKeysApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + ApiKeysApi apiInstance = new ApiKeysApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | + UpdateApiKey updateApiKey = new UpdateApiKey(); // UpdateApiKey | + try { + ApiKeyResponse result = apiInstance.updateApiKey(id, updateApiKey); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiKeysApi#updateApiKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| | | +| **updateApiKey** | [**UpdateApiKey**](UpdateApiKey.md)| | | + +### Return type + +[**ApiKeyResponse**](ApiKeyResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | API key updated | - | +| **404** | API key not found | - | + diff --git a/docs/BuiltinField.md b/docs/BuiltinField.md new file mode 100644 index 00000000..6af57f40 --- /dev/null +++ b/docs/BuiltinField.md @@ -0,0 +1,22 @@ + + +# BuiltinField + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fieldSource** | [**FieldSourceEnum**](#FieldSourceEnum) | | | +|**fieldKey** | **String** | Key identifying the builtin field | | + + + +## Enum: FieldSourceEnum + +| Name | Value | +|---- | -----| +| BUILTIN | "builtin" | + + + diff --git a/docs/CatalogChecklistTemplate.md b/docs/CatalogChecklistTemplate.md new file mode 100644 index 00000000..8738e934 --- /dev/null +++ b/docs/CatalogChecklistTemplate.md @@ -0,0 +1,45 @@ + + +# CatalogChecklistTemplate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the checklist template | | +|**slug** | **String** | The slug of the checklist template | [optional] | +|**description** | **String** | The description of the checklist template | [optional] | +|**catalogType** | [**CatalogTypeEnum**](#CatalogTypeEnum) | The catalog type | | +|**scopeType** | [**ScopeTypeEnum**](#ScopeTypeEnum) | The scope type | | +|**scopeId** | **String** | The scope ID | | +|**createdAt** | **String** | Date of creation | | +|**updatedAt** | **String** | Date of last update | | +|**fields** | [**List<CatalogChecklistTemplateFieldsInner>**](CatalogChecklistTemplateFieldsInner.md) | Template fields in position order | [optional] | +|**owners** | [**List<CatalogChecklistTemplateOwnersInner>**](CatalogChecklistTemplateOwnersInner.md) | Template owners | [optional] | + + + +## Enum: CatalogTypeEnum + +| Name | Value | +|---- | -----| +| SERVICE | "Service" | +| FUNCTIONALITY | "Functionality" | +| ENVIRONMENT | "Environment" | +| GROUP | "Group" | +| CAUSE | "Cause" | +| INCIDENT_TYPE | "IncidentType" | +| CATALOG | "Catalog" | + + + +## Enum: ScopeTypeEnum + +| Name | Value | +|---- | -----| +| TEAM | "Team" | +| CATALOG | "Catalog" | + + + diff --git a/docs/CatalogChecklistTemplateFieldsInner.md b/docs/CatalogChecklistTemplateFieldsInner.md new file mode 100644 index 00000000..62cea492 --- /dev/null +++ b/docs/CatalogChecklistTemplateFieldsInner.md @@ -0,0 +1,24 @@ + + +# CatalogChecklistTemplateFieldsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fieldSource** | [**FieldSourceEnum**](#FieldSourceEnum) | Source of the field | [optional] | +|**fieldKey** | **String** | Key identifying the field | [optional] | +|**catalogPropertyId** | **String** | ID of the catalog property for custom fields | [optional] | + + + +## Enum: FieldSourceEnum + +| Name | Value | +|---- | -----| +| BUILTIN | "builtin" | +| CUSTOM | "custom" | + + + diff --git a/docs/CatalogChecklistTemplateList.md b/docs/CatalogChecklistTemplateList.md new file mode 100644 index 00000000..d66b6a53 --- /dev/null +++ b/docs/CatalogChecklistTemplateList.md @@ -0,0 +1,15 @@ + + +# CatalogChecklistTemplateList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<CatalogChecklistTemplateResponseData>**](CatalogChecklistTemplateResponseData.md) | | | +|**links** | [**Links**](Links.md) | | [optional] | +|**meta** | [**Meta**](Meta.md) | | [optional] | + + + diff --git a/docs/CatalogChecklistTemplateOwnersInner.md b/docs/CatalogChecklistTemplateOwnersInner.md new file mode 100644 index 00000000..bbc293f9 --- /dev/null +++ b/docs/CatalogChecklistTemplateOwnersInner.md @@ -0,0 +1,23 @@ + + +# CatalogChecklistTemplateOwnersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | User ID for user owners, or field key for field owners | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | Type of owner | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| FIELD | "field" | +| USER | "user" | + + + diff --git a/docs/CatalogChecklistTemplateResponse.md b/docs/CatalogChecklistTemplateResponse.md new file mode 100644 index 00000000..e9311087 --- /dev/null +++ b/docs/CatalogChecklistTemplateResponse.md @@ -0,0 +1,13 @@ + + +# CatalogChecklistTemplateResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**CatalogChecklistTemplateResponseData**](CatalogChecklistTemplateResponseData.md) | | | + + + diff --git a/docs/CatalogChecklistTemplateResponseData.md b/docs/CatalogChecklistTemplateResponseData.md new file mode 100644 index 00000000..a6418664 --- /dev/null +++ b/docs/CatalogChecklistTemplateResponseData.md @@ -0,0 +1,23 @@ + + +# CatalogChecklistTemplateResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the checklist template | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**CatalogChecklistTemplate**](CatalogChecklistTemplate.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_CHECKLIST_TEMPLATES | "catalog_checklist_templates" | + + + diff --git a/docs/CatalogChecklistTemplatesApi.md b/docs/CatalogChecklistTemplatesApi.md new file mode 100644 index 00000000..fad71a9d --- /dev/null +++ b/docs/CatalogChecklistTemplatesApi.md @@ -0,0 +1,445 @@ +# CatalogChecklistTemplatesApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createCatalogChecklistTemplate**](CatalogChecklistTemplatesApi.md#createCatalogChecklistTemplate) | **POST** /v1/catalog_checklist_templates | Creates a catalog checklist template | +| [**deleteCatalogChecklistTemplate**](CatalogChecklistTemplatesApi.md#deleteCatalogChecklistTemplate) | **DELETE** /v1/catalog_checklist_templates/{id} | Delete a catalog checklist template | +| [**getCatalogChecklistTemplate**](CatalogChecklistTemplatesApi.md#getCatalogChecklistTemplate) | **GET** /v1/catalog_checklist_templates/{id} | Retrieves a catalog checklist template | +| [**listCatalogChecklistTemplates**](CatalogChecklistTemplatesApi.md#listCatalogChecklistTemplates) | **GET** /v1/catalog_checklist_templates | List catalog checklist templates | +| [**triggerCatalogChecklistTemplate**](CatalogChecklistTemplatesApi.md#triggerCatalogChecklistTemplate) | **POST** /v1/catalog_checklist_templates/{id}/trigger | Trigger an audit for a catalog checklist template | +| [**updateCatalogChecklistTemplate**](CatalogChecklistTemplatesApi.md#updateCatalogChecklistTemplate) | **PUT** /v1/catalog_checklist_templates/{id} | Update a catalog checklist template | + + + +# **createCatalogChecklistTemplate** +> CatalogChecklistTemplateResponse createCatalogChecklistTemplate(newCatalogChecklistTemplate) + +Creates a catalog checklist template + +Creates a new catalog checklist template + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogChecklistTemplatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogChecklistTemplatesApi apiInstance = new CatalogChecklistTemplatesApi(defaultClient); + NewCatalogChecklistTemplate newCatalogChecklistTemplate = new NewCatalogChecklistTemplate(); // NewCatalogChecklistTemplate | + try { + CatalogChecklistTemplateResponse result = apiInstance.createCatalogChecklistTemplate(newCatalogChecklistTemplate); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogChecklistTemplatesApi#createCatalogChecklistTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newCatalogChecklistTemplate** | [**NewCatalogChecklistTemplate**](NewCatalogChecklistTemplate.md)| | | + +### Return type + +[**CatalogChecklistTemplateResponse**](CatalogChecklistTemplateResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | ignores user-provided field_key for custom fields | - | +| **422** | returns 422 when scope_type is missing for Catalog scope_id | - | +| **401** | responds with unauthorized for invalid token | - | + + +# **deleteCatalogChecklistTemplate** +> CatalogChecklistTemplateResponse deleteCatalogChecklistTemplate(id) + +Delete a catalog checklist template + +Delete a specific catalog checklist template by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogChecklistTemplatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogChecklistTemplatesApi apiInstance = new CatalogChecklistTemplatesApi(defaultClient); + GetAlertFieldIdParameter id = new GetAlertFieldIdParameter(); // GetAlertFieldIdParameter | + try { + CatalogChecklistTemplateResponse result = apiInstance.deleteCatalogChecklistTemplate(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogChecklistTemplatesApi#deleteCatalogChecklistTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | [**GetAlertFieldIdParameter**](.md)| | | + +### Return type + +[**CatalogChecklistTemplateResponse**](CatalogChecklistTemplateResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | catalog checklist template deleted | - | +| **404** | catalog checklist template not found | - | + + +# **getCatalogChecklistTemplate** +> CatalogChecklistTemplateResponse getCatalogChecklistTemplate(id) + +Retrieves a catalog checklist template + +Retrieves a specific catalog checklist template by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogChecklistTemplatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogChecklistTemplatesApi apiInstance = new CatalogChecklistTemplatesApi(defaultClient); + GetAlertFieldIdParameter id = new GetAlertFieldIdParameter(); // GetAlertFieldIdParameter | + try { + CatalogChecklistTemplateResponse result = apiInstance.getCatalogChecklistTemplate(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogChecklistTemplatesApi#getCatalogChecklistTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | [**GetAlertFieldIdParameter**](.md)| | | + +### Return type + +[**CatalogChecklistTemplateResponse**](CatalogChecklistTemplateResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | catalog checklist template found by slug | - | +| **404** | resource not found for another team | - | + + +# **listCatalogChecklistTemplates** +> CatalogChecklistTemplateList listCatalogChecklistTemplates(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte) + +List catalog checklist templates + +List catalog checklist templates + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogChecklistTemplatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogChecklistTemplatesApi apiInstance = new CatalogChecklistTemplatesApi(defaultClient); + String include = "template_fields"; // String | comma separated if needed. eg: template_fields,template_owners + String sort = "created_at"; // String | comma separated if needed. eg: created_at,updated_at + Integer pageNumber = 56; // Integer | + Integer pageSize = 56; // Integer | + String filterName = "filterName_example"; // String | + String filterSlug = "filterSlug_example"; // String | + String filterCatalogType = "filterCatalogType_example"; // String | + String filterScopeType = "filterScopeType_example"; // String | + String filterCreatedAtGt = "filterCreatedAtGt_example"; // String | + String filterCreatedAtGte = "filterCreatedAtGte_example"; // String | + String filterCreatedAtLt = "filterCreatedAtLt_example"; // String | + String filterCreatedAtLte = "filterCreatedAtLte_example"; // String | + try { + CatalogChecklistTemplateList result = apiInstance.listCatalogChecklistTemplates(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogChecklistTemplatesApi#listCatalogChecklistTemplates"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **include** | **String**| comma separated if needed. eg: template_fields,template_owners | [optional] [enum: template_fields, template_owners] | +| **sort** | **String**| comma separated if needed. eg: created_at,updated_at | [optional] [enum: created_at, -created_at, updated_at, -updated_at, name, -name] | +| **pageNumber** | **Integer**| | [optional] | +| **pageSize** | **Integer**| | [optional] | +| **filterName** | **String**| | [optional] | +| **filterSlug** | **String**| | [optional] | +| **filterCatalogType** | **String**| | [optional] | +| **filterScopeType** | **String**| | [optional] | +| **filterCreatedAtGt** | **String**| | [optional] | +| **filterCreatedAtGte** | **String**| | [optional] | +| **filterCreatedAtLt** | **String**| | [optional] | +| **filterCreatedAtLte** | **String**| | [optional] | + +### Return type + +[**CatalogChecklistTemplateList**](CatalogChecklistTemplateList.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | returns empty list for another team | - | + + +# **triggerCatalogChecklistTemplate** +> triggerCatalogChecklistTemplate(id) + +Trigger an audit for a catalog checklist template + +Triggers an audit for all applicable entities of the checklist template + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogChecklistTemplatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogChecklistTemplatesApi apiInstance = new CatalogChecklistTemplatesApi(defaultClient); + GetAlertFieldIdParameter id = new GetAlertFieldIdParameter(); // GetAlertFieldIdParameter | + try { + apiInstance.triggerCatalogChecklistTemplate(id); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogChecklistTemplatesApi#triggerCatalogChecklistTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | [**GetAlertFieldIdParameter**](.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | audit triggered | - | +| **404** | resource not found for another team | - | + + +# **updateCatalogChecklistTemplate** +> CatalogChecklistTemplateResponse updateCatalogChecklistTemplate(id, updateCatalogChecklistTemplate) + +Update a catalog checklist template + +Update a specific catalog checklist template by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogChecklistTemplatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogChecklistTemplatesApi apiInstance = new CatalogChecklistTemplatesApi(defaultClient); + GetAlertFieldIdParameter id = new GetAlertFieldIdParameter(); // GetAlertFieldIdParameter | + UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate = new UpdateCatalogChecklistTemplate(); // UpdateCatalogChecklistTemplate | + try { + CatalogChecklistTemplateResponse result = apiInstance.updateCatalogChecklistTemplate(id, updateCatalogChecklistTemplate); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogChecklistTemplatesApi#updateCatalogChecklistTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | [**GetAlertFieldIdParameter**](.md)| | | +| **updateCatalogChecklistTemplate** | [**UpdateCatalogChecklistTemplate**](UpdateCatalogChecklistTemplate.md)| | | + +### Return type + +[**CatalogChecklistTemplateResponse**](CatalogChecklistTemplateResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | ignores user-provided field_key for custom fields on update | - | +| **422** | rejects duplicate custom fields on update | - | + diff --git a/docs/CatalogEntityChecklist.md b/docs/CatalogEntityChecklist.md new file mode 100644 index 00000000..d3109fd1 --- /dev/null +++ b/docs/CatalogEntityChecklist.md @@ -0,0 +1,48 @@ + + +# CatalogEntityChecklist + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**catalogChecklistTemplateId** | **String** | The ID of the checklist template | | +|**auditableType** | [**AuditableTypeEnum**](#AuditableTypeEnum) | The type of the auditable entity | | +|**auditableId** | **String** | The ID of the auditable entity | | +|**status** | [**StatusEnum**](#StatusEnum) | The status of the checklist | | +|**startedAt** | **String** | When the checklist was started | [optional] | +|**completedAt** | **String** | When the checklist was completed | [optional] | +|**completedByUserId** | **String** | The ID of the user who completed the checklist | [optional] | +|**createdAt** | **String** | Date of creation | | +|**updatedAt** | **String** | Date of last update | | +|**checklistFields** | [**List<CatalogEntityChecklistChecklistFieldsInner>**](CatalogEntityChecklistChecklistFieldsInner.md) | Checklist fields | [optional] | +|**checklistOwners** | [**List<CatalogEntityChecklistChecklistOwnersInner>**](CatalogEntityChecklistChecklistOwnersInner.md) | Checklist owners | [optional] | + + + +## Enum: AuditableTypeEnum + +| Name | Value | +|---- | -----| +| SERVICE | "Service" | +| FUNCTIONALITY | "Functionality" | +| ENVIRONMENT | "Environment" | +| GROUP | "Group" | +| CAUSE | "Cause" | +| INCIDENT_TYPE | "IncidentType" | +| CATALOG_ENTITY | "CatalogEntity" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| TRIGGERED | "triggered" | +| IN_PROGRESS | "in_progress" | +| COMPLETED | "completed" | +| CANCELLED | "cancelled" | + + + diff --git a/docs/CatalogEntityChecklistChecklistFieldsInner.md b/docs/CatalogEntityChecklistChecklistFieldsInner.md new file mode 100644 index 00000000..b19e9a6a --- /dev/null +++ b/docs/CatalogEntityChecklistChecklistFieldsInner.md @@ -0,0 +1,13 @@ + + +# CatalogEntityChecklistChecklistFieldsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**CatalogEntityChecklistChecklistFieldsInnerData**](CatalogEntityChecklistChecklistFieldsInnerData.md) | | [optional] | + + + diff --git a/docs/CatalogEntityChecklistChecklistFieldsInnerData.md b/docs/CatalogEntityChecklistChecklistFieldsInnerData.md new file mode 100644 index 00000000..ca7bf157 --- /dev/null +++ b/docs/CatalogEntityChecklistChecklistFieldsInnerData.md @@ -0,0 +1,23 @@ + + +# CatalogEntityChecklistChecklistFieldsInnerData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | ID of the checklist field | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**attributes** | [**CatalogEntityChecklistChecklistFieldsInnerDataAttributes**](CatalogEntityChecklistChecklistFieldsInnerDataAttributes.md) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_ENTITY_CHECKLIST_FIELDS | "catalog_entity_checklist_fields" | + + + diff --git a/docs/CatalogEntityChecklistChecklistFieldsInnerDataAttributes.md b/docs/CatalogEntityChecklistChecklistFieldsInnerDataAttributes.md new file mode 100644 index 00000000..5359ab86 --- /dev/null +++ b/docs/CatalogEntityChecklistChecklistFieldsInnerDataAttributes.md @@ -0,0 +1,21 @@ + + +# CatalogEntityChecklistChecklistFieldsInnerDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**catalogEntityChecklistId** | **String** | The ID of the parent checklist | [optional] | +|**catalogChecklistTemplateFieldId** | **String** | The ID of the template field | [optional] | +|**fieldKey** | **String** | The field key | [optional] | +|**checked** | **Boolean** | Whether the field is checked | [optional] | +|**valueSnapshot** | **Object** | The value snapshot at time of checking | [optional] | +|**completedByUserId** | **String** | The ID of the user who checked the field | [optional] | +|**completedAt** | **String** | When the field was checked | [optional] | +|**createdAt** | **String** | Date of creation | [optional] | +|**updatedAt** | **String** | Date of last update | [optional] | + + + diff --git a/docs/CatalogEntityChecklistChecklistOwnersInner.md b/docs/CatalogEntityChecklistChecklistOwnersInner.md new file mode 100644 index 00000000..3acdda0a --- /dev/null +++ b/docs/CatalogEntityChecklistChecklistOwnersInner.md @@ -0,0 +1,13 @@ + + +# CatalogEntityChecklistChecklistOwnersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**CatalogEntityChecklistChecklistOwnersInnerData**](CatalogEntityChecklistChecklistOwnersInnerData.md) | | [optional] | + + + diff --git a/docs/CatalogEntityChecklistChecklistOwnersInnerData.md b/docs/CatalogEntityChecklistChecklistOwnersInnerData.md new file mode 100644 index 00000000..4bd40ebb --- /dev/null +++ b/docs/CatalogEntityChecklistChecklistOwnersInnerData.md @@ -0,0 +1,23 @@ + + +# CatalogEntityChecklistChecklistOwnersInnerData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | ID of the checklist owner | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**attributes** | [**CatalogEntityChecklistChecklistOwnersInnerDataAttributes**](CatalogEntityChecklistChecklistOwnersInnerDataAttributes.md) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_ENTITY_CHECKLIST_OWNERS | "catalog_entity_checklist_owners" | + + + diff --git a/docs/CatalogEntityChecklistChecklistOwnersInnerDataAttributes.md b/docs/CatalogEntityChecklistChecklistOwnersInnerDataAttributes.md new file mode 100644 index 00000000..11d9cf4b --- /dev/null +++ b/docs/CatalogEntityChecklistChecklistOwnersInnerDataAttributes.md @@ -0,0 +1,16 @@ + + +# CatalogEntityChecklistChecklistOwnersInnerDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**catalogEntityChecklistId** | **String** | The ID of the parent checklist | [optional] | +|**ownerUserId** | **String** | The ID of the owner user | [optional] | +|**createdAt** | **String** | Date of creation | [optional] | +|**updatedAt** | **String** | Date of last update | [optional] | + + + diff --git a/docs/CatalogEntityChecklistList.md b/docs/CatalogEntityChecklistList.md new file mode 100644 index 00000000..0e368d72 --- /dev/null +++ b/docs/CatalogEntityChecklistList.md @@ -0,0 +1,15 @@ + + +# CatalogEntityChecklistList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<CatalogEntityChecklistResponseData>**](CatalogEntityChecklistResponseData.md) | | | +|**links** | [**Links**](Links.md) | | [optional] | +|**meta** | [**Meta**](Meta.md) | | [optional] | + + + diff --git a/docs/CatalogEntityChecklistResponse.md b/docs/CatalogEntityChecklistResponse.md new file mode 100644 index 00000000..2df8b92e --- /dev/null +++ b/docs/CatalogEntityChecklistResponse.md @@ -0,0 +1,13 @@ + + +# CatalogEntityChecklistResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**CatalogEntityChecklistResponseData**](CatalogEntityChecklistResponseData.md) | | | + + + diff --git a/docs/CatalogEntityChecklistResponseData.md b/docs/CatalogEntityChecklistResponseData.md new file mode 100644 index 00000000..d0ca6d5e --- /dev/null +++ b/docs/CatalogEntityChecklistResponseData.md @@ -0,0 +1,23 @@ + + +# CatalogEntityChecklistResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the entity checklist | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**CatalogEntityChecklist**](CatalogEntityChecklist.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_ENTITY_CHECKLISTS | "catalog_entity_checklists" | + + + diff --git a/docs/CatalogEntityChecklistsApi.md b/docs/CatalogEntityChecklistsApi.md new file mode 100644 index 00000000..816435de --- /dev/null +++ b/docs/CatalogEntityChecklistsApi.md @@ -0,0 +1,163 @@ +# CatalogEntityChecklistsApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getCatalogEntityChecklist**](CatalogEntityChecklistsApi.md#getCatalogEntityChecklist) | **GET** /v1/catalog_entity_checklists/{id} | Retrieves a catalog entity checklist | +| [**listCatalogEntityChecklists**](CatalogEntityChecklistsApi.md#listCatalogEntityChecklists) | **GET** /v1/catalog_entity_checklists | List catalog entity checklists | + + + +# **getCatalogEntityChecklist** +> CatalogEntityChecklistResponse getCatalogEntityChecklist(id) + +Retrieves a catalog entity checklist + +Retrieves a specific catalog entity checklist by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogEntityChecklistsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogEntityChecklistsApi apiInstance = new CatalogEntityChecklistsApi(defaultClient); + UUID id = UUID.randomUUID(); // UUID | + try { + CatalogEntityChecklistResponse result = apiInstance.getCatalogEntityChecklist(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogEntityChecklistsApi#getCatalogEntityChecklist"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **UUID**| | | + +### Return type + +[**CatalogEntityChecklistResponse**](CatalogEntityChecklistResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | catalog entity checklist found | - | +| **404** | resource not found for another team | - | + + +# **listCatalogEntityChecklists** +> CatalogEntityChecklistList listCatalogEntityChecklists(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte) + +List catalog entity checklists + +List catalog entity checklists + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogEntityChecklistsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogEntityChecklistsApi apiInstance = new CatalogEntityChecklistsApi(defaultClient); + Integer pageNumber = 56; // Integer | + Integer pageSize = 56; // Integer | + String filterStatus = "filterStatus_example"; // String | + String filterCatalogChecklistTemplateId = "filterCatalogChecklistTemplateId_example"; // String | + String filterAuditableType = "filterAuditableType_example"; // String | + String filterAuditableId = "filterAuditableId_example"; // String | + String filterCreatedAtGt = "filterCreatedAtGt_example"; // String | + String filterCreatedAtGte = "filterCreatedAtGte_example"; // String | + String filterCreatedAtLt = "filterCreatedAtLt_example"; // String | + String filterCreatedAtLte = "filterCreatedAtLte_example"; // String | + try { + CatalogEntityChecklistList result = apiInstance.listCatalogEntityChecklists(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogEntityChecklistsApi#listCatalogEntityChecklists"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pageNumber** | **Integer**| | [optional] | +| **pageSize** | **Integer**| | [optional] | +| **filterStatus** | **String**| | [optional] | +| **filterCatalogChecklistTemplateId** | **String**| | [optional] | +| **filterAuditableType** | **String**| | [optional] | +| **filterAuditableId** | **String**| | [optional] | +| **filterCreatedAtGt** | **String**| | [optional] | +| **filterCreatedAtGte** | **String**| | [optional] | +| **filterCreatedAtLt** | **String**| | [optional] | +| **filterCreatedAtLte** | **String**| | [optional] | + +### Return type + +[**CatalogEntityChecklistList**](CatalogEntityChecklistList.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | returns empty list for another team | - | + diff --git a/docs/CatalogPropertiesApi.md b/docs/CatalogPropertiesApi.md new file mode 100644 index 00000000..58e902f7 --- /dev/null +++ b/docs/CatalogPropertiesApi.md @@ -0,0 +1,347 @@ +# CatalogPropertiesApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createCatalogProperty**](CatalogPropertiesApi.md#createCatalogProperty) | **POST** /v1/catalogs/{catalog_id}/properties | Creates a Catalog Property (alias for field) | +| [**deleteCatalogProperty**](CatalogPropertiesApi.md#deleteCatalogProperty) | **DELETE** /v1/catalog_properties/{id} | Delete a catalog_property | +| [**getCatalogProperty**](CatalogPropertiesApi.md#getCatalogProperty) | **GET** /v1/catalog_properties/{id} | Retrieves a Catalog Property (alias for field) | +| [**listCatalogProperties**](CatalogPropertiesApi.md#listCatalogProperties) | **GET** /v1/catalogs/{catalog_id}/properties | List Catalog Properties (alias for fields) | +| [**updateCatalogProperty**](CatalogPropertiesApi.md#updateCatalogProperty) | **PUT** /v1/catalog_properties/{id} | Update a catalog_property (alias for field) | + + + +# **createCatalogProperty** +> createCatalogProperty(catalogId, newCatalogField) + +Creates a Catalog Property (alias for field) + +Creates a new Catalog Property - returns catalog_properties type + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogPropertiesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogPropertiesApi apiInstance = new CatalogPropertiesApi(defaultClient); + String catalogId = "catalogId_example"; // String | + NewCatalogField newCatalogField = new NewCatalogField(); // NewCatalogField | + try { + apiInstance.createCatalogProperty(catalogId, newCatalogField); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogPropertiesApi#createCatalogProperty"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **catalogId** | **String**| | | +| **newCatalogField** | [**NewCatalogField**](NewCatalogField.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | catalog_property created | - | + + +# **deleteCatalogProperty** +> deleteCatalogProperty(id) + +Delete a catalog_property + +Delete a specific catalog_property by id - returns catalog_properties type + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogPropertiesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogPropertiesApi apiInstance = new CatalogPropertiesApi(defaultClient); + String id = "id_example"; // String | + try { + apiInstance.deleteCatalogProperty(id); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogPropertiesApi#deleteCatalogProperty"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | catalog_property deleted | - | + + +# **getCatalogProperty** +> getCatalogProperty(id) + +Retrieves a Catalog Property (alias for field) + +Retrieves a specific Catalog Property by id - returns catalog_properties type + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogPropertiesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogPropertiesApi apiInstance = new CatalogPropertiesApi(defaultClient); + String id = "id_example"; // String | + try { + apiInstance.getCatalogProperty(id); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogPropertiesApi#getCatalogProperty"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | catalog_property found | - | + + +# **listCatalogProperties** +> listCatalogProperties(catalogId) + +List Catalog Properties (alias for fields) + +List Catalog Properties - returns catalog_properties type + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogPropertiesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogPropertiesApi apiInstance = new CatalogPropertiesApi(defaultClient); + String catalogId = "catalogId_example"; // String | + try { + apiInstance.listCatalogProperties(catalogId); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogPropertiesApi#listCatalogProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **catalogId** | **String**| | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | success with catalog_properties type | - | + + +# **updateCatalogProperty** +> updateCatalogProperty(id, updateCatalogField) + +Update a catalog_property (alias for field) + +Update a specific catalog_property by id - returns catalog_properties type + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.CatalogPropertiesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + CatalogPropertiesApi apiInstance = new CatalogPropertiesApi(defaultClient); + String id = "id_example"; // String | + UpdateCatalogField updateCatalogField = new UpdateCatalogField(); // UpdateCatalogField | + try { + apiInstance.updateCatalogProperty(id, updateCatalogField); + } catch (ApiException e) { + System.err.println("Exception when calling CatalogPropertiesApi#updateCatalogProperty"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | +| **updateCatalogField** | [**UpdateCatalogField**](UpdateCatalogField.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | catalog_property updated | - | + diff --git a/docs/CatalogProperty.md b/docs/CatalogProperty.md new file mode 100644 index 00000000..72edacfd --- /dev/null +++ b/docs/CatalogProperty.md @@ -0,0 +1,46 @@ + + +# CatalogProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**catalogId** | **String** | | | +|**name** | **String** | | | +|**slug** | **String** | | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | | | +|**kindCatalogId** | **String** | Restricts values to items of specified catalog. | [optional] | +|**multiple** | **Boolean** | Whether the attribute accepts multiple values. | | +|**position** | **Integer** | Default position of the item when displayed in a list. | | +|**required** | **Boolean** | Whether the property is required. | [optional] | +|**catalogType** | [**CatalogTypeEnum**](#CatalogTypeEnum) | The type of catalog the property belongs to. | [optional] | +|**createdAt** | **String** | | | +|**updatedAt** | **String** | | | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| TEXT | "text" | +| REFERENCE | "reference" | + + + +## Enum: CatalogTypeEnum + +| Name | Value | +|---- | -----| +| CATALOG | "catalog" | +| CAUSE | "cause" | +| ENVIRONMENT | "environment" | +| FUNCTIONALITY | "functionality" | +| INCIDENT_TYPE | "incident_type" | +| SERVICE | "service" | +| TEAM | "team" | + + + diff --git a/docs/CatalogPropertyList.md b/docs/CatalogPropertyList.md new file mode 100644 index 00000000..776dda39 --- /dev/null +++ b/docs/CatalogPropertyList.md @@ -0,0 +1,15 @@ + + +# CatalogPropertyList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<CatalogPropertyResponseData>**](CatalogPropertyResponseData.md) | | | +|**links** | [**Links**](Links.md) | | | +|**meta** | [**Meta**](Meta.md) | | | + + + diff --git a/docs/CatalogPropertyResponse.md b/docs/CatalogPropertyResponse.md new file mode 100644 index 00000000..ff236dc7 --- /dev/null +++ b/docs/CatalogPropertyResponse.md @@ -0,0 +1,13 @@ + + +# CatalogPropertyResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**CatalogPropertyResponseData**](CatalogPropertyResponseData.md) | | | + + + diff --git a/docs/CatalogPropertyResponseData.md b/docs/CatalogPropertyResponseData.md new file mode 100644 index 00000000..136a8761 --- /dev/null +++ b/docs/CatalogPropertyResponseData.md @@ -0,0 +1,23 @@ + + +# CatalogPropertyResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the catalog_property | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**CatalogProperty**](CatalogProperty.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_PROPERTIES | "catalog_properties" | + + + diff --git a/docs/CommunicationsTemplateCommunicationTemplateStagesInnerData.md b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerData.md new file mode 100644 index 00000000..5336392f --- /dev/null +++ b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerData.md @@ -0,0 +1,23 @@ + + +# CommunicationsTemplateCommunicationTemplateStagesInnerData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | ID of the communication template stage | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**attributes** | [**CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes**](CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.md) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| COMMUNICATIONS_TEMPLATE_STAGES | "communications_template_stages" | + + + diff --git a/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.md b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.md new file mode 100644 index 00000000..b2ed441e --- /dev/null +++ b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.md @@ -0,0 +1,20 @@ + + +# CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**emailBody** | **String** | Email body for the stage | [optional] | +|**emailSubject** | **String** | Email subject for the stage | [optional] | +|**slackContent** | **String** | Slack content for the stage | [optional] | +|**smsContent** | **String** | SMS content for the stage | [optional] | +|**createdAt** | **String** | Date of creation | [optional] | +|**updatedAt** | **String** | Date of last update | [optional] | +|**communicationStage** | [**CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage**](CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.md) | | [optional] | +|**communicationTemplate** | [**CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate**](CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.md) | | [optional] | + + + diff --git a/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.md b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.md new file mode 100644 index 00000000..30c59c04 --- /dev/null +++ b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.md @@ -0,0 +1,14 @@ + + +# CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The communication stage ID | [optional] | +|**name** | **String** | The communication stage name | [optional] | + + + diff --git a/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.md b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.md new file mode 100644 index 00000000..1ccaaa32 --- /dev/null +++ b/docs/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.md @@ -0,0 +1,14 @@ + + +# CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | The communication template ID | [optional] | +|**name** | **String** | The communication template name | [optional] | + + + diff --git a/docs/CreateEdgeConnectorActionRequest.md b/docs/CreateEdgeConnectorActionRequest.md new file mode 100644 index 00000000..9c47a018 --- /dev/null +++ b/docs/CreateEdgeConnectorActionRequest.md @@ -0,0 +1,13 @@ + + +# CreateEdgeConnectorActionRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**action** | [**CreateEdgeConnectorActionRequestAction**](CreateEdgeConnectorActionRequestAction.md) | | [optional] | + + + diff --git a/docs/CreateEdgeConnectorActionRequestAction.md b/docs/CreateEdgeConnectorActionRequestAction.md new file mode 100644 index 00000000..d8802ed2 --- /dev/null +++ b/docs/CreateEdgeConnectorActionRequestAction.md @@ -0,0 +1,24 @@ + + +# CreateEdgeConnectorActionRequestAction + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Action name | | +|**actionType** | [**ActionTypeEnum**](#ActionTypeEnum) | Action type | | +|**metadata** | [**CreateEdgeConnectorActionRequestActionMetadata**](CreateEdgeConnectorActionRequestActionMetadata.md) | | [optional] | + + + +## Enum: ActionTypeEnum + +| Name | Value | +|---- | -----| +| SCRIPT | "script" | +| HTTP | "http" | + + + diff --git a/docs/CreateEdgeConnectorActionRequestActionMetadata.md b/docs/CreateEdgeConnectorActionRequestActionMetadata.md new file mode 100644 index 00000000..71618afb --- /dev/null +++ b/docs/CreateEdgeConnectorActionRequestActionMetadata.md @@ -0,0 +1,15 @@ + + +# CreateEdgeConnectorActionRequestActionMetadata + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**description** | **String** | | [optional] | +|**timeout** | **Integer** | | [optional] | +|**parameters** | [**List<CreateEdgeConnectorActionRequestActionMetadataParametersInner>**](CreateEdgeConnectorActionRequestActionMetadataParametersInner.md) | | [optional] | + + + diff --git a/docs/CreateEdgeConnectorActionRequestActionMetadataParametersInner.md b/docs/CreateEdgeConnectorActionRequestActionMetadataParametersInner.md new file mode 100644 index 00000000..e19dbea2 --- /dev/null +++ b/docs/CreateEdgeConnectorActionRequestActionMetadataParametersInner.md @@ -0,0 +1,27 @@ + + +# CreateEdgeConnectorActionRequestActionMetadataParametersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**required** | **Boolean** | | [optional] | +|**description** | **String** | | [optional] | +|**options** | **List<String>** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| STRING | "string" | +| NUMBER | "number" | +| BOOLEAN | "boolean" | + + + diff --git a/docs/CreateEdgeConnectorRequest.md b/docs/CreateEdgeConnectorRequest.md new file mode 100644 index 00000000..d0628cca --- /dev/null +++ b/docs/CreateEdgeConnectorRequest.md @@ -0,0 +1,13 @@ + + +# CreateEdgeConnectorRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**CreateEdgeConnectorRequestData**](CreateEdgeConnectorRequestData.md) | | | + + + diff --git a/docs/CreateEdgeConnectorRequestData.md b/docs/CreateEdgeConnectorRequestData.md new file mode 100644 index 00000000..d1eabf25 --- /dev/null +++ b/docs/CreateEdgeConnectorRequestData.md @@ -0,0 +1,22 @@ + + +# CreateEdgeConnectorRequestData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**CreateEdgeConnectorRequestDataAttributes**](CreateEdgeConnectorRequestDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| EDGE_CONNECTORS | "edge_connectors" | + + + diff --git a/docs/CreateEdgeConnectorRequestDataAttributes.md b/docs/CreateEdgeConnectorRequestDataAttributes.md new file mode 100644 index 00000000..123a9a45 --- /dev/null +++ b/docs/CreateEdgeConnectorRequestDataAttributes.md @@ -0,0 +1,25 @@ + + +# CreateEdgeConnectorRequestDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | Connector name | | +|**description** | **String** | Connector description | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Connector status | [optional] | +|**subscriptions** | **List<String>** | Array of event types to subscribe to | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| ACTIVE | "active" | +| PAUSED | "paused" | + + + diff --git a/docs/CreateGithubIssueTaskParamsIssueType.md b/docs/CreateGithubIssueTaskParamsIssueType.md new file mode 100644 index 00000000..f5fc5d5d --- /dev/null +++ b/docs/CreateGithubIssueTaskParamsIssueType.md @@ -0,0 +1,15 @@ + + +# CreateGithubIssueTaskParamsIssueType + +The issue type + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/docs/CreateJsmopsAlertTaskParams.md b/docs/CreateJsmopsAlertTaskParams.md new file mode 100644 index 00000000..7f99d120 --- /dev/null +++ b/docs/CreateJsmopsAlertTaskParams.md @@ -0,0 +1,43 @@ + + +# CreateJsmopsAlertTaskParams + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskType** | [**TaskTypeEnum**](#TaskTypeEnum) | | [optional] | +|**message** | **String** | Message of the alert | | +|**description** | **String** | Description field of the alert that is generally used to provide a detailed information about the alert | [optional] | +|**teams** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | [optional] | +|**users** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | [optional] | +|**schedules** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | [optional] | +|**escalations** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | [optional] | +|**priority** | [**PriorityEnum**](#PriorityEnum) | | [optional] | +|**details** | **String** | Details payload. Can contain liquid markup and need to be valid JSON | [optional] | + + + +## Enum: TaskTypeEnum + +| Name | Value | +|---- | -----| +| CREATE_JSMOPS_ALERT | "create_jsmops_alert" | + + + +## Enum: PriorityEnum + +| Name | Value | +|---- | -----| +| P3 | "P3" | +| P1 | "P1" | +| P2 | "P2" | +| P32 | "P3" | +| P4 | "P4" | +| P5 | "P5" | +| AUTO | "auto" | + + + diff --git a/docs/EscalateAlert.md b/docs/EscalateAlert.md new file mode 100644 index 00000000..a852156c --- /dev/null +++ b/docs/EscalateAlert.md @@ -0,0 +1,13 @@ + + +# EscalateAlert + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**EscalateAlertData**](EscalateAlertData.md) | | [optional] | + + + diff --git a/docs/EscalateAlertData.md b/docs/EscalateAlertData.md new file mode 100644 index 00000000..b823a796 --- /dev/null +++ b/docs/EscalateAlertData.md @@ -0,0 +1,22 @@ + + +# EscalateAlertData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**attributes** | [**EscalateAlertDataAttributes**](EscalateAlertDataAttributes.md) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ALERTS | "alerts" | + + + diff --git a/docs/EscalateAlertDataAttributes.md b/docs/EscalateAlertDataAttributes.md new file mode 100644 index 00000000..09cd42bf --- /dev/null +++ b/docs/EscalateAlertDataAttributes.md @@ -0,0 +1,14 @@ + + +# EscalateAlertDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**escalationPolicyId** | **String** | The ID of the escalation policy to escalate to. If omitted, uses the alert's current escalation policy from metadata. Required for resolved alerts whose metadata may have been cleared. | [optional] | +|**escalationPolicyLevel** | **Integer** | The escalation policy level to escalate to. If omitted, defaults to the next level (same EP) or level 1 (different EP). | [optional] | + + + diff --git a/docs/IncidentZoomMeetingGlobalDialInNumbersInner.md b/docs/IncidentZoomMeetingGlobalDialInNumbersInner.md new file mode 100644 index 00000000..35059e08 --- /dev/null +++ b/docs/IncidentZoomMeetingGlobalDialInNumbersInner.md @@ -0,0 +1,17 @@ + + +# IncidentZoomMeetingGlobalDialInNumbersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**country** | **String** | | [optional] | +|**countryName** | **String** | | [optional] | +|**city** | **String** | | [optional] | +|**number** | **String** | | [optional] | +|**type** | **String** | | [optional] | + + + diff --git a/docs/MeetingRecording.md b/docs/MeetingRecording.md new file mode 100644 index 00000000..bcfb6962 --- /dev/null +++ b/docs/MeetingRecording.md @@ -0,0 +1,49 @@ + + +# MeetingRecording + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**platform** | [**PlatformEnum**](#PlatformEnum) | Meeting platform | | +|**sessionNumber** | **Integer** | Session number within the incident for this platform (starts at 1, increments on re-invite) | | +|**status** | [**StatusEnum**](#StatusEnum) | Current recording lifecycle status | | +|**startedAt** | **OffsetDateTime** | When the bot started recording (null if bot never joined) | [optional] | +|**endedAt** | **OffsetDateTime** | When the recording ended | [optional] | +|**durationMinutes** | **BigDecimal** | Recording duration in minutes (null if not started) | [optional] | +|**speakerCount** | **Integer** | Number of unique speakers detected in the transcript | [optional] | +|**wordCount** | **Integer** | Total word count across all transcript segments | [optional] | +|**transcriptSummary** | **String** | AI-generated summary of the meeting transcript (null if no transcript or not yet analyzed) | [optional] | +|**hasVideo** | **Boolean** | Whether a video recording file is attached | [optional] | +|**createdAt** | **OffsetDateTime** | When the recording session was created | | +|**updatedAt** | **OffsetDateTime** | When the recording session was last updated | | + + + +## Enum: PlatformEnum + +| Name | Value | +|---- | -----| +| ZOOM | "zoom" | +| GOOGLE_MEET | "google_meet" | +| MICROSOFT_TEAMS | "microsoft_teams" | +| WEBEX | "webex" | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PENDING | "pending" | +| RECORDING | "recording" | +| PAUSED | "paused" | +| CALL_ENDED | "call_ended" | +| ANALYZING | "analyzing" | +| COMPLETED | "completed" | +| FAILED | "failed" | + + + diff --git a/docs/MeetingRecordingList.md b/docs/MeetingRecordingList.md new file mode 100644 index 00000000..5dc06479 --- /dev/null +++ b/docs/MeetingRecordingList.md @@ -0,0 +1,14 @@ + + +# MeetingRecordingList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<MeetingRecordingListDataInner>**](MeetingRecordingListDataInner.md) | | | +|**meta** | [**Meta**](Meta.md) | | [optional] | + + + diff --git a/docs/MeetingRecordingListDataInner.md b/docs/MeetingRecordingListDataInner.md new file mode 100644 index 00000000..c7128239 --- /dev/null +++ b/docs/MeetingRecordingListDataInner.md @@ -0,0 +1,23 @@ + + +# MeetingRecordingListDataInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique UUID of the meeting recording | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**MeetingRecording**](MeetingRecording.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| MEETING_RECORDINGS | "meeting_recordings" | + + + diff --git a/docs/MeetingRecordingsApi.md b/docs/MeetingRecordingsApi.md new file mode 100644 index 00000000..c4a89a12 --- /dev/null +++ b/docs/MeetingRecordingsApi.md @@ -0,0 +1,627 @@ +# MeetingRecordingsApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createMeetingRecording**](MeetingRecordingsApi.md#createMeetingRecording) | **POST** /v1/incidents/{incident_id}/meeting_recordings | Create meeting recording | +| [**deleteMeetingRecording**](MeetingRecordingsApi.md#deleteMeetingRecording) | **DELETE** /v1/meeting_recordings/{id} | Delete a meeting recording | +| [**deleteMeetingRecordingVideo**](MeetingRecordingsApi.md#deleteMeetingRecordingVideo) | **DELETE** /v1/meeting_recordings/{id}/delete_video | Delete video from a meeting recording | +| [**getMeetingRecording**](MeetingRecordingsApi.md#getMeetingRecording) | **GET** /v1/meeting_recordings/{id} | Get a meeting recording | +| [**leaveMeetingRecording**](MeetingRecordingsApi.md#leaveMeetingRecording) | **POST** /v1/meeting_recordings/{id}/leave | Leave a meeting call | +| [**listMeetingRecordings**](MeetingRecordingsApi.md#listMeetingRecordings) | **GET** /v1/incidents/{incident_id}/meeting_recordings | List meeting recordings | +| [**pauseMeetingRecording**](MeetingRecordingsApi.md#pauseMeetingRecording) | **POST** /v1/meeting_recordings/{id}/pause | Pause a meeting recording | +| [**resumeMeetingRecording**](MeetingRecordingsApi.md#resumeMeetingRecording) | **POST** /v1/meeting_recordings/{id}/resume | Resume a meeting recording | +| [**stopMeetingRecording**](MeetingRecordingsApi.md#stopMeetingRecording) | **POST** /v1/meeting_recordings/{id}/stop | Stop a meeting recording | + + + +# **createMeetingRecording** +> createMeetingRecording(incidentId, platform) + +Create meeting recording + +Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, a new bot is invited (session 1). If previous sessions exist, a new session is created (re-invite). The bot joins the meeting, records audio/video, and generates a transcript when the session ends. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String incidentId = "incidentId_example"; // String | Incident UUID + String platform = "zoom"; // String | Meeting platform + try { + apiInstance.createMeetingRecording(incidentId, platform); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#createMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **incidentId** | **String**| Incident UUID | | +| **platform** | **String**| Meeting platform | [optional] [enum: zoom, google_meet, microsoft_teams, webex] | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | recording session created | - | +| **422** | validation error (e.g. bot already active) | - | + + +# **deleteMeetingRecording** +> deleteMeetingRecording(id) + +Delete a meeting recording + +Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings (pending, recording, paused) must be stopped first. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.deleteMeetingRecording(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#deleteMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | meeting recording deleted | - | +| **422** | cannot delete active recording | - | + + +# **deleteMeetingRecordingVideo** +> deleteMeetingRecordingVideo(id) + +Delete video from a meeting recording + +Delete only the video file from a meeting recording. The transcript, summary, and all metadata are preserved. Only non-active recordings with an attached video can have their video deleted. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.deleteMeetingRecordingVideo(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#deleteMeetingRecordingVideo"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | video deleted | - | +| **422** | cannot delete video (active recording or no video) | - | + + +# **getMeetingRecording** +> getMeetingRecording(id) + +Get a meeting recording + +Retrieve a single meeting recording session including its status, duration, speaker count, word count, and transcript summary. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.getMeetingRecording(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#getMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | meeting recording found | - | +| **404** | meeting recording not found | - | + + +# **leaveMeetingRecording** +> leaveMeetingRecording(id) + +Leave a meeting call + +Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the bot. The session will transition to analyzing and then completed once transcript processing finishes. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.leaveMeetingRecording(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#leaveMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | bot left the call | - | +| **422** | bot is not in a call | - | + + +# **listMeetingRecordings** +> MeetingRecordingList listMeetingRecordings(incidentId, pageNumber, pageSize) + +List meeting recordings + +List all meeting recording sessions for an incident. Returns recordings sorted by session number. Each recording represents one bot session with its own transcript, status, and metadata. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String incidentId = "incidentId_example"; // String | Incident UUID + Integer pageNumber = 56; // Integer | Page number + Integer pageSize = 56; // Integer | Number of recordings per page + try { + MeetingRecordingList result = apiInstance.listMeetingRecordings(incidentId, pageNumber, pageSize); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#listMeetingRecordings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **incidentId** | **String**| Incident UUID | | +| **pageNumber** | **Integer**| Page number | [optional] | +| **pageSize** | **Integer**| Number of recordings per page | [optional] | + +### Return type + +[**MeetingRecordingList**](MeetingRecordingList.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | meeting recordings listed | - | +| **404** | incident not found | - | + + +# **pauseMeetingRecording** +> pauseMeetingRecording(id) + +Pause a meeting recording + +Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. Use the resume endpoint to continue recording. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.pauseMeetingRecording(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#pauseMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | recording paused | - | +| **422** | recording is not active | - | + + +# **resumeMeetingRecording** +> resumeMeetingRecording(id) + +Resume a meeting recording + +Resume a paused recording session. The bot continues capturing audio/video from the meeting. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.resumeMeetingRecording(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#resumeMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | recording resumed | - | +| **422** | recording is not paused | - | + + +# **stopMeetingRecording** +> stopMeetingRecording(id) + +Stop a meeting recording + +Stop an active or paused recording. The bot finishes processing, generates a transcript, and the session status transitions to completed. This is irreversible — to record again, create a new session. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.MeetingRecordingsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + MeetingRecordingsApi apiInstance = new MeetingRecordingsApi(defaultClient); + String id = "id_example"; // String | Meeting Recording UUID + try { + apiInstance.stopMeetingRecording(id); + } catch (ApiException e) { + System.err.println("Exception when calling MeetingRecordingsApi#stopMeetingRecording"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| Meeting Recording UUID | | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | recording stopped | - | +| **422** | recording cannot be stopped | - | + diff --git a/docs/NewApiKey.md b/docs/NewApiKey.md new file mode 100644 index 00000000..f159e71f --- /dev/null +++ b/docs/NewApiKey.md @@ -0,0 +1,13 @@ + + +# NewApiKey + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**NewApiKeyData**](NewApiKeyData.md) | | | + + + diff --git a/docs/NewApiKeyData.md b/docs/NewApiKeyData.md new file mode 100644 index 00000000..97e19913 --- /dev/null +++ b/docs/NewApiKeyData.md @@ -0,0 +1,22 @@ + + +# NewApiKeyData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**NewApiKeyDataAttributes**](NewApiKeyDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| API_KEYS | "api_keys" | + + + diff --git a/docs/NewApiKeyDataAttributes.md b/docs/NewApiKeyDataAttributes.md new file mode 100644 index 00000000..a103fd84 --- /dev/null +++ b/docs/NewApiKeyDataAttributes.md @@ -0,0 +1,29 @@ + + +# NewApiKeyDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the API key | | +|**description** | **String** | A description of the API key | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | The kind of the API key | | +|**expiresAt** | **OffsetDateTime** | The expiration date of the API key (ISO 8601) | | +|**groupId** | **String** | The group (team) ID. Required when kind is 'team'. | [optional] | +|**roleId** | **String** | The role ID for organization API keys | [optional] | +|**onCallRoleId** | **String** | The on-call role ID for organization API keys | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| PERSONAL | "personal" | +| TEAM | "team" | +| ORGANIZATION | "organization" | + + + diff --git a/docs/NewCatalogChecklistTemplate.md b/docs/NewCatalogChecklistTemplate.md new file mode 100644 index 00000000..7650e021 --- /dev/null +++ b/docs/NewCatalogChecklistTemplate.md @@ -0,0 +1,13 @@ + + +# NewCatalogChecklistTemplate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**NewCatalogChecklistTemplateData**](NewCatalogChecklistTemplateData.md) | | | + + + diff --git a/docs/NewCatalogChecklistTemplateData.md b/docs/NewCatalogChecklistTemplateData.md new file mode 100644 index 00000000..12aca06c --- /dev/null +++ b/docs/NewCatalogChecklistTemplateData.md @@ -0,0 +1,22 @@ + + +# NewCatalogChecklistTemplateData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**NewCatalogChecklistTemplateDataAttributes**](NewCatalogChecklistTemplateDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_CHECKLIST_TEMPLATES | "catalog_checklist_templates" | + + + diff --git a/docs/NewCatalogChecklistTemplateDataAttributes.md b/docs/NewCatalogChecklistTemplateDataAttributes.md new file mode 100644 index 00000000..8d6f683d --- /dev/null +++ b/docs/NewCatalogChecklistTemplateDataAttributes.md @@ -0,0 +1,42 @@ + + +# NewCatalogChecklistTemplateDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the checklist template | | +|**description** | **String** | The description of the checklist template | [optional] | +|**catalogType** | [**CatalogTypeEnum**](#CatalogTypeEnum) | The catalog type | | +|**scopeType** | [**ScopeTypeEnum**](#ScopeTypeEnum) | The scope type | | +|**scopeId** | **String** | The scope ID (team or catalog UUID) | [optional] | +|**fields** | [**List<NewCatalogChecklistTemplateDataAttributesFieldsInner>**](NewCatalogChecklistTemplateDataAttributesFieldsInner.md) | Template fields. Position is determined by array order. | [optional] | +|**owners** | [**List<NewCatalogChecklistTemplateDataAttributesOwnersInner>**](NewCatalogChecklistTemplateDataAttributesOwnersInner.md) | Template owners | [optional] | + + + +## Enum: CatalogTypeEnum + +| Name | Value | +|---- | -----| +| SERVICE | "Service" | +| FUNCTIONALITY | "Functionality" | +| ENVIRONMENT | "Environment" | +| GROUP | "Group" | +| CAUSE | "Cause" | +| INCIDENT_TYPE | "IncidentType" | +| CATALOG | "Catalog" | + + + +## Enum: ScopeTypeEnum + +| Name | Value | +|---- | -----| +| TEAM | "Team" | +| CATALOG | "Catalog" | + + + diff --git a/docs/NewCatalogChecklistTemplateDataAttributesFieldsInner.md b/docs/NewCatalogChecklistTemplateDataAttributesFieldsInner.md new file mode 100644 index 00000000..2c2ac826 --- /dev/null +++ b/docs/NewCatalogChecklistTemplateDataAttributesFieldsInner.md @@ -0,0 +1,23 @@ + + +# NewCatalogChecklistTemplateDataAttributesFieldsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fieldSource** | [**FieldSourceEnum**](#FieldSourceEnum) | | | +|**fieldKey** | **String** | Ignored for custom fields (auto-derived from catalog property) | | +|**catalogPropertyId** | **String** | ID of the catalog property | | + + + +## Enum: FieldSourceEnum + +| Name | Value | +|---- | -----| +| CUSTOM | "custom" | + + + diff --git a/docs/NewCatalogChecklistTemplateDataAttributesOwnersInner.md b/docs/NewCatalogChecklistTemplateDataAttributesOwnersInner.md new file mode 100644 index 00000000..5e9036f7 --- /dev/null +++ b/docs/NewCatalogChecklistTemplateDataAttributesOwnersInner.md @@ -0,0 +1,23 @@ + + +# NewCatalogChecklistTemplateDataAttributesOwnersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | User ID for user owners, or field key for field owners | | +|**type** | [**TypeEnum**](#TypeEnum) | Type of owner | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| FIELD | "field" | +| USER | "user" | + + + diff --git a/docs/NewCatalogEntityDataAttributesPropertiesInner.md b/docs/NewCatalogEntityDataAttributesPropertiesInner.md new file mode 100644 index 00000000..3ec89a29 --- /dev/null +++ b/docs/NewCatalogEntityDataAttributesPropertiesInner.md @@ -0,0 +1,14 @@ + + +# NewCatalogEntityDataAttributesPropertiesInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**catalogPropertyId** | **String** | Unique ID of the catalog property | | +|**value** | **String** | The value for this property | | + + + diff --git a/docs/NewCatalogProperty.md b/docs/NewCatalogProperty.md new file mode 100644 index 00000000..dbfd0fdb --- /dev/null +++ b/docs/NewCatalogProperty.md @@ -0,0 +1,14 @@ + + +# NewCatalogProperty + +A catalog can have a maximum of 50 properties. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**NewCatalogPropertyData**](NewCatalogPropertyData.md) | | | + + + diff --git a/docs/NewCatalogPropertyData.md b/docs/NewCatalogPropertyData.md new file mode 100644 index 00000000..3cccf73a --- /dev/null +++ b/docs/NewCatalogPropertyData.md @@ -0,0 +1,22 @@ + + +# NewCatalogPropertyData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**NewCatalogPropertyDataAttributes**](NewCatalogPropertyDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_PROPERTIES | "catalog_properties" | + + + diff --git a/docs/NewCatalogPropertyDataAttributes.md b/docs/NewCatalogPropertyDataAttributes.md new file mode 100644 index 00000000..c7151874 --- /dev/null +++ b/docs/NewCatalogPropertyDataAttributes.md @@ -0,0 +1,51 @@ + + +# NewCatalogPropertyDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | | +|**kind** | [**KindEnum**](#KindEnum) | | | +|**kindCatalogId** | **String** | Restricts values to items of specified catalog. | [optional] | +|**multiple** | **Boolean** | Whether the attribute accepts multiple values. | [optional] | +|**position** | **Integer** | Default position of the item when displayed in a list. | [optional] | +|**required** | **Boolean** | Whether the property is required. | [optional] | +|**catalogType** | [**CatalogTypeEnum**](#CatalogTypeEnum) | The type of catalog the property belongs to. | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| TEXT | "text" | +| REFERENCE | "reference" | +| BOOLEAN | "boolean" | +| REFERENCE2 | "reference" | +| SERVICE | "service" | +| FUNCTIONALITY | "functionality" | +| ENVIRONMENT | "environment" | +| GROUP | "group" | +| CAUSE | "cause" | +| INCIDENT_TYPE | "incident_type" | +| USER | "user" | + + + +## Enum: CatalogTypeEnum + +| Name | Value | +|---- | -----| +| CATALOG | "catalog" | +| CAUSE | "cause" | +| ENVIRONMENT | "environment" | +| FUNCTIONALITY | "functionality" | +| INCIDENT_TYPE | "incident_type" | +| SERVICE | "service" | +| TEAM | "team" | + + + diff --git a/docs/NewCauseDataAttributesPropertiesInner.md b/docs/NewCauseDataAttributesPropertiesInner.md new file mode 100644 index 00000000..2c49f564 --- /dev/null +++ b/docs/NewCauseDataAttributesPropertiesInner.md @@ -0,0 +1,15 @@ + + +# NewCauseDataAttributesPropertiesInner + +Set a value for a catalog property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**catalogPropertyId** | **String** | Catalog property ID | | +|**value** | **String** | The property value | | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf.md new file mode 100644 index 00000000..f9d44d0e --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf.md @@ -0,0 +1,22 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | The type of the escalation path rule | | +|**urgencyIds** | **List<String>** | Alert urgency ids for which this escalation path should be used | | + + + +## Enum: RuleTypeEnum + +| Name | Value | +|---- | -----| +| ALERT_URGENCY | "alert_urgency" | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.md new file mode 100644 index 00000000..195f0504 --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.md @@ -0,0 +1,22 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | The type of the escalation path rule | | +|**withinWorkingHour** | **Boolean** | Whether the escalation path should be used within working hours | | + + + +## Enum: RuleTypeEnum + +| Name | Value | +|---- | -----| +| WORKING_HOUR | "working_hour" | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.md new file mode 100644 index 00000000..cb2edb40 --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.md @@ -0,0 +1,40 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | The type of the escalation path rule | | +|**jsonPath** | **String** | JSON path to extract value from payload | | +|**operator** | [**OperatorEnum**](#OperatorEnum) | How JSON path value should be matched | | +|**value** | **String** | Value with which JSON path value should be matched | [optional] | +|**values** | **List<String>** | Values to match against (for is_one_of / is_not_one_of operators) | [optional] | + + + +## Enum: RuleTypeEnum + +| Name | Value | +|---- | -----| +| JSON_PATH | "json_path" | + + + +## Enum: OperatorEnum + +| Name | Value | +|---- | -----| +| IS | "is" | +| IS_NOT | "is_not" | +| CONTAINS | "contains" | +| DOES_NOT_CONTAIN | "does_not_contain" | +| IS_ONE_OF | "is_one_of" | +| IS_NOT_ONE_OF | "is_not_one_of" | +| IS_SET | "is_set" | +| IS_NOT_SET | "is_not_set" | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.md new file mode 100644 index 00000000..c7f6be45 --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.md @@ -0,0 +1,46 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | The type of the escalation path rule | | +|**fieldableType** | **String** | The type of the fieldable (e.g., AlertField) | | +|**fieldableId** | **String** | The ID of the alert field | | +|**operator** | [**OperatorEnum**](#OperatorEnum) | How the alert field value should be matched | | +|**values** | **List<String>** | Values to match against | [optional] | + + + +## Enum: RuleTypeEnum + +| Name | Value | +|---- | -----| +| FIELD | "field" | + + + +## Enum: OperatorEnum + +| Name | Value | +|---- | -----| +| IS | "is" | +| IS_NOT | "is_not" | +| IS_ONE_OF | "is_one_of" | +| IS_NOT_ONE_OF | "is_not_one_of" | +| CONTAINS | "contains" | +| DOES_NOT_CONTAIN | "does_not_contain" | +| IS_EMPTY | "is_empty" | +| IS_NOT_EMPTY | "is_not_empty" | +| CONTAINS_KEY | "contains_key" | +| DOES_NOT_CONTAIN_KEY | "does_not_contain_key" | +| STARTS_WITH | "starts_with" | +| DOES_NOT_START_WITH | "does_not_start_with" | +| MATCHES | "matches" | +| DOES_NOT_MATCH | "does_not_match" | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.md new file mode 100644 index 00000000..a5aa06e4 --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.md @@ -0,0 +1,22 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | The type of the escalation path rule | | +|**serviceIds** | **List<String>** | Service ids for which this escalation path should be used | | + + + +## Enum: RuleTypeEnum + +| Name | Value | +|---- | -----| +| SERVICE | "service" | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.md new file mode 100644 index 00000000..c525141a --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.md @@ -0,0 +1,334 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | The type of the escalation path rule | | +|**timeZone** | [**TimeZoneEnum**](#TimeZoneEnum) | Time zone for the deferral window | | +|**timeBlocks** | [**List<NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner>**](NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.md) | Time windows during which alerts are deferred | | + + + +## Enum: RuleTypeEnum + +| Name | Value | +|---- | -----| +| DEFERRAL_WINDOW | "deferral_window" | + + + +## Enum: TimeZoneEnum + +| Name | Value | +|---- | -----| +| INTERNATIONAL_DATE_LINE_WEST | "International Date Line West" | +| ETC_GMT_12 | "Etc/GMT+12" | +| AMERICAN_SAMOA | "American Samoa" | +| PACIFIC_PAGO_PAGO | "Pacific/Pago_Pago" | +| MIDWAY_ISLAND | "Midway Island" | +| PACIFIC_MIDWAY | "Pacific/Midway" | +| HAWAII | "Hawaii" | +| PACIFIC_HONOLULU | "Pacific/Honolulu" | +| ALASKA | "Alaska" | +| AMERICA_JUNEAU | "America/Juneau" | +| PACIFIC_TIME_US_CANADA_ | "Pacific Time (US & Canada)" | +| AMERICA_LOS_ANGELES | "America/Los_Angeles" | +| TIJUANA | "Tijuana" | +| AMERICA_TIJUANA | "America/Tijuana" | +| ARIZONA | "Arizona" | +| AMERICA_PHOENIX | "America/Phoenix" | +| MAZATLAN | "Mazatlan" | +| AMERICA_MAZATLAN | "America/Mazatlan" | +| MOUNTAIN_TIME_US_CANADA_ | "Mountain Time (US & Canada)" | +| AMERICA_DENVER | "America/Denver" | +| CENTRAL_AMERICA | "Central America" | +| AMERICA_GUATEMALA | "America/Guatemala" | +| CENTRAL_TIME_US_CANADA_ | "Central Time (US & Canada)" | +| AMERICA_CHICAGO | "America/Chicago" | +| CHIHUAHUA | "Chihuahua" | +| AMERICA_CHIHUAHUA | "America/Chihuahua" | +| GUADALAJARA | "Guadalajara" | +| AMERICA_MEXICO_CITY | "America/Mexico_City" | +| MEXICO_CITY | "Mexico City" | +| AMERICA_MEXICO_CITY2 | "America/Mexico_City" | +| MONTERREY | "Monterrey" | +| AMERICA_MONTERREY | "America/Monterrey" | +| SASKATCHEWAN | "Saskatchewan" | +| AMERICA_REGINA | "America/Regina" | +| BOGOTA | "Bogota" | +| AMERICA_BOGOTA | "America/Bogota" | +| EASTERN_TIME_US_CANADA_ | "Eastern Time (US & Canada)" | +| AMERICA_NEW_YORK | "America/New_York" | +| INDIANA_EAST_ | "Indiana (East)" | +| AMERICA_INDIANA_INDIANAPOLIS | "America/Indiana/Indianapolis" | +| LIMA | "Lima" | +| AMERICA_LIMA | "America/Lima" | +| QUITO | "Quito" | +| AMERICA_LIMA2 | "America/Lima" | +| ATLANTIC_TIME_CANADA_ | "Atlantic Time (Canada)" | +| AMERICA_HALIFAX | "America/Halifax" | +| CARACAS | "Caracas" | +| AMERICA_CARACAS | "America/Caracas" | +| GEORGETOWN | "Georgetown" | +| AMERICA_GUYANA | "America/Guyana" | +| LA_PAZ | "La Paz" | +| AMERICA_LA_PAZ | "America/La_Paz" | +| PUERTO_RICO | "Puerto Rico" | +| AMERICA_PUERTO_RICO | "America/Puerto_Rico" | +| SANTIAGO | "Santiago" | +| AMERICA_SANTIAGO | "America/Santiago" | +| NEWFOUNDLAND | "Newfoundland" | +| AMERICA_ST_JOHNS | "America/St_Johns" | +| ASUNCION | "Asuncion" | +| AMERICA_ASUNCION | "America/Asuncion" | +| BRASILIA | "Brasilia" | +| AMERICA_SAO_PAULO | "America/Sao_Paulo" | +| BUENOS_AIRES | "Buenos Aires" | +| AMERICA_ARGENTINA_BUENOS_AIRES | "America/Argentina/Buenos_Aires" | +| MONTEVIDEO | "Montevideo" | +| AMERICA_MONTEVIDEO | "America/Montevideo" | +| GREENLAND | "Greenland" | +| AMERICA_NUUK | "America/Nuuk" | +| MID_ATLANTIC | "Mid-Atlantic" | +| ATLANTIC_SOUTH_GEORGIA | "Atlantic/South_Georgia" | +| AZORES | "Azores" | +| ATLANTIC_AZORES | "Atlantic/Azores" | +| CAPE_VERDE_IS_ | "Cape Verde Is." | +| ATLANTIC_CAPE_VERDE | "Atlantic/Cape_Verde" | +| EDINBURGH | "Edinburgh" | +| EUROPE_LONDON | "Europe/London" | +| LISBON | "Lisbon" | +| EUROPE_LISBON | "Europe/Lisbon" | +| LONDON | "London" | +| EUROPE_LONDON2 | "Europe/London" | +| MONROVIA | "Monrovia" | +| AFRICA_MONROVIA | "Africa/Monrovia" | +| UTC | "UTC" | +| ETC_UTC | "Etc/UTC" | +| AMSTERDAM | "Amsterdam" | +| EUROPE_AMSTERDAM | "Europe/Amsterdam" | +| BELGRADE | "Belgrade" | +| EUROPE_BELGRADE | "Europe/Belgrade" | +| BERLIN | "Berlin" | +| EUROPE_BERLIN | "Europe/Berlin" | +| BERN | "Bern" | +| EUROPE_ZURICH | "Europe/Zurich" | +| BRATISLAVA | "Bratislava" | +| EUROPE_BRATISLAVA | "Europe/Bratislava" | +| BRUSSELS | "Brussels" | +| EUROPE_BRUSSELS | "Europe/Brussels" | +| BUDAPEST | "Budapest" | +| EUROPE_BUDAPEST | "Europe/Budapest" | +| CASABLANCA | "Casablanca" | +| AFRICA_CASABLANCA | "Africa/Casablanca" | +| COPENHAGEN | "Copenhagen" | +| EUROPE_COPENHAGEN | "Europe/Copenhagen" | +| DUBLIN | "Dublin" | +| EUROPE_DUBLIN | "Europe/Dublin" | +| LJUBLJANA | "Ljubljana" | +| EUROPE_LJUBLJANA | "Europe/Ljubljana" | +| MADRID | "Madrid" | +| EUROPE_MADRID | "Europe/Madrid" | +| PARIS | "Paris" | +| EUROPE_PARIS | "Europe/Paris" | +| PRAGUE | "Prague" | +| EUROPE_PRAGUE | "Europe/Prague" | +| ROME | "Rome" | +| EUROPE_ROME | "Europe/Rome" | +| SARAJEVO | "Sarajevo" | +| EUROPE_SARAJEVO | "Europe/Sarajevo" | +| SKOPJE | "Skopje" | +| EUROPE_SKOPJE | "Europe/Skopje" | +| STOCKHOLM | "Stockholm" | +| EUROPE_STOCKHOLM | "Europe/Stockholm" | +| VIENNA | "Vienna" | +| EUROPE_VIENNA | "Europe/Vienna" | +| WARSAW | "Warsaw" | +| EUROPE_WARSAW | "Europe/Warsaw" | +| WEST_CENTRAL_AFRICA | "West Central Africa" | +| AFRICA_ALGIERS | "Africa/Algiers" | +| ZAGREB | "Zagreb" | +| EUROPE_ZAGREB | "Europe/Zagreb" | +| ZURICH | "Zurich" | +| EUROPE_ZURICH2 | "Europe/Zurich" | +| ATHENS | "Athens" | +| EUROPE_ATHENS | "Europe/Athens" | +| BUCHAREST | "Bucharest" | +| EUROPE_BUCHAREST | "Europe/Bucharest" | +| CAIRO | "Cairo" | +| AFRICA_CAIRO | "Africa/Cairo" | +| HARARE | "Harare" | +| AFRICA_HARARE | "Africa/Harare" | +| HELSINKI | "Helsinki" | +| EUROPE_HELSINKI | "Europe/Helsinki" | +| JERUSALEM | "Jerusalem" | +| ASIA_JERUSALEM | "Asia/Jerusalem" | +| KALININGRAD | "Kaliningrad" | +| EUROPE_KALININGRAD | "Europe/Kaliningrad" | +| KYIV | "Kyiv" | +| EUROPE_KIEV | "Europe/Kiev" | +| PRETORIA | "Pretoria" | +| AFRICA_JOHANNESBURG | "Africa/Johannesburg" | +| RIGA | "Riga" | +| EUROPE_RIGA | "Europe/Riga" | +| SOFIA | "Sofia" | +| EUROPE_SOFIA | "Europe/Sofia" | +| TALLINN | "Tallinn" | +| EUROPE_TALLINN | "Europe/Tallinn" | +| VILNIUS | "Vilnius" | +| EUROPE_VILNIUS | "Europe/Vilnius" | +| BAGHDAD | "Baghdad" | +| ASIA_BAGHDAD | "Asia/Baghdad" | +| ISTANBUL | "Istanbul" | +| EUROPE_ISTANBUL | "Europe/Istanbul" | +| KUWAIT | "Kuwait" | +| ASIA_KUWAIT | "Asia/Kuwait" | +| MINSK | "Minsk" | +| EUROPE_MINSK | "Europe/Minsk" | +| MOSCOW | "Moscow" | +| EUROPE_MOSCOW | "Europe/Moscow" | +| NAIROBI | "Nairobi" | +| AFRICA_NAIROBI | "Africa/Nairobi" | +| RIYADH | "Riyadh" | +| ASIA_RIYADH | "Asia/Riyadh" | +| ST_PETERSBURG | "St. Petersburg" | +| EUROPE_MOSCOW2 | "Europe/Moscow" | +| VOLGOGRAD | "Volgograd" | +| EUROPE_VOLGOGRAD | "Europe/Volgograd" | +| TEHRAN | "Tehran" | +| ASIA_TEHRAN | "Asia/Tehran" | +| ABU_DHABI | "Abu Dhabi" | +| ASIA_MUSCAT | "Asia/Muscat" | +| BAKU | "Baku" | +| ASIA_BAKU | "Asia/Baku" | +| MUSCAT | "Muscat" | +| ASIA_MUSCAT2 | "Asia/Muscat" | +| SAMARA | "Samara" | +| EUROPE_SAMARA | "Europe/Samara" | +| TBILISI | "Tbilisi" | +| ASIA_TBILISI | "Asia/Tbilisi" | +| YEREVAN | "Yerevan" | +| ASIA_YEREVAN | "Asia/Yerevan" | +| KABUL | "Kabul" | +| ASIA_KABUL | "Asia/Kabul" | +| ALMATY | "Almaty" | +| ASIA_ALMATY | "Asia/Almaty" | +| ASTANA | "Astana" | +| ASIA_ALMATY2 | "Asia/Almaty" | +| EKATERINBURG | "Ekaterinburg" | +| ASIA_YEKATERINBURG | "Asia/Yekaterinburg" | +| ISLAMABAD | "Islamabad" | +| ASIA_KARACHI | "Asia/Karachi" | +| KARACHI | "Karachi" | +| ASIA_KARACHI2 | "Asia/Karachi" | +| TASHKENT | "Tashkent" | +| ASIA_TASHKENT | "Asia/Tashkent" | +| CHENNAI | "Chennai" | +| ASIA_KOLKATA | "Asia/Kolkata" | +| KOLKATA | "Kolkata" | +| ASIA_KOLKATA2 | "Asia/Kolkata" | +| MUMBAI | "Mumbai" | +| ASIA_KOLKATA3 | "Asia/Kolkata" | +| NEW_DELHI | "New Delhi" | +| ASIA_KOLKATA4 | "Asia/Kolkata" | +| SRI_JAYAWARDENEPURA | "Sri Jayawardenepura" | +| ASIA_COLOMBO | "Asia/Colombo" | +| KATHMANDU | "Kathmandu" | +| ASIA_KATHMANDU | "Asia/Kathmandu" | +| DHAKA | "Dhaka" | +| ASIA_DHAKA | "Asia/Dhaka" | +| URUMQI | "Urumqi" | +| ASIA_URUMQI | "Asia/Urumqi" | +| RANGOON | "Rangoon" | +| ASIA_RANGOON | "Asia/Rangoon" | +| BANGKOK | "Bangkok" | +| ASIA_BANGKOK | "Asia/Bangkok" | +| HANOI | "Hanoi" | +| ASIA_BANGKOK2 | "Asia/Bangkok" | +| JAKARTA | "Jakarta" | +| ASIA_JAKARTA | "Asia/Jakarta" | +| KRASNOYARSK | "Krasnoyarsk" | +| ASIA_KRASNOYARSK | "Asia/Krasnoyarsk" | +| NOVOSIBIRSK | "Novosibirsk" | +| ASIA_NOVOSIBIRSK | "Asia/Novosibirsk" | +| BEIJING | "Beijing" | +| ASIA_SHANGHAI | "Asia/Shanghai" | +| CHONGQING | "Chongqing" | +| ASIA_CHONGQING | "Asia/Chongqing" | +| HONG_KONG | "Hong Kong" | +| ASIA_HONG_KONG | "Asia/Hong_Kong" | +| IRKUTSK | "Irkutsk" | +| ASIA_IRKUTSK | "Asia/Irkutsk" | +| KUALA_LUMPUR | "Kuala Lumpur" | +| ASIA_KUALA_LUMPUR | "Asia/Kuala_Lumpur" | +| PERTH | "Perth" | +| AUSTRALIA_PERTH | "Australia/Perth" | +| SINGAPORE | "Singapore" | +| ASIA_SINGAPORE | "Asia/Singapore" | +| TAIPEI | "Taipei" | +| ASIA_TAIPEI | "Asia/Taipei" | +| ULAANBAATAR | "Ulaanbaatar" | +| ASIA_ULAANBAATAR | "Asia/Ulaanbaatar" | +| OSAKA | "Osaka" | +| ASIA_TOKYO | "Asia/Tokyo" | +| SAPPORO | "Sapporo" | +| ASIA_TOKYO2 | "Asia/Tokyo" | +| SEOUL | "Seoul" | +| ASIA_SEOUL | "Asia/Seoul" | +| TOKYO | "Tokyo" | +| ASIA_TOKYO3 | "Asia/Tokyo" | +| YAKUTSK | "Yakutsk" | +| ASIA_YAKUTSK | "Asia/Yakutsk" | +| ADELAIDE | "Adelaide" | +| AUSTRALIA_ADELAIDE | "Australia/Adelaide" | +| DARWIN | "Darwin" | +| AUSTRALIA_DARWIN | "Australia/Darwin" | +| BRISBANE | "Brisbane" | +| AUSTRALIA_BRISBANE | "Australia/Brisbane" | +| CANBERRA | "Canberra" | +| AUSTRALIA_CANBERRA | "Australia/Canberra" | +| GUAM | "Guam" | +| PACIFIC_GUAM | "Pacific/Guam" | +| HOBART | "Hobart" | +| AUSTRALIA_HOBART | "Australia/Hobart" | +| MELBOURNE | "Melbourne" | +| AUSTRALIA_MELBOURNE | "Australia/Melbourne" | +| PORT_MORESBY | "Port Moresby" | +| PACIFIC_PORT_MORESBY | "Pacific/Port_Moresby" | +| SYDNEY | "Sydney" | +| AUSTRALIA_SYDNEY | "Australia/Sydney" | +| VLADIVOSTOK | "Vladivostok" | +| ASIA_VLADIVOSTOK | "Asia/Vladivostok" | +| MAGADAN | "Magadan" | +| ASIA_MAGADAN | "Asia/Magadan" | +| NEW_CALEDONIA | "New Caledonia" | +| PACIFIC_NOUMEA | "Pacific/Noumea" | +| SOLOMON_IS_ | "Solomon Is." | +| PACIFIC_GUADALCANAL | "Pacific/Guadalcanal" | +| SREDNEKOLYMSK | "Srednekolymsk" | +| ASIA_SREDNEKOLYMSK | "Asia/Srednekolymsk" | +| AUCKLAND | "Auckland" | +| PACIFIC_AUCKLAND | "Pacific/Auckland" | +| FIJI | "Fiji" | +| PACIFIC_FIJI | "Pacific/Fiji" | +| KAMCHATKA | "Kamchatka" | +| ASIA_KAMCHATKA | "Asia/Kamchatka" | +| MARSHALL_IS_ | "Marshall Is." | +| PACIFIC_MAJURO | "Pacific/Majuro" | +| WELLINGTON | "Wellington" | +| PACIFIC_AUCKLAND2 | "Pacific/Auckland" | +| CHATHAM_IS_ | "Chatham Is." | +| PACIFIC_CHATHAM | "Pacific/Chatham" | +| NUKU_ALOFA | "Nuku'alofa" | +| PACIFIC_TONGATAPU | "Pacific/Tongatapu" | +| SAMOA | "Samoa" | +| PACIFIC_APIA | "Pacific/Apia" | +| TOKELAU_IS_ | "Tokelau Is." | +| PACIFIC_FAKAOFO | "Pacific/Fakaofo" | + + + diff --git a/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.md b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.md new file mode 100644 index 00000000..46cdbe5a --- /dev/null +++ b/docs/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.md @@ -0,0 +1,23 @@ + + +# NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**monday** | **Boolean** | | [optional] | +|**tuesday** | **Boolean** | | [optional] | +|**wednesday** | **Boolean** | | [optional] | +|**thursday** | **Boolean** | | [optional] | +|**friday** | **Boolean** | | [optional] | +|**saturday** | **Boolean** | | [optional] | +|**sunday** | **Boolean** | | [optional] | +|**startTime** | **String** | Formatted as HH:MM | [optional] | +|**endTime** | **String** | Formatted as HH:MM | [optional] | +|**allDay** | **Boolean** | | [optional] | +|**position** | **Integer** | | [optional] | + + + diff --git a/docs/NewOnCallPayReport.md b/docs/NewOnCallPayReport.md new file mode 100644 index 00000000..78f6edad --- /dev/null +++ b/docs/NewOnCallPayReport.md @@ -0,0 +1,13 @@ + + +# NewOnCallPayReport + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**NewOnCallPayReportData**](NewOnCallPayReportData.md) | | | + + + diff --git a/docs/NewOnCallPayReportData.md b/docs/NewOnCallPayReportData.md new file mode 100644 index 00000000..ae396668 --- /dev/null +++ b/docs/NewOnCallPayReportData.md @@ -0,0 +1,22 @@ + + +# NewOnCallPayReportData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**NewOnCallPayReportDataAttributes**](NewOnCallPayReportDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ON_CALL_PAY_REPORTS | "on_call_pay_reports" | + + + diff --git a/docs/NewOnCallPayReportDataAttributes.md b/docs/NewOnCallPayReportDataAttributes.md new file mode 100644 index 00000000..f715af9a --- /dev/null +++ b/docs/NewOnCallPayReportDataAttributes.md @@ -0,0 +1,15 @@ + + +# NewOnCallPayReportDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**startDate** | **LocalDate** | The start date for the report period. | | +|**endDate** | **LocalDate** | The end date for the report period. | | +|**scheduleIds** | **List<String>** | List of schedule UUIDs to scope the report. | [optional] | + + + diff --git a/docs/NewSla.md b/docs/NewSla.md new file mode 100644 index 00000000..fb3a3176 --- /dev/null +++ b/docs/NewSla.md @@ -0,0 +1,13 @@ + + +# NewSla + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**NewSlaData**](NewSlaData.md) | | | + + + diff --git a/docs/NewSlaData.md b/docs/NewSlaData.md new file mode 100644 index 00000000..efb8e5df --- /dev/null +++ b/docs/NewSlaData.md @@ -0,0 +1,22 @@ + + +# NewSlaData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**NewSlaDataAttributes**](NewSlaDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| SLAS | "slas" | + + + diff --git a/docs/NewSlaDataAttributes.md b/docs/NewSlaDataAttributes.md new file mode 100644 index 00000000..512cd906 --- /dev/null +++ b/docs/NewSlaDataAttributes.md @@ -0,0 +1,97 @@ + + +# NewSlaDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the SLA | | +|**description** | **String** | A description of the SLA | [optional] | +|**position** | **Integer** | Position of the SLA for ordering | [optional] | +|**conditionMatchType** | [**ConditionMatchTypeEnum**](#ConditionMatchTypeEnum) | Whether all or any conditions must match | [optional] | +|**managerRoleId** | **UUID** | The ID of the incident role responsible for this SLA. Must provide either manager_role_id or manager_user_id. | [optional] | +|**managerUserId** | **Integer** | The ID of the user responsible for this SLA. Must provide either manager_role_id or manager_user_id. | [optional] | +|**assignmentDeadlineDays** | [**AssignmentDeadlineDaysEnum**](#AssignmentDeadlineDaysEnum) | Number of days for the assignment deadline | | +|**assignmentDeadlineParentStatus** | [**AssignmentDeadlineParentStatusEnum**](#AssignmentDeadlineParentStatusEnum) | The incident parent status that triggers the assignment deadline | | +|**assignmentDeadlineSubStatusId** | **UUID** | Sub-status for the assignment deadline. Required when custom lifecycle statuses are enabled on the team. | [optional] | +|**assignmentSkipWeekends** | **Boolean** | Whether to skip weekends when calculating the assignment deadline | [optional] | +|**completionDeadlineDays** | [**CompletionDeadlineDaysEnum**](#CompletionDeadlineDaysEnum) | Number of days for the completion deadline | | +|**completionDeadlineParentStatus** | [**CompletionDeadlineParentStatusEnum**](#CompletionDeadlineParentStatusEnum) | The incident parent status that triggers the completion deadline | | +|**completionDeadlineSubStatusId** | **UUID** | Sub-status for the completion deadline. Required when custom lifecycle statuses are enabled on the team. | [optional] | +|**completionSkipWeekends** | **Boolean** | Whether to skip weekends when calculating the completion deadline | [optional] | +|**conditions** | [**List<NewSlaDataAttributesConditionsInner>**](NewSlaDataAttributesConditionsInner.md) | Conditions that determine which incidents this SLA applies to. Maximum 20. | [optional] | +|**notificationConfigurations** | [**List<NewSlaDataAttributesNotificationConfigurationsInner>**](NewSlaDataAttributesNotificationConfigurationsInner.md) | Notification timing configurations. Maximum 20. | [optional] | + + + +## Enum: ConditionMatchTypeEnum + +| Name | Value | +|---- | -----| +| ALL | "ALL" | +| ANY | "ANY" | + + + +## Enum: AssignmentDeadlineDaysEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_2 | 2 | +| NUMBER_3 | 3 | +| NUMBER_4 | 4 | +| NUMBER_5 | 5 | +| NUMBER_6 | 6 | +| NUMBER_7 | 7 | +| NUMBER_14 | 14 | +| NUMBER_21 | 21 | +| NUMBER_30 | 30 | + + + +## Enum: AssignmentDeadlineParentStatusEnum + +| Name | Value | +|---- | -----| +| IN_TRIAGE | "in_triage" | +| STARTED | "started" | +| MITIGATED | "mitigated" | +| RESOLVED | "resolved" | +| CLOSED | "closed" | +| CANCELLED | "cancelled" | + + + +## Enum: CompletionDeadlineDaysEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_2 | 2 | +| NUMBER_3 | 3 | +| NUMBER_4 | 4 | +| NUMBER_5 | 5 | +| NUMBER_6 | 6 | +| NUMBER_7 | 7 | +| NUMBER_14 | 14 | +| NUMBER_21 | 21 | +| NUMBER_30 | 30 | + + + +## Enum: CompletionDeadlineParentStatusEnum + +| Name | Value | +|---- | -----| +| IN_TRIAGE | "in_triage" | +| STARTED | "started" | +| MITIGATED | "mitigated" | +| RESOLVED | "resolved" | +| CLOSED | "closed" | +| CANCELLED | "cancelled" | + + + diff --git a/docs/NewSlaDataAttributesConditionsInner.md b/docs/NewSlaDataAttributesConditionsInner.md new file mode 100644 index 00000000..b9666870 --- /dev/null +++ b/docs/NewSlaDataAttributesConditionsInner.md @@ -0,0 +1,52 @@ + + +# NewSlaDataAttributesConditionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**conditionableType** | [**ConditionableTypeEnum**](#ConditionableTypeEnum) | The type of condition | | +|**property** | [**PropertyEnum**](#PropertyEnum) | The property to evaluate (for built-in field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. | [optional] | +|**operator** | **String** | The comparison operator | | +|**values** | **List<String>** | The values to compare against | [optional] | +|**formFieldId** | **UUID** | The ID of the form field (for custom field conditions) | [optional] | +|**position** | **Integer** | The position of the condition for ordering | [optional] | + + + +## Enum: ConditionableTypeEnum + +| Name | Value | +|---- | -----| +| SLAS_BUILT_IN_FIELD_CONDITION | "SLAs::BuiltInFieldCondition" | +| SLAS_CUSTOM_FIELD_CONDITION | "SLAs::CustomFieldCondition" | + + + +## Enum: PropertyEnum + +| Name | Value | +|---- | -----| +| SEVERITY | "severity" | +| ENVIRONMENT | "environment" | +| SERVICE | "service" | +| FUNCTIONALITY | "functionality" | +| INCIDENT_TYPE | "incident_type" | +| GROUP | "group" | +| CAUSE | "cause" | +| SUB_STATUS | "sub_status" | +| INCIDENT_ROLE | "incident_role" | +| STATUS | "status" | +| KIND | "kind" | +| VISIBILITY | "visibility" | +| SUMMARY | "summary" | +| STARTED_AT | "started_at" | +| DETECTED_AT | "detected_at" | +| ACKNOWLEDGED_AT | "acknowledged_at" | +| MITIGATED_AT | "mitigated_at" | +| RESOLVED_AT | "resolved_at" | + + + diff --git a/docs/NewSlaDataAttributesNotificationConfigurationsInner.md b/docs/NewSlaDataAttributesNotificationConfigurationsInner.md new file mode 100644 index 00000000..6c86657a --- /dev/null +++ b/docs/NewSlaDataAttributesNotificationConfigurationsInner.md @@ -0,0 +1,24 @@ + + +# NewSlaDataAttributesNotificationConfigurationsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**offsetType** | [**OffsetTypeEnum**](#OffsetTypeEnum) | When to send the notification relative to the deadline | | +|**offsetDays** | **Integer** | Number of days before or after the deadline. Must be 0 for when_due. | | + + + +## Enum: OffsetTypeEnum + +| Name | Value | +|---- | -----| +| BEFORE_DUE | "before_due" | +| WHEN_DUE | "when_due" | +| AFTER_DUE | "after_due" | + + + diff --git a/docs/OnCallPayReport.md b/docs/OnCallPayReport.md new file mode 100644 index 00000000..47cdd7e6 --- /dev/null +++ b/docs/OnCallPayReport.md @@ -0,0 +1,51 @@ + + +# OnCallPayReport + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**status** | [**StatusEnum**](#StatusEnum) | The current status of the report. | | +|**startDate** | **LocalDate** | The start date of the report period. | | +|**endDate** | **LocalDate** | The end date of the report period. | | +|**totalDuration** | **Integer** | Total on-call duration in seconds. | [optional] | +|**usersCount** | **Integer** | Number of users included in the report. | [optional] | +|**currency** | **String** | The currency code for monetary values. | [optional] | +|**payType** | [**PayTypeEnum**](#PayTypeEnum) | The pay calculation type. | [optional] | +|**hourlyRateCents** | **Integer** | Hourly pay rate in cents. | [optional] | +|**dailyRateCents** | **Integer** | Daily pay rate in cents. | [optional] | +|**totalPayCents** | **Integer** | Total pay amount in cents. | [optional] | +|**includeShadow** | **Boolean** | Whether shadow shifts are included. | [optional] | +|**showIndividualShiftData** | **Boolean** | Whether individual shift data is shown. | [optional] | +|**hasSingleRate** | **Boolean** | Whether a single rate is applied to all users. | [optional] | +|**enabledGranularTimeBreakdown** | **Boolean** | Whether granular time breakdown is enabled. | [optional] | +|**lastGeneratedAt** | **OffsetDateTime** | When the report was last generated. | [optional] | +|**timeZone** | **String** | The team's IANA timezone used to interpret start_date and end_date. | [optional] | +|**csvFileUrl** | **URI** | Download URL for the generated CSV report. Null until the report is generated. | [optional] | +|**xlsxFileUrl** | **URI** | Download URL for the generated XLSX report. Null until the report is generated. | [optional] | +|**createdAt** | **OffsetDateTime** | | | +|**updatedAt** | **OffsetDateTime** | | | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PROCESSING | "processing" | +| GENERATED | "generated" | +| DOWNLOADED | "downloaded" | + + + +## Enum: PayTypeEnum + +| Name | Value | +|---- | -----| +| HOURLY | "hourly" | +| DAILY | "daily" | + + + diff --git a/docs/OnCallPayReportList.md b/docs/OnCallPayReportList.md new file mode 100644 index 00000000..b56490da --- /dev/null +++ b/docs/OnCallPayReportList.md @@ -0,0 +1,15 @@ + + +# OnCallPayReportList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<OnCallPayReportResponseData>**](OnCallPayReportResponseData.md) | | | +|**links** | [**Links**](Links.md) | | | +|**meta** | [**Meta**](Meta.md) | | | + + + diff --git a/docs/OnCallPayReportResponse.md b/docs/OnCallPayReportResponse.md new file mode 100644 index 00000000..7f4f2fc3 --- /dev/null +++ b/docs/OnCallPayReportResponse.md @@ -0,0 +1,13 @@ + + +# OnCallPayReportResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**OnCallPayReportResponseData**](OnCallPayReportResponseData.md) | | | + + + diff --git a/docs/OnCallPayReportResponseData.md b/docs/OnCallPayReportResponseData.md new file mode 100644 index 00000000..d752a880 --- /dev/null +++ b/docs/OnCallPayReportResponseData.md @@ -0,0 +1,23 @@ + + +# OnCallPayReportResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the on_call_pay_report | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**OnCallPayReport**](OnCallPayReport.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ON_CALL_PAY_REPORTS | "on_call_pay_reports" | + + + diff --git a/docs/OnCallPayReportsApi.md b/docs/OnCallPayReportsApi.md new file mode 100644 index 00000000..c54d9036 --- /dev/null +++ b/docs/OnCallPayReportsApi.md @@ -0,0 +1,372 @@ +# OnCallPayReportsApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createOnCallPayReport**](OnCallPayReportsApi.md#createOnCallPayReport) | **POST** /v1/on_call_pay_reports | Creates an On-Call Pay Report | +| [**getOnCallPayReport**](OnCallPayReportsApi.md#getOnCallPayReport) | **GET** /v1/on_call_pay_reports/{id} | Retrieves an On-Call Pay Report | +| [**listOnCallPayReports**](OnCallPayReportsApi.md#listOnCallPayReports) | **GET** /v1/on_call_pay_reports | List On-Call Pay Reports | +| [**regenerateOnCallPayReport**](OnCallPayReportsApi.md#regenerateOnCallPayReport) | **POST** /v1/on_call_pay_reports/{id}/regenerate | Regenerate an On-Call Pay Report | +| [**updateOnCallPayReport**](OnCallPayReportsApi.md#updateOnCallPayReport) | **PUT** /v1/on_call_pay_reports/{id} | Update an On-Call Pay Report | + + + +# **createOnCallPayReport** +> OnCallPayReportResponse createOnCallPayReport(newOnCallPayReport) + +Creates an On-Call Pay Report + +Generates a new on-call pay report for the given date range. The report is generated asynchronously. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.OnCallPayReportsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + OnCallPayReportsApi apiInstance = new OnCallPayReportsApi(defaultClient); + NewOnCallPayReport newOnCallPayReport = new NewOnCallPayReport(); // NewOnCallPayReport | + try { + OnCallPayReportResponse result = apiInstance.createOnCallPayReport(newOnCallPayReport); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallPayReportsApi#createOnCallPayReport"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newOnCallPayReport** | [**NewOnCallPayReport**](NewOnCallPayReport.md)| | | + +### Return type + +[**OnCallPayReportResponse**](OnCallPayReportResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | on_call_pay_report created | - | +| **422** | invalid request | - | +| **401** | responds with unauthorized for invalid token | - | + + +# **getOnCallPayReport** +> OnCallPayReportResponse getOnCallPayReport(id, include) + +Retrieves an On-Call Pay Report + +Retrieves a specific on-call pay report by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.OnCallPayReportsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + OnCallPayReportsApi apiInstance = new OnCallPayReportsApi(defaultClient); + String id = "id_example"; // String | + String include = "include_example"; // String | + try { + OnCallPayReportResponse result = apiInstance.getOnCallPayReport(id, include); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallPayReportsApi#getOnCallPayReport"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | +| **include** | **String**| | [optional] | + +### Return type + +[**OnCallPayReportResponse**](OnCallPayReportResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | on_call_pay_report found | - | +| **404** | resource not found for different team | - | + + +# **listOnCallPayReports** +> OnCallPayReportList listOnCallPayReports(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte) + +List On-Call Pay Reports + +List on-call pay reports + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.OnCallPayReportsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + OnCallPayReportsApi apiInstance = new OnCallPayReportsApi(defaultClient); + String include = "include_example"; // String | + Integer pageNumber = 56; // Integer | + Integer pageSize = 56; // Integer | + String filterStatus = "filterStatus_example"; // String | + String filterCreatedAtGt = "filterCreatedAtGt_example"; // String | + String filterCreatedAtGte = "filterCreatedAtGte_example"; // String | + String filterCreatedAtLt = "filterCreatedAtLt_example"; // String | + String filterCreatedAtLte = "filterCreatedAtLte_example"; // String | + try { + OnCallPayReportList result = apiInstance.listOnCallPayReports(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallPayReportsApi#listOnCallPayReports"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **include** | **String**| | [optional] | +| **pageNumber** | **Integer**| | [optional] | +| **pageSize** | **Integer**| | [optional] | +| **filterStatus** | **String**| | [optional] | +| **filterCreatedAtGt** | **String**| | [optional] | +| **filterCreatedAtGte** | **String**| | [optional] | +| **filterCreatedAtLt** | **String**| | [optional] | +| **filterCreatedAtLte** | **String**| | [optional] | + +### Return type + +[**OnCallPayReportList**](OnCallPayReportList.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | success | - | + + +# **regenerateOnCallPayReport** +> OnCallPayReportResponse regenerateOnCallPayReport(id) + +Regenerate an On-Call Pay Report + +Triggers regeneration of an existing on-call pay report. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.OnCallPayReportsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + OnCallPayReportsApi apiInstance = new OnCallPayReportsApi(defaultClient); + String id = "id_example"; // String | + try { + OnCallPayReportResponse result = apiInstance.regenerateOnCallPayReport(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallPayReportsApi#regenerateOnCallPayReport"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +[**OnCallPayReportResponse**](OnCallPayReportResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | on_call_pay_report regeneration triggered | - | +| **404** | on_call_pay_report not found | - | + + +# **updateOnCallPayReport** +> OnCallPayReportResponse updateOnCallPayReport(id, updateOnCallPayReport) + +Update an On-Call Pay Report + +Update a specific on-call pay report by id. Triggers report regeneration. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.OnCallPayReportsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + OnCallPayReportsApi apiInstance = new OnCallPayReportsApi(defaultClient); + String id = "id_example"; // String | + UpdateOnCallPayReport updateOnCallPayReport = new UpdateOnCallPayReport(); // UpdateOnCallPayReport | + try { + OnCallPayReportResponse result = apiInstance.updateOnCallPayReport(id, updateOnCallPayReport); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallPayReportsApi#updateOnCallPayReport"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | +| **updateOnCallPayReport** | [**UpdateOnCallPayReport**](UpdateOnCallPayReport.md)| | | + +### Return type + +[**OnCallPayReportResponse**](OnCallPayReportResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | on_call_pay_report updated | - | +| **404** | not allowed when flipper disabled | - | +| **422** | invalid request | - | + diff --git a/docs/OnCallsApi.md b/docs/OnCallsApi.md new file mode 100644 index 00000000..1d4b13ca --- /dev/null +++ b/docs/OnCallsApi.md @@ -0,0 +1,97 @@ +# OnCallsApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**listOncalls**](OnCallsApi.md#listOncalls) | **GET** /v1/oncalls | List on-calls | + + + +# **listOncalls** +> listOncalls(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes) + +List on-calls + +List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.OnCallsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + OnCallsApi apiInstance = new OnCallsApi(defaultClient); + String include = "user"; // String | comma separated if needed. eg: user,schedule + String since = "since_example"; // String | Start of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to current time. + String until = "until_example"; // String | End of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to 'since' time. + Boolean earliest = true; // Boolean | When true, returns only the first on-call user per escalation policy level + String timeZone = "timeZone_example"; // String | Timezone for response times (e.g., America/New_York). Defaults to UTC. + String filterEscalationPolicyIds = "filterEscalationPolicyIds_example"; // String | Comma-separated escalation policy IDs + String filterScheduleIds = "filterScheduleIds_example"; // String | Comma-separated schedule IDs + String filterUserIds = "filterUserIds_example"; // String | Comma-separated user IDs + String filterServiceIds = "filterServiceIds_example"; // String | Comma-separated service IDs + String filterGroupIds = "filterGroupIds_example"; // String | Comma-separated group IDs (teams) + String filterNotificationTypes = "filterNotificationTypes_example"; // String | Comma-separated notification types to include. One or both of: audible, quiet. When present, oncalls are returned from every non-deferral escalation path whose notification_type is in the filter, sorted audible-first. When absent, only the default path's oncalls are returned (existing behavior). + try { + apiInstance.listOncalls(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallsApi#listOncalls"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **include** | **String**| comma separated if needed. eg: user,schedule | [optional] [enum: user, schedule, escalation_policy] | +| **since** | **String**| Start of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to current time. | [optional] | +| **until** | **String**| End of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to 'since' time. | [optional] | +| **earliest** | **Boolean**| When true, returns only the first on-call user per escalation policy level | [optional] | +| **timeZone** | **String**| Timezone for response times (e.g., America/New_York). Defaults to UTC. | [optional] | +| **filterEscalationPolicyIds** | **String**| Comma-separated escalation policy IDs | [optional] | +| **filterScheduleIds** | **String**| Comma-separated schedule IDs | [optional] | +| **filterUserIds** | **String**| Comma-separated user IDs | [optional] | +| **filterServiceIds** | **String**| Comma-separated service IDs | [optional] | +| **filterGroupIds** | **String**| Comma-separated group IDs (teams) | [optional] | +| **filterNotificationTypes** | **String**| Comma-separated notification types to include. One or both of: audible, quiet. When present, oncalls are returned from every non-deferral escalation path whose notification_type is in the filter, sorted audible-first. When absent, only the default path's oncalls are returned (existing behavior). | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | success | - | +| **404** | resource not found when alerting is disabled | - | +| **401** | responds with unauthorized for invalid token | - | + diff --git a/docs/PageJsmopsOnCallRespondersTaskParams.md b/docs/PageJsmopsOnCallRespondersTaskParams.md new file mode 100644 index 00000000..f8bcbb27 --- /dev/null +++ b/docs/PageJsmopsOnCallRespondersTaskParams.md @@ -0,0 +1,41 @@ + + +# PageJsmopsOnCallRespondersTaskParams + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskType** | [**TaskTypeEnum**](#TaskTypeEnum) | | [optional] | +|**title** | **String** | Incident title. | [optional] | +|**message** | **String** | Message of the incident | [optional] | +|**description** | **String** | Description field of the incident that is generally used to provide a detailed information about the incident | [optional] | +|**teams** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | [optional] | +|**users** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | [optional] | +|**priority** | [**PriorityEnum**](#PriorityEnum) | | [optional] | + + + +## Enum: TaskTypeEnum + +| Name | Value | +|---- | -----| +| PAGE_JSMOPS_ON_CALL_RESPONDERS | "page_jsmops_on_call_responders" | + + + +## Enum: PriorityEnum + +| Name | Value | +|---- | -----| +| P3 | "P3" | +| P1 | "P1" | +| P2 | "P2" | +| P32 | "P3" | +| P4 | "P4" | +| P5 | "P5" | +| AUTO | "auto" | + + + diff --git a/docs/PatchAlertRoute.md b/docs/PatchAlertRoute.md new file mode 100644 index 00000000..7ba4db4e --- /dev/null +++ b/docs/PatchAlertRoute.md @@ -0,0 +1,13 @@ + + +# PatchAlertRoute + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**PatchAlertRouteData**](PatchAlertRouteData.md) | | | + + + diff --git a/docs/PatchAlertRouteData.md b/docs/PatchAlertRouteData.md new file mode 100644 index 00000000..288acd8c --- /dev/null +++ b/docs/PatchAlertRouteData.md @@ -0,0 +1,22 @@ + + +# PatchAlertRouteData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**PatchAlertRouteDataAttributes**](PatchAlertRouteDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ALERT_ROUTES | "alert_routes" | + + + diff --git a/docs/PatchAlertRouteDataAttributes.md b/docs/PatchAlertRouteDataAttributes.md new file mode 100644 index 00000000..6970d842 --- /dev/null +++ b/docs/PatchAlertRouteDataAttributes.md @@ -0,0 +1,17 @@ + + +# PatchAlertRouteDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the alert route | [optional] | +|**enabled** | **Boolean** | Whether the alert route is enabled | [optional] | +|**alertsSourceIds** | **List<UUID>** | | [optional] | +|**owningTeamIds** | **List<UUID>** | | [optional] | +|**rules** | [**List<PatchAlertRouteDataAttributesRulesInner>**](PatchAlertRouteDataAttributesRulesInner.md) | | [optional] | + + + diff --git a/docs/PatchAlertRouteDataAttributesRulesInner.md b/docs/PatchAlertRouteDataAttributesRulesInner.md new file mode 100644 index 00000000..5a3b4b90 --- /dev/null +++ b/docs/PatchAlertRouteDataAttributesRulesInner.md @@ -0,0 +1,19 @@ + + +# PatchAlertRouteDataAttributesRulesInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | The ID of the alert routing rule. Required for updating or deleting existing rules. | [optional] | +|**destroy** | **Boolean** | Set to true to delete this rule. When true, only the id field is required. | [optional] | +|**name** | **String** | The name of the alert routing rule | [optional] | +|**position** | **Integer** | The position of the alert routing rule for ordering evaluation | [optional] | +|**fallbackRule** | **Boolean** | Whether this is a fallback rule | [optional] | +|**destinations** | [**List<PatchAlertRouteDataAttributesRulesInnerDestinationsInner>**](PatchAlertRouteDataAttributesRulesInnerDestinationsInner.md) | | [optional] | +|**conditionGroups** | [**List<PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner>**](PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.md) | | [optional] | + + + diff --git a/docs/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.md b/docs/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.md new file mode 100644 index 00000000..d8bef177 --- /dev/null +++ b/docs/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.md @@ -0,0 +1,16 @@ + + +# PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | The ID of the condition group. Required for updating or deleting existing condition groups. | [optional] | +|**destroy** | **Boolean** | Set to true to delete this condition group | [optional] | +|**position** | **Integer** | The position of the condition group | [optional] | +|**conditions** | [**List<PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner>**](PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.md) | | [optional] | + + + diff --git a/docs/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.md b/docs/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.md new file mode 100644 index 00000000..ba61f8c2 --- /dev/null +++ b/docs/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.md @@ -0,0 +1,55 @@ + + +# PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | The ID of the condition. Required for updating or deleting existing conditions. | [optional] | +|**destroy** | **Boolean** | Set to true to delete this condition | [optional] | +|**propertyFieldConditionType** | [**PropertyFieldConditionTypeEnum**](#PropertyFieldConditionTypeEnum) | | [optional] | +|**propertyFieldName** | **String** | The name of the property field | [optional] | +|**propertyFieldType** | [**PropertyFieldTypeEnum**](#PropertyFieldTypeEnum) | | [optional] | +|**propertyFieldValue** | **String** | The value of the property field | [optional] | +|**propertyFieldValues** | **List<String>** | | [optional] | +|**alertUrgencyIds** | **List<String>** | The Alert Urgency IDs to check in the condition | [optional] | +|**conditionableType** | [**ConditionableTypeEnum**](#ConditionableTypeEnum) | The type of the conditionable | [optional] | +|**conditionableId** | **UUID** | The ID of the conditionable | [optional] | + + + +## Enum: PropertyFieldConditionTypeEnum + +| Name | Value | +|---- | -----| +| IS_ONE_OF | "is_one_of" | +| IS_NOT_ONE_OF | "is_not_one_of" | +| CONTAINS | "contains" | +| DOES_NOT_CONTAIN | "does_not_contain" | +| STARTS_WITH | "starts_with" | +| ENDS_WITH | "ends_with" | +| MATCHES_REGEX | "matches_regex" | +| IS_EMPTY | "is_empty" | + + + +## Enum: PropertyFieldTypeEnum + +| Name | Value | +|---- | -----| +| ATTRIBUTE | "attribute" | +| PAYLOAD | "payload" | +| ALERT_FIELD | "alert_field" | + + + +## Enum: ConditionableTypeEnum + +| Name | Value | +|---- | -----| +| ALERT_FIELD | "AlertField" | + + + diff --git a/docs/PatchAlertRouteDataAttributesRulesInnerDestinationsInner.md b/docs/PatchAlertRouteDataAttributesRulesInnerDestinationsInner.md new file mode 100644 index 00000000..b325e304 --- /dev/null +++ b/docs/PatchAlertRouteDataAttributesRulesInnerDestinationsInner.md @@ -0,0 +1,27 @@ + + +# PatchAlertRouteDataAttributesRulesInnerDestinationsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | The ID of the destination. Required for updating or deleting existing destinations. | [optional] | +|**destroy** | **Boolean** | Set to true to delete this destination | [optional] | +|**targetType** | [**TargetTypeEnum**](#TargetTypeEnum) | The type of the target. Please contact support if you encounter issues using `Functionality` as a target type. | [optional] | +|**targetId** | **UUID** | The ID of the target | [optional] | + + + +## Enum: TargetTypeEnum + +| Name | Value | +|---- | -----| +| SERVICE | "Service" | +| GROUP | "Group" | +| FUNCTIONALITY | "Functionality" | +| ESCALATION_POLICY | "EscalationPolicy" | + + + diff --git a/docs/RotateApiKey.md b/docs/RotateApiKey.md new file mode 100644 index 00000000..5b547d69 --- /dev/null +++ b/docs/RotateApiKey.md @@ -0,0 +1,13 @@ + + +# RotateApiKey + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**RotateApiKeyData**](RotateApiKeyData.md) | | | + + + diff --git a/docs/RotateApiKeyData.md b/docs/RotateApiKeyData.md new file mode 100644 index 00000000..815f5808 --- /dev/null +++ b/docs/RotateApiKeyData.md @@ -0,0 +1,22 @@ + + +# RotateApiKeyData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**RotateApiKeyDataAttributes**](RotateApiKeyDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| API_KEYS | "api_keys" | + + + diff --git a/docs/RotateApiKeyDataAttributes.md b/docs/RotateApiKeyDataAttributes.md new file mode 100644 index 00000000..8f5787f2 --- /dev/null +++ b/docs/RotateApiKeyDataAttributes.md @@ -0,0 +1,14 @@ + + +# RotateApiKeyDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**expiresAt** | **OffsetDateTime** | The new expiration date after rotation (ISO 8601) | [optional] | +|**gracePeriodMinutes** | **Integer** | How many minutes to keep the old token valid. Only applies when the grace period feature is enabled for your organization. Defaults to 30. | [optional] | + + + diff --git a/docs/SendMicrosoftTeamsChatMessageTaskParams.md b/docs/SendMicrosoftTeamsChatMessageTaskParams.md new file mode 100644 index 00000000..4060fcf6 --- /dev/null +++ b/docs/SendMicrosoftTeamsChatMessageTaskParams.md @@ -0,0 +1,23 @@ + + +# SendMicrosoftTeamsChatMessageTaskParams + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**taskType** | [**TaskTypeEnum**](#TaskTypeEnum) | | [optional] | +|**chats** | [**List<AddActionItemTaskParamsPostToSlackChannelsInner>**](AddActionItemTaskParamsPostToSlackChannelsInner.md) | | | +|**text** | **String** | The message text | | + + + +## Enum: TaskTypeEnum + +| Name | Value | +|---- | -----| +| SEND_MICROSOFT_TEAMS_CHAT_MESSAGE | "send_microsoft_teams_chat_message" | + + + diff --git a/docs/Sla.md b/docs/Sla.md new file mode 100644 index 00000000..6091ea77 --- /dev/null +++ b/docs/Sla.md @@ -0,0 +1,49 @@ + + +# Sla + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**slug** | **String** | The slug of the SLA | [optional] | +|**name** | **String** | The name of the SLA | | +|**description** | **String** | A description of the SLA | [optional] | +|**position** | **Integer** | Position of the SLA for ordering | [optional] | +|**entityType** | [**EntityTypeEnum**](#EntityTypeEnum) | The entity type this SLA applies to | [optional] | +|**conditionMatchType** | [**ConditionMatchTypeEnum**](#ConditionMatchTypeEnum) | Whether all or any conditions must match | | +|**managerRoleId** | **UUID** | The ID of the manager incident role. Exactly one of `manager_role_id` or `manager_user_id` must be provided. | [optional] | +|**managerUserId** | **Integer** | The ID of the manager user. Exactly one of `manager_role_id` or `manager_user_id` must be provided. | [optional] | +|**assignmentDeadlineDays** | **Integer** | Number of days for the assignment deadline | | +|**assignmentDeadlineParentStatus** | **String** | The incident parent status that triggers the assignment deadline | | +|**assignmentDeadlineSubStatusId** | **UUID** | Sub-status for the assignment deadline. Required when custom lifecycle statuses are enabled on the team. | [optional] | +|**assignmentSkipWeekends** | **Boolean** | Whether to skip weekends when calculating the assignment deadline | [optional] | +|**completionDeadlineDays** | **Integer** | Number of days for the completion deadline | | +|**completionDeadlineParentStatus** | **String** | The incident parent status that triggers the completion deadline | | +|**completionDeadlineSubStatusId** | **UUID** | Sub-status for the completion deadline. Required when custom lifecycle statuses are enabled on the team. | [optional] | +|**completionSkipWeekends** | **Boolean** | Whether to skip weekends when calculating the completion deadline | [optional] | +|**conditions** | [**List<SlaConditionsInner>**](SlaConditionsInner.md) | Conditions that determine which incidents this SLA applies to | [optional] | +|**notificationConfigurations** | [**List<SlaNotificationConfigurationsInner>**](SlaNotificationConfigurationsInner.md) | Notification timing configurations | [optional] | +|**createdAt** | **String** | Date of creation | | +|**updatedAt** | **String** | Date of last update | | + + + +## Enum: EntityTypeEnum + +| Name | Value | +|---- | -----| +| FOLLOW_UP | "follow_up" | + + + +## Enum: ConditionMatchTypeEnum + +| Name | Value | +|---- | -----| +| ALL | "ALL" | +| ANY | "ANY" | + + + diff --git a/docs/SlaConditionsInner.md b/docs/SlaConditionsInner.md new file mode 100644 index 00000000..a5d0b5bc --- /dev/null +++ b/docs/SlaConditionsInner.md @@ -0,0 +1,28 @@ + + +# SlaConditionsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | Unique ID of the condition | [optional] | +|**position** | **Integer** | The position of the condition | [optional] | +|**conditionableType** | [**ConditionableTypeEnum**](#ConditionableTypeEnum) | The type of condition | [optional] | +|**property** | **String** | The property to evaluate (for built-in field conditions) | [optional] | +|**operator** | **String** | The comparison operator | [optional] | +|**values** | **List<String>** | The values to compare against | [optional] | +|**formFieldId** | **UUID** | The ID of the form field (for custom field conditions) | [optional] | + + + +## Enum: ConditionableTypeEnum + +| Name | Value | +|---- | -----| +| SLAS_BUILT_IN_FIELD_CONDITION | "SLAs::BuiltInFieldCondition" | +| SLAS_CUSTOM_FIELD_CONDITION | "SLAs::CustomFieldCondition" | + + + diff --git a/docs/SlaList.md b/docs/SlaList.md new file mode 100644 index 00000000..79c37c5b --- /dev/null +++ b/docs/SlaList.md @@ -0,0 +1,15 @@ + + +# SlaList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**List<SlaResponseData>**](SlaResponseData.md) | | | +|**links** | [**Links**](Links.md) | | | +|**meta** | [**Meta**](Meta.md) | | | + + + diff --git a/docs/SlaNotificationConfigurationsInner.md b/docs/SlaNotificationConfigurationsInner.md new file mode 100644 index 00000000..bef53213 --- /dev/null +++ b/docs/SlaNotificationConfigurationsInner.md @@ -0,0 +1,27 @@ + + +# SlaNotificationConfigurationsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **UUID** | Unique ID of the notification configuration | [optional] | +|**offsetType** | [**OffsetTypeEnum**](#OffsetTypeEnum) | When to send the notification relative to the deadline | [optional] | +|**offsetDays** | **Integer** | Number of days offset from the deadline | [optional] | +|**createdAt** | **String** | Date of creation | [optional] | +|**updatedAt** | **String** | Date of last update | [optional] | + + + +## Enum: OffsetTypeEnum + +| Name | Value | +|---- | -----| +| BEFORE_DUE | "before_due" | +| WHEN_DUE | "when_due" | +| AFTER_DUE | "after_due" | + + + diff --git a/docs/SlaResponse.md b/docs/SlaResponse.md new file mode 100644 index 00000000..995317e5 --- /dev/null +++ b/docs/SlaResponse.md @@ -0,0 +1,13 @@ + + +# SlaResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**SlaResponseData**](SlaResponseData.md) | | | + + + diff --git a/docs/SlaResponseData.md b/docs/SlaResponseData.md new file mode 100644 index 00000000..c1c394b7 --- /dev/null +++ b/docs/SlaResponseData.md @@ -0,0 +1,23 @@ + + +# SlaResponseData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | Unique ID of the SLA | | +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**Sla**](Sla.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| SLAS | "slas" | + + + diff --git a/docs/SlasApi.md b/docs/SlasApi.md new file mode 100644 index 00000000..f99a879e --- /dev/null +++ b/docs/SlasApi.md @@ -0,0 +1,373 @@ +# SlasApi + +All URIs are relative to *https://api.rootly.com* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createSLA**](SlasApi.md#createSLA) | **POST** /v1/slas | Creates an SLA | +| [**deleteSLA**](SlasApi.md#deleteSLA) | **DELETE** /v1/slas/{id} | Delete an SLA | +| [**getSLA**](SlasApi.md#getSLA) | **GET** /v1/slas/{id} | Retrieves an SLA | +| [**listSLAs**](SlasApi.md#listSLAs) | **GET** /v1/slas | List SLAs | +| [**updateSLA**](SlasApi.md#updateSLA) | **PUT** /v1/slas/{id} | Update an SLA | + + + +# **createSLA** +> SlaResponse createSLA(newSla) + +Creates an SLA + +Creates a new SLA from provided data + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.SlasApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + SlasApi apiInstance = new SlasApi(defaultClient); + NewSla newSla = new NewSla(); // NewSla | + try { + SlaResponse result = apiInstance.createSLA(newSla); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SlasApi#createSLA"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **newSla** | [**NewSla**](NewSla.md)| | | + +### Return type + +[**SlaResponse**](SlaResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | SLA created | - | +| **422** | invalid request | - | +| **401** | responds with unauthorized for invalid token | - | + + +# **deleteSLA** +> SlaResponse deleteSLA(id) + +Delete an SLA + +Delete a specific SLA by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.SlasApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + SlasApi apiInstance = new SlasApi(defaultClient); + String id = "id_example"; // String | + try { + SlaResponse result = apiInstance.deleteSLA(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SlasApi#deleteSLA"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +[**SlaResponse**](SlaResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | SLA deleted | - | +| **404** | resource not found for another team | - | + + +# **getSLA** +> SlaResponse getSLA(id) + +Retrieves an SLA + +Retrieves a specific SLA by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.SlasApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + SlasApi apiInstance = new SlasApi(defaultClient); + String id = "id_example"; // String | + try { + SlaResponse result = apiInstance.getSLA(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SlasApi#getSLA"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | + +### Return type + +[**SlaResponse**](SlaResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | SLA found | - | +| **404** | resource not found for another team | - | + + +# **listSLAs** +> SlaList listSLAs(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort) + +List SLAs + +List SLAs + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.SlasApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + SlasApi apiInstance = new SlasApi(defaultClient); + Integer pageNumber = 56; // Integer | + Integer pageSize = 56; // Integer | + String filterSearch = "filterSearch_example"; // String | + String filterSlug = "filterSlug_example"; // String | + String filterName = "filterName_example"; // String | + String filterCreatedAtGt = "filterCreatedAtGt_example"; // String | + String filterCreatedAtGte = "filterCreatedAtGte_example"; // String | + String filterCreatedAtLt = "filterCreatedAtLt_example"; // String | + String filterCreatedAtLte = "filterCreatedAtLte_example"; // String | + String sort = "sort_example"; // String | + try { + SlaList result = apiInstance.listSLAs(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SlasApi#listSLAs"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pageNumber** | **Integer**| | [optional] | +| **pageSize** | **Integer**| | [optional] | +| **filterSearch** | **String**| | [optional] | +| **filterSlug** | **String**| | [optional] | +| **filterName** | **String**| | [optional] | +| **filterCreatedAtGt** | **String**| | [optional] | +| **filterCreatedAtGte** | **String**| | [optional] | +| **filterCreatedAtLt** | **String**| | [optional] | +| **filterCreatedAtLte** | **String**| | [optional] | +| **sort** | **String**| | [optional] | + +### Return type + +[**SlaList**](SlaList.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | success | - | + + +# **updateSLA** +> SlaResponse updateSLA(id, updateSla) + +Update an SLA + +Update a specific SLA by id + +### Example +```java +// Import classes: +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.Configuration; +import com.rootly.client.auth.*; +import com.rootly.client.models.*; +import com.rootly.client.api.SlasApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.rootly.com"); + + // Configure HTTP bearer authorization: bearer_auth + HttpBearerAuth bearer_auth = (HttpBearerAuth) defaultClient.getAuthentication("bearer_auth"); + bearer_auth.setBearerToken("BEARER TOKEN"); + + SlasApi apiInstance = new SlasApi(defaultClient); + String id = "id_example"; // String | + UpdateSla updateSla = new UpdateSla(); // UpdateSla | + try { + SlaResponse result = apiInstance.updateSLA(id, updateSla); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SlasApi#updateSLA"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | **String**| | | +| **updateSla** | [**UpdateSla**](UpdateSla.md)| | | + +### Return type + +[**SlaResponse**](SlaResponse.md) + +### Authorization + +[bearer_auth](../README.md#bearer_auth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | SLA updated | - | +| **404** | resource not found for another team | - | + diff --git a/docs/SnoozeAlert.md b/docs/SnoozeAlert.md new file mode 100644 index 00000000..b74c8b15 --- /dev/null +++ b/docs/SnoozeAlert.md @@ -0,0 +1,13 @@ + + +# SnoozeAlert + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**SnoozeAlertData**](SnoozeAlertData.md) | | | + + + diff --git a/docs/SnoozeAlertData.md b/docs/SnoozeAlertData.md new file mode 100644 index 00000000..3a25c477 --- /dev/null +++ b/docs/SnoozeAlertData.md @@ -0,0 +1,22 @@ + + +# SnoozeAlertData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**SnoozeAlertDataAttributes**](SnoozeAlertDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ALERTS | "alerts" | + + + diff --git a/docs/SnoozeAlertDataAttributes.md b/docs/SnoozeAlertDataAttributes.md new file mode 100644 index 00000000..fceeb5cb --- /dev/null +++ b/docs/SnoozeAlertDataAttributes.md @@ -0,0 +1,13 @@ + + +# SnoozeAlertDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**delayMinutes** | **Integer** | Number of minutes to snooze the alert for | | + + + diff --git a/docs/UpdateApiKey.md b/docs/UpdateApiKey.md new file mode 100644 index 00000000..7a2ca98b --- /dev/null +++ b/docs/UpdateApiKey.md @@ -0,0 +1,13 @@ + + +# UpdateApiKey + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UpdateApiKeyData**](UpdateApiKeyData.md) | | | + + + diff --git a/docs/UpdateApiKeyData.md b/docs/UpdateApiKeyData.md new file mode 100644 index 00000000..87d5eaad --- /dev/null +++ b/docs/UpdateApiKeyData.md @@ -0,0 +1,22 @@ + + +# UpdateApiKeyData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**UpdateApiKeyDataAttributes**](UpdateApiKeyDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| API_KEYS | "api_keys" | + + + diff --git a/docs/UpdateApiKeyDataAttributes.md b/docs/UpdateApiKeyDataAttributes.md new file mode 100644 index 00000000..63318369 --- /dev/null +++ b/docs/UpdateApiKeyDataAttributes.md @@ -0,0 +1,15 @@ + + +# UpdateApiKeyDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the API key | [optional] | +|**description** | **String** | A description of the API key | [optional] | +|**expiresAt** | **OffsetDateTime** | The expiration date of the API key (ISO 8601) | [optional] | + + + diff --git a/docs/UpdateCatalogChecklistTemplate.md b/docs/UpdateCatalogChecklistTemplate.md new file mode 100644 index 00000000..1afbc35c --- /dev/null +++ b/docs/UpdateCatalogChecklistTemplate.md @@ -0,0 +1,13 @@ + + +# UpdateCatalogChecklistTemplate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UpdateCatalogChecklistTemplateData**](UpdateCatalogChecklistTemplateData.md) | | | + + + diff --git a/docs/UpdateCatalogChecklistTemplateData.md b/docs/UpdateCatalogChecklistTemplateData.md new file mode 100644 index 00000000..9aec1852 --- /dev/null +++ b/docs/UpdateCatalogChecklistTemplateData.md @@ -0,0 +1,22 @@ + + +# UpdateCatalogChecklistTemplateData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**UpdateCatalogChecklistTemplateDataAttributes**](UpdateCatalogChecklistTemplateDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_CHECKLIST_TEMPLATES | "catalog_checklist_templates" | + + + diff --git a/docs/UpdateCatalogChecklistTemplateDataAttributes.md b/docs/UpdateCatalogChecklistTemplateDataAttributes.md new file mode 100644 index 00000000..fbde1735 --- /dev/null +++ b/docs/UpdateCatalogChecklistTemplateDataAttributes.md @@ -0,0 +1,16 @@ + + +# UpdateCatalogChecklistTemplateDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the checklist template | [optional] | +|**description** | **String** | The description of the checklist template | [optional] | +|**fields** | [**List<NewCatalogChecklistTemplateDataAttributesFieldsInner>**](NewCatalogChecklistTemplateDataAttributesFieldsInner.md) | Template fields. Position is determined by array order. Replaces all existing fields. | [optional] | +|**owners** | [**List<NewCatalogChecklistTemplateDataAttributesOwnersInner>**](NewCatalogChecklistTemplateDataAttributesOwnersInner.md) | Template owners. Replaces all existing owners. | [optional] | + + + diff --git a/docs/UpdateCatalogProperty.md b/docs/UpdateCatalogProperty.md new file mode 100644 index 00000000..9d08e98b --- /dev/null +++ b/docs/UpdateCatalogProperty.md @@ -0,0 +1,13 @@ + + +# UpdateCatalogProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UpdateCatalogPropertyData**](UpdateCatalogPropertyData.md) | | | + + + diff --git a/docs/UpdateCatalogPropertyData.md b/docs/UpdateCatalogPropertyData.md new file mode 100644 index 00000000..55927c6c --- /dev/null +++ b/docs/UpdateCatalogPropertyData.md @@ -0,0 +1,22 @@ + + +# UpdateCatalogPropertyData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**UpdateCatalogPropertyDataAttributes**](UpdateCatalogPropertyDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CATALOG_PROPERTIES | "catalog_properties" | + + + diff --git a/docs/UpdateCatalogPropertyDataAttributes.md b/docs/UpdateCatalogPropertyDataAttributes.md new file mode 100644 index 00000000..7428435f --- /dev/null +++ b/docs/UpdateCatalogPropertyDataAttributes.md @@ -0,0 +1,50 @@ + + +# UpdateCatalogPropertyDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**kind** | [**KindEnum**](#KindEnum) | | [optional] | +|**kindCatalogId** | **String** | Restricts values to items of specified catalog. | [optional] | +|**position** | **Integer** | Default position of the item when displayed in a list. | [optional] | +|**required** | **Boolean** | Whether the property is required. | [optional] | +|**catalogType** | [**CatalogTypeEnum**](#CatalogTypeEnum) | The type of catalog the property belongs to. | [optional] | + + + +## Enum: KindEnum + +| Name | Value | +|---- | -----| +| TEXT | "text" | +| REFERENCE | "reference" | +| BOOLEAN | "boolean" | +| REFERENCE2 | "reference" | +| SERVICE | "service" | +| FUNCTIONALITY | "functionality" | +| ENVIRONMENT | "environment" | +| GROUP | "group" | +| CAUSE | "cause" | +| INCIDENT_TYPE | "incident_type" | +| USER | "user" | + + + +## Enum: CatalogTypeEnum + +| Name | Value | +|---- | -----| +| CATALOG | "catalog" | +| CAUSE | "cause" | +| ENVIRONMENT | "environment" | +| FUNCTIONALITY | "functionality" | +| INCIDENT_TYPE | "incident_type" | +| SERVICE | "service" | +| TEAM | "team" | + + + diff --git a/docs/UpdateEdgeConnectorActionRequest.md b/docs/UpdateEdgeConnectorActionRequest.md new file mode 100644 index 00000000..592db923 --- /dev/null +++ b/docs/UpdateEdgeConnectorActionRequest.md @@ -0,0 +1,13 @@ + + +# UpdateEdgeConnectorActionRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**action** | [**UpdateEdgeConnectorActionRequestAction**](UpdateEdgeConnectorActionRequestAction.md) | | [optional] | + + + diff --git a/docs/UpdateEdgeConnectorActionRequestAction.md b/docs/UpdateEdgeConnectorActionRequestAction.md new file mode 100644 index 00000000..3eab1774 --- /dev/null +++ b/docs/UpdateEdgeConnectorActionRequestAction.md @@ -0,0 +1,24 @@ + + +# UpdateEdgeConnectorActionRequestAction + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**actionType** | [**ActionTypeEnum**](#ActionTypeEnum) | | [optional] | +|**metadata** | **Object** | | [optional] | + + + +## Enum: ActionTypeEnum + +| Name | Value | +|---- | -----| +| SCRIPT | "script" | +| HTTP | "http" | + + + diff --git a/docs/UpdateEdgeConnectorRequest.md b/docs/UpdateEdgeConnectorRequest.md new file mode 100644 index 00000000..0c598e04 --- /dev/null +++ b/docs/UpdateEdgeConnectorRequest.md @@ -0,0 +1,13 @@ + + +# UpdateEdgeConnectorRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UpdateEdgeConnectorRequestData**](UpdateEdgeConnectorRequestData.md) | | [optional] | + + + diff --git a/docs/UpdateEdgeConnectorRequestData.md b/docs/UpdateEdgeConnectorRequestData.md new file mode 100644 index 00000000..3954738f --- /dev/null +++ b/docs/UpdateEdgeConnectorRequestData.md @@ -0,0 +1,23 @@ + + +# UpdateEdgeConnectorRequestData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**id** | **String** | | [optional] | +|**attributes** | [**UpdateEdgeConnectorRequestDataAttributes**](UpdateEdgeConnectorRequestDataAttributes.md) | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| EDGE_CONNECTORS | "edge_connectors" | + + + diff --git a/docs/UpdateEdgeConnectorRequestDataAttributes.md b/docs/UpdateEdgeConnectorRequestDataAttributes.md new file mode 100644 index 00000000..23a8749c --- /dev/null +++ b/docs/UpdateEdgeConnectorRequestDataAttributes.md @@ -0,0 +1,25 @@ + + +# UpdateEdgeConnectorRequestDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**description** | **String** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | | [optional] | +|**subscriptions** | **List<String>** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| ACTIVE | "active" | +| PAUSED | "paused" | + + + diff --git a/docs/UpdateGithubIssueTaskParamsRepository.md b/docs/UpdateGithubIssueTaskParamsRepository.md new file mode 100644 index 00000000..b1f4b81e --- /dev/null +++ b/docs/UpdateGithubIssueTaskParamsRepository.md @@ -0,0 +1,15 @@ + + +# UpdateGithubIssueTaskParamsRepository + +The repository (used for loading labels and issue types) + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **String** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/docs/UpdateOnCallPayReport.md b/docs/UpdateOnCallPayReport.md new file mode 100644 index 00000000..168929cf --- /dev/null +++ b/docs/UpdateOnCallPayReport.md @@ -0,0 +1,13 @@ + + +# UpdateOnCallPayReport + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UpdateOnCallPayReportData**](UpdateOnCallPayReportData.md) | | | + + + diff --git a/docs/UpdateOnCallPayReportData.md b/docs/UpdateOnCallPayReportData.md new file mode 100644 index 00000000..f1580b97 --- /dev/null +++ b/docs/UpdateOnCallPayReportData.md @@ -0,0 +1,22 @@ + + +# UpdateOnCallPayReportData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**UpdateOnCallPayReportDataAttributes**](UpdateOnCallPayReportDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| ON_CALL_PAY_REPORTS | "on_call_pay_reports" | + + + diff --git a/docs/UpdateOnCallPayReportDataAttributes.md b/docs/UpdateOnCallPayReportDataAttributes.md new file mode 100644 index 00000000..fa107179 --- /dev/null +++ b/docs/UpdateOnCallPayReportDataAttributes.md @@ -0,0 +1,15 @@ + + +# UpdateOnCallPayReportDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**startDate** | **LocalDate** | The start date for the report period. | [optional] | +|**endDate** | **LocalDate** | The end date for the report period. | [optional] | +|**scheduleIds** | **List<String>** | List of schedule UUIDs to scope the report. | [optional] | + + + diff --git a/docs/UpdateSla.md b/docs/UpdateSla.md new file mode 100644 index 00000000..a6568546 --- /dev/null +++ b/docs/UpdateSla.md @@ -0,0 +1,13 @@ + + +# UpdateSla + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**data** | [**UpdateSlaData**](UpdateSlaData.md) | | | + + + diff --git a/docs/UpdateSlaData.md b/docs/UpdateSlaData.md new file mode 100644 index 00000000..4c00f861 --- /dev/null +++ b/docs/UpdateSlaData.md @@ -0,0 +1,22 @@ + + +# UpdateSlaData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | | +|**attributes** | [**UpdateSlaDataAttributes**](UpdateSlaDataAttributes.md) | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| SLAS | "slas" | + + + diff --git a/docs/UpdateSlaDataAttributes.md b/docs/UpdateSlaDataAttributes.md new file mode 100644 index 00000000..d9131a26 --- /dev/null +++ b/docs/UpdateSlaDataAttributes.md @@ -0,0 +1,97 @@ + + +# UpdateSlaDataAttributes + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | The name of the SLA | [optional] | +|**description** | **String** | A description of the SLA | [optional] | +|**position** | **Integer** | Position of the SLA for ordering | [optional] | +|**conditionMatchType** | [**ConditionMatchTypeEnum**](#ConditionMatchTypeEnum) | Whether all or any conditions must match | [optional] | +|**managerRoleId** | **UUID** | The ID of the incident role responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. | [optional] | +|**managerUserId** | **Integer** | The ID of the user responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. | [optional] | +|**assignmentDeadlineDays** | [**AssignmentDeadlineDaysEnum**](#AssignmentDeadlineDaysEnum) | Number of days for the assignment deadline | [optional] | +|**assignmentDeadlineParentStatus** | [**AssignmentDeadlineParentStatusEnum**](#AssignmentDeadlineParentStatusEnum) | The incident parent status that triggers the assignment deadline | [optional] | +|**assignmentDeadlineSubStatusId** | **UUID** | Sub-status for the assignment deadline. Required when custom lifecycle statuses are enabled on the team. | [optional] | +|**assignmentSkipWeekends** | **Boolean** | Whether to skip weekends when calculating the assignment deadline | [optional] | +|**completionDeadlineDays** | [**CompletionDeadlineDaysEnum**](#CompletionDeadlineDaysEnum) | Number of days for the completion deadline | [optional] | +|**completionDeadlineParentStatus** | [**CompletionDeadlineParentStatusEnum**](#CompletionDeadlineParentStatusEnum) | The incident parent status that triggers the completion deadline | [optional] | +|**completionDeadlineSubStatusId** | **UUID** | Sub-status for the completion deadline. Required when custom lifecycle statuses are enabled on the team. | [optional] | +|**completionSkipWeekends** | **Boolean** | Whether to skip weekends when calculating the completion deadline | [optional] | +|**conditions** | [**List<NewSlaDataAttributesConditionsInner>**](NewSlaDataAttributesConditionsInner.md) | Conditions that determine which incidents this SLA applies to. Replaces all existing conditions. | [optional] | +|**notificationConfigurations** | [**List<NewSlaDataAttributesNotificationConfigurationsInner>**](NewSlaDataAttributesNotificationConfigurationsInner.md) | Notification timing configurations. Replaces all existing configurations. | [optional] | + + + +## Enum: ConditionMatchTypeEnum + +| Name | Value | +|---- | -----| +| ALL | "ALL" | +| ANY | "ANY" | + + + +## Enum: AssignmentDeadlineDaysEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_2 | 2 | +| NUMBER_3 | 3 | +| NUMBER_4 | 4 | +| NUMBER_5 | 5 | +| NUMBER_6 | 6 | +| NUMBER_7 | 7 | +| NUMBER_14 | 14 | +| NUMBER_21 | 21 | +| NUMBER_30 | 30 | + + + +## Enum: AssignmentDeadlineParentStatusEnum + +| Name | Value | +|---- | -----| +| IN_TRIAGE | "in_triage" | +| STARTED | "started" | +| MITIGATED | "mitigated" | +| RESOLVED | "resolved" | +| CLOSED | "closed" | +| CANCELLED | "cancelled" | + + + +## Enum: CompletionDeadlineDaysEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_2 | 2 | +| NUMBER_3 | 3 | +| NUMBER_4 | 4 | +| NUMBER_5 | 5 | +| NUMBER_6 | 6 | +| NUMBER_7 | 7 | +| NUMBER_14 | 14 | +| NUMBER_21 | 21 | +| NUMBER_30 | 30 | + + + +## Enum: CompletionDeadlineParentStatusEnum + +| Name | Value | +|---- | -----| +| IN_TRIAGE | "in_triage" | +| STARTED | "started" | +| MITIGATED | "mitigated" | +| RESOLVED | "resolved" | +| CLOSED | "closed" | +| CANCELLED | "cancelled" | + + + diff --git a/src/main/java/com/rootly/client/api/ApiKeysApi.java b/src/main/java/com/rootly/client/api/ApiKeysApi.java new file mode 100644 index 00000000..784b2bd8 --- /dev/null +++ b/src/main/java/com/rootly/client/api/ApiKeysApi.java @@ -0,0 +1,1077 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.ApiKeyList; +import com.rootly.client.model.ApiKeyResponse; +import com.rootly.client.model.ApiKeyWithTokenResponse; +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.NewApiKey; +import com.rootly.client.model.RotateApiKey; +import java.util.UUID; +import com.rootly.client.model.UpdateApiKey; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApiKeysApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ApiKeysApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApiKeysApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createApiKey + * @param newApiKey (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 API key created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createApiKeyCall(@javax.annotation.Nonnull NewApiKey newApiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newApiKey; + + // create path and map variables + String localVarPath = "/v1/api_keys"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createApiKeyValidateBeforeCall(@javax.annotation.Nonnull NewApiKey newApiKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'newApiKey' is set + if (newApiKey == null) { + throw new ApiException("Missing the required parameter 'newApiKey' when calling createApiKey(Async)"); + } + + return createApiKeyCall(newApiKey, _callback); + + } + + /** + * Creates an API key + * Creates a new API key and returns it with the plaintext token. **The token is only returned once** — store it securely, as it cannot be retrieved again. **Kinds and required fields:** - `personal` — created for the authenticated user. No additional fields required. - `team` — scoped to a team (group). Requires `group_id`. A service account is automatically created with permissions derived from group membership. - `organization` — organization-wide access. Requires owner or admin role. Optionally set `role_id` and `on_call_role_id` to control the service account's permissions. **Expiration:** All keys require an `expires_at` date set in the future (maximum 5 years). Names must be unique within their kind and scope. + * @param newApiKey (required) + * @return ApiKeyWithTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 API key created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public ApiKeyWithTokenResponse createApiKey(@javax.annotation.Nonnull NewApiKey newApiKey) throws ApiException { + ApiResponse localVarResp = createApiKeyWithHttpInfo(newApiKey); + return localVarResp.getData(); + } + + /** + * Creates an API key + * Creates a new API key and returns it with the plaintext token. **The token is only returned once** — store it securely, as it cannot be retrieved again. **Kinds and required fields:** - `personal` — created for the authenticated user. No additional fields required. - `team` — scoped to a team (group). Requires `group_id`. A service account is automatically created with permissions derived from group membership. - `organization` — organization-wide access. Requires owner or admin role. Optionally set `role_id` and `on_call_role_id` to control the service account's permissions. **Expiration:** All keys require an `expires_at` date set in the future (maximum 5 years). Names must be unique within their kind and scope. + * @param newApiKey (required) + * @return ApiResponse<ApiKeyWithTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 API key created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public ApiResponse createApiKeyWithHttpInfo(@javax.annotation.Nonnull NewApiKey newApiKey) throws ApiException { + okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(newApiKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Creates an API key (asynchronously) + * Creates a new API key and returns it with the plaintext token. **The token is only returned once** — store it securely, as it cannot be retrieved again. **Kinds and required fields:** - `personal` — created for the authenticated user. No additional fields required. - `team` — scoped to a team (group). Requires `group_id`. A service account is automatically created with permissions derived from group membership. - `organization` — organization-wide access. Requires owner or admin role. Optionally set `role_id` and `on_call_role_id` to control the service account's permissions. **Expiration:** All keys require an `expires_at` date set in the future (maximum 5 years). Names must be unique within their kind and scope. + * @param newApiKey (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 API key created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createApiKeyAsync(@javax.annotation.Nonnull NewApiKey newApiKey, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createApiKeyValidateBeforeCall(newApiKey, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteApiKey + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key revoked -
404 API key not found -
+ */ + public okhttp3.Call deleteApiKeyCall(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/api_keys/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteApiKeyValidateBeforeCall(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteApiKey(Async)"); + } + + return deleteApiKeyCall(id, _callback); + + } + + /** + * Revoke an API key + * Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. This action cannot be undone. For `team` and `organization` keys, the associated service account is also deleted. Any active sessions using this key will fail on the next request. + * @param id (required) + * @return ApiKeyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key revoked -
404 API key not found -
+ */ + public ApiKeyResponse deleteApiKey(@javax.annotation.Nonnull UUID id) throws ApiException { + ApiResponse localVarResp = deleteApiKeyWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Revoke an API key + * Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. This action cannot be undone. For `team` and `organization` keys, the associated service account is also deleted. Any active sessions using this key will fail on the next request. + * @param id (required) + * @return ApiResponse<ApiKeyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key revoked -
404 API key not found -
+ */ + public ApiResponse deleteApiKeyWithHttpInfo(@javax.annotation.Nonnull UUID id) throws ApiException { + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Revoke an API key (asynchronously) + * Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. This action cannot be undone. For `team` and `organization` keys, the associated service account is also deleted. Any active sessions using this key will fail on the next request. + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key revoked -
404 API key not found -
+ */ + public okhttp3.Call deleteApiKeyAsync(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteApiKeyValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getApiKey + * @param id (required) + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key found -
404 API key not found -
+ */ + public okhttp3.Call getApiKeyCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable String include, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/api_keys/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getApiKeyValidateBeforeCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable String include, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getApiKey(Async)"); + } + + return getApiKeyCall(id, include, _callback); + + } + + /** + * Retrieves an API key + * Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, last usage timestamp, and the grace period status — the secret token is never included. + * @param id (required) + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @return ApiKeyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key found -
404 API key not found -
+ */ + public ApiKeyResponse getApiKey(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable String include) throws ApiException { + ApiResponse localVarResp = getApiKeyWithHttpInfo(id, include); + return localVarResp.getData(); + } + + /** + * Retrieves an API key + * Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, last usage timestamp, and the grace period status — the secret token is never included. + * @param id (required) + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @return ApiResponse<ApiKeyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key found -
404 API key not found -
+ */ + public ApiResponse getApiKeyWithHttpInfo(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable String include) throws ApiException { + okhttp3.Call localVarCall = getApiKeyValidateBeforeCall(id, include, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an API key (asynchronously) + * Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, last usage timestamp, and the grace period status — the secret token is never included. + * @param id (required) + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key found -
404 API key not found -
+ */ + public okhttp3.Call getApiKeyAsync(@javax.annotation.Nonnull UUID id, @javax.annotation.Nullable String include, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getApiKeyValidateBeforeCall(id, include, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listApiKeys + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterKind Filter by API key kind: personal, team, organization (optional) + * @param filterSearch Search by name (case-insensitive partial match) (optional) + * @param filterName Filter by exact name (optional) + * @param filterUserId Filter by the user ID that owns the key (optional) + * @param filterGroupIds Filter team keys by group IDs (comma-separated) (optional) + * @param filterRoleId Filter by role ID (optional) + * @param filterActive When true, return only non-expired keys (optional) + * @param filterExpired When true, return only expired keys (optional) + * @param filterCreatedAtGt Created after (ISO 8601) (optional) + * @param filterCreatedAtGte Created at or after (ISO 8601) (optional) + * @param filterCreatedAtLt Created before (ISO 8601) (optional) + * @param filterCreatedAtLte Created at or before (ISO 8601) (optional) + * @param filterExpiresAtGt Expires after (ISO 8601) (optional) + * @param filterExpiresAtGte Expires at or after (ISO 8601) (optional) + * @param filterExpiresAtLt Expires before (ISO 8601). Useful for finding keys approaching expiration. (optional) + * @param filterExpiresAtLte Expires at or before (ISO 8601) (optional) + * @param filterLastUsedAtGt Last used after (ISO 8601) (optional) + * @param filterLastUsedAtGte Last used at or after (ISO 8601) (optional) + * @param filterLastUsedAtLt Last used before (ISO 8601) (optional) + * @param filterLastUsedAtLte Last used at or before (ISO 8601) (optional) + * @param sort Sort by field. Prefix with - for descending (e.g., -created_at, expires_at) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 success -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call listApiKeysCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterKind, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterUserId, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterRoleId, @javax.annotation.Nullable Boolean filterActive, @javax.annotation.Nullable Boolean filterExpired, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String filterExpiresAtGt, @javax.annotation.Nullable String filterExpiresAtGte, @javax.annotation.Nullable String filterExpiresAtLt, @javax.annotation.Nullable String filterExpiresAtLte, @javax.annotation.Nullable String filterLastUsedAtGt, @javax.annotation.Nullable String filterLastUsedAtGte, @javax.annotation.Nullable String filterLastUsedAtLt, @javax.annotation.Nullable String filterLastUsedAtLte, @javax.annotation.Nullable String sort, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/api_keys"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[number]", pageNumber)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + if (filterKind != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[kind]", filterKind)); + } + + if (filterSearch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[search]", filterSearch)); + } + + if (filterName != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[name]", filterName)); + } + + if (filterUserId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[user_id]", filterUserId)); + } + + if (filterGroupIds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[group_ids]", filterGroupIds)); + } + + if (filterRoleId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[role_id]", filterRoleId)); + } + + if (filterActive != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[active]", filterActive)); + } + + if (filterExpired != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[expired]", filterExpired)); + } + + if (filterCreatedAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gt]", filterCreatedAtGt)); + } + + if (filterCreatedAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gte]", filterCreatedAtGte)); + } + + if (filterCreatedAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lt]", filterCreatedAtLt)); + } + + if (filterCreatedAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lte]", filterCreatedAtLte)); + } + + if (filterExpiresAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[expires_at][gt]", filterExpiresAtGt)); + } + + if (filterExpiresAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[expires_at][gte]", filterExpiresAtGte)); + } + + if (filterExpiresAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[expires_at][lt]", filterExpiresAtLt)); + } + + if (filterExpiresAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[expires_at][lte]", filterExpiresAtLte)); + } + + if (filterLastUsedAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[last_used_at][gt]", filterLastUsedAtGt)); + } + + if (filterLastUsedAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[last_used_at][gte]", filterLastUsedAtGte)); + } + + if (filterLastUsedAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[last_used_at][lt]", filterLastUsedAtLt)); + } + + if (filterLastUsedAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[last_used_at][lte]", filterLastUsedAtLte)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listApiKeysValidateBeforeCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterKind, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterUserId, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterRoleId, @javax.annotation.Nullable Boolean filterActive, @javax.annotation.Nullable Boolean filterExpired, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String filterExpiresAtGt, @javax.annotation.Nullable String filterExpiresAtGte, @javax.annotation.Nullable String filterExpiresAtLt, @javax.annotation.Nullable String filterExpiresAtLte, @javax.annotation.Nullable String filterLastUsedAtGt, @javax.annotation.Nullable String filterLastUsedAtGte, @javax.annotation.Nullable String filterLastUsedAtLt, @javax.annotation.Nullable String filterLastUsedAtLte, @javax.annotation.Nullable String sort, final ApiCallback _callback) throws ApiException { + return listApiKeysCall(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort, _callback); + + } + + /** + * List API keys + * List API keys for the current organization. Returns key metadata including name, kind, expiration, and last usage — the secret token value is never included in the response. **API key kinds:** - `personal` — tied to a specific user, inherits that user's permissions. - `team` — scoped to one or more teams (groups), creates a service account with permissions derived from group membership. - `organization` — organization-wide, creates a service account with a configurable role and on-call role. **Automated rotation workflow:** Use `filter[expires_at][lt]` to find keys approaching expiration, then call the rotate endpoint to issue a new token before the old one expires. Combine with `filter[active]=true` to exclude already-expired keys. **Sorting:** Use the `sort` parameter with a field name (e.g., `sort=expires_at`). Prefix with `-` for descending order (e.g., `sort=-created_at`). Allowed fields: `name`, `kind`, `created_at`, `updated_at`, `expires_at`, `last_used_at`. + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterKind Filter by API key kind: personal, team, organization (optional) + * @param filterSearch Search by name (case-insensitive partial match) (optional) + * @param filterName Filter by exact name (optional) + * @param filterUserId Filter by the user ID that owns the key (optional) + * @param filterGroupIds Filter team keys by group IDs (comma-separated) (optional) + * @param filterRoleId Filter by role ID (optional) + * @param filterActive When true, return only non-expired keys (optional) + * @param filterExpired When true, return only expired keys (optional) + * @param filterCreatedAtGt Created after (ISO 8601) (optional) + * @param filterCreatedAtGte Created at or after (ISO 8601) (optional) + * @param filterCreatedAtLt Created before (ISO 8601) (optional) + * @param filterCreatedAtLte Created at or before (ISO 8601) (optional) + * @param filterExpiresAtGt Expires after (ISO 8601) (optional) + * @param filterExpiresAtGte Expires at or after (ISO 8601) (optional) + * @param filterExpiresAtLt Expires before (ISO 8601). Useful for finding keys approaching expiration. (optional) + * @param filterExpiresAtLte Expires at or before (ISO 8601) (optional) + * @param filterLastUsedAtGt Last used after (ISO 8601) (optional) + * @param filterLastUsedAtGte Last used at or after (ISO 8601) (optional) + * @param filterLastUsedAtLt Last used before (ISO 8601) (optional) + * @param filterLastUsedAtLte Last used at or before (ISO 8601) (optional) + * @param sort Sort by field. Prefix with - for descending (e.g., -created_at, expires_at) (optional) + * @return ApiKeyList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 success -
401 responds with unauthorized for invalid token -
+ */ + public ApiKeyList listApiKeys(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterKind, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterUserId, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterRoleId, @javax.annotation.Nullable Boolean filterActive, @javax.annotation.Nullable Boolean filterExpired, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String filterExpiresAtGt, @javax.annotation.Nullable String filterExpiresAtGte, @javax.annotation.Nullable String filterExpiresAtLt, @javax.annotation.Nullable String filterExpiresAtLte, @javax.annotation.Nullable String filterLastUsedAtGt, @javax.annotation.Nullable String filterLastUsedAtGte, @javax.annotation.Nullable String filterLastUsedAtLt, @javax.annotation.Nullable String filterLastUsedAtLte, @javax.annotation.Nullable String sort) throws ApiException { + ApiResponse localVarResp = listApiKeysWithHttpInfo(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort); + return localVarResp.getData(); + } + + /** + * List API keys + * List API keys for the current organization. Returns key metadata including name, kind, expiration, and last usage — the secret token value is never included in the response. **API key kinds:** - `personal` — tied to a specific user, inherits that user's permissions. - `team` — scoped to one or more teams (groups), creates a service account with permissions derived from group membership. - `organization` — organization-wide, creates a service account with a configurable role and on-call role. **Automated rotation workflow:** Use `filter[expires_at][lt]` to find keys approaching expiration, then call the rotate endpoint to issue a new token before the old one expires. Combine with `filter[active]=true` to exclude already-expired keys. **Sorting:** Use the `sort` parameter with a field name (e.g., `sort=expires_at`). Prefix with `-` for descending order (e.g., `sort=-created_at`). Allowed fields: `name`, `kind`, `created_at`, `updated_at`, `expires_at`, `last_used_at`. + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterKind Filter by API key kind: personal, team, organization (optional) + * @param filterSearch Search by name (case-insensitive partial match) (optional) + * @param filterName Filter by exact name (optional) + * @param filterUserId Filter by the user ID that owns the key (optional) + * @param filterGroupIds Filter team keys by group IDs (comma-separated) (optional) + * @param filterRoleId Filter by role ID (optional) + * @param filterActive When true, return only non-expired keys (optional) + * @param filterExpired When true, return only expired keys (optional) + * @param filterCreatedAtGt Created after (ISO 8601) (optional) + * @param filterCreatedAtGte Created at or after (ISO 8601) (optional) + * @param filterCreatedAtLt Created before (ISO 8601) (optional) + * @param filterCreatedAtLte Created at or before (ISO 8601) (optional) + * @param filterExpiresAtGt Expires after (ISO 8601) (optional) + * @param filterExpiresAtGte Expires at or after (ISO 8601) (optional) + * @param filterExpiresAtLt Expires before (ISO 8601). Useful for finding keys approaching expiration. (optional) + * @param filterExpiresAtLte Expires at or before (ISO 8601) (optional) + * @param filterLastUsedAtGt Last used after (ISO 8601) (optional) + * @param filterLastUsedAtGte Last used at or after (ISO 8601) (optional) + * @param filterLastUsedAtLt Last used before (ISO 8601) (optional) + * @param filterLastUsedAtLte Last used at or before (ISO 8601) (optional) + * @param sort Sort by field. Prefix with - for descending (e.g., -created_at, expires_at) (optional) + * @return ApiResponse<ApiKeyList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 success -
401 responds with unauthorized for invalid token -
+ */ + public ApiResponse listApiKeysWithHttpInfo(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterKind, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterUserId, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterRoleId, @javax.annotation.Nullable Boolean filterActive, @javax.annotation.Nullable Boolean filterExpired, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String filterExpiresAtGt, @javax.annotation.Nullable String filterExpiresAtGte, @javax.annotation.Nullable String filterExpiresAtLt, @javax.annotation.Nullable String filterExpiresAtLte, @javax.annotation.Nullable String filterLastUsedAtGt, @javax.annotation.Nullable String filterLastUsedAtGte, @javax.annotation.Nullable String filterLastUsedAtLt, @javax.annotation.Nullable String filterLastUsedAtLte, @javax.annotation.Nullable String sort) throws ApiException { + okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List API keys (asynchronously) + * List API keys for the current organization. Returns key metadata including name, kind, expiration, and last usage — the secret token value is never included in the response. **API key kinds:** - `personal` — tied to a specific user, inherits that user's permissions. - `team` — scoped to one or more teams (groups), creates a service account with permissions derived from group membership. - `organization` — organization-wide, creates a service account with a configurable role and on-call role. **Automated rotation workflow:** Use `filter[expires_at][lt]` to find keys approaching expiration, then call the rotate endpoint to issue a new token before the old one expires. Combine with `filter[active]=true` to exclude already-expired keys. **Sorting:** Use the `sort` parameter with a field name (e.g., `sort=expires_at`). Prefix with `-` for descending order (e.g., `sort=-created_at`). Allowed fields: `name`, `kind`, `created_at`, `updated_at`, `expires_at`, `last_used_at`. + * @param include Comma-separated list of relationships to include (role, on_call_role, created_by, groups) (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterKind Filter by API key kind: personal, team, organization (optional) + * @param filterSearch Search by name (case-insensitive partial match) (optional) + * @param filterName Filter by exact name (optional) + * @param filterUserId Filter by the user ID that owns the key (optional) + * @param filterGroupIds Filter team keys by group IDs (comma-separated) (optional) + * @param filterRoleId Filter by role ID (optional) + * @param filterActive When true, return only non-expired keys (optional) + * @param filterExpired When true, return only expired keys (optional) + * @param filterCreatedAtGt Created after (ISO 8601) (optional) + * @param filterCreatedAtGte Created at or after (ISO 8601) (optional) + * @param filterCreatedAtLt Created before (ISO 8601) (optional) + * @param filterCreatedAtLte Created at or before (ISO 8601) (optional) + * @param filterExpiresAtGt Expires after (ISO 8601) (optional) + * @param filterExpiresAtGte Expires at or after (ISO 8601) (optional) + * @param filterExpiresAtLt Expires before (ISO 8601). Useful for finding keys approaching expiration. (optional) + * @param filterExpiresAtLte Expires at or before (ISO 8601) (optional) + * @param filterLastUsedAtGt Last used after (ISO 8601) (optional) + * @param filterLastUsedAtGte Last used at or after (ISO 8601) (optional) + * @param filterLastUsedAtLt Last used before (ISO 8601) (optional) + * @param filterLastUsedAtLte Last used at or before (ISO 8601) (optional) + * @param sort Sort by field. Prefix with - for descending (e.g., -created_at, expires_at) (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 success -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call listApiKeysAsync(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterKind, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterUserId, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterRoleId, @javax.annotation.Nullable Boolean filterActive, @javax.annotation.Nullable Boolean filterExpired, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String filterExpiresAtGt, @javax.annotation.Nullable String filterExpiresAtGte, @javax.annotation.Nullable String filterExpiresAtLt, @javax.annotation.Nullable String filterExpiresAtLte, @javax.annotation.Nullable String filterLastUsedAtGt, @javax.annotation.Nullable String filterLastUsedAtGte, @javax.annotation.Nullable String filterLastUsedAtLt, @javax.annotation.Nullable String filterLastUsedAtLte, @javax.annotation.Nullable String sort, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listApiKeysValidateBeforeCall(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for rotateApiKey + * @param id (required) + * @param rotateApiKey (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key rotated -
404 API key not found -
+ */ + public okhttp3.Call rotateApiKeyCall(@javax.annotation.Nonnull String id, @javax.annotation.Nullable RotateApiKey rotateApiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = rotateApiKey; + + // create path and map variables + String localVarPath = "/v1/api_keys/{id}/rotate" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call rotateApiKeyValidateBeforeCall(@javax.annotation.Nonnull String id, @javax.annotation.Nullable RotateApiKey rotateApiKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling rotateApiKey(Async)"); + } + + return rotateApiKeyCall(id, rotateApiKey, _callback); + + } + + /** + * Rotate an API key + * Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown once**, so store it securely. **Self-only:** You can only rotate the API key that was used to authenticate this request. Attempting to rotate a different key returns `403 Forbidden`. **Grace period:** When enabled for your organization, the previous token remains valid after rotation, giving you time to deploy the new token without downtime. Pass `grace_period_minutes` (integer, 0–1440, default 30) to control how long the old token stays valid. Set to 0 to immediately invalidate the old token. The `grace_period_ends_at` field in the response confirms the exact time the old token will stop working. **Expiration:** Optionally provide a new `expires_at` date (ISO 8601, up to 5 years). Defaults to 90 days from now if omitted. Dates in the past are rejected. **Typical rotation workflow:** 1. Call this endpoint to get a new token (optionally with a custom `grace_period_minutes`). 2. Deploy the new token to your systems. 3. The old token continues working for `grace_period_minutes` (if grace period is enabled). 4. After the grace period, the old token is automatically invalidated. + * @param id (required) + * @param rotateApiKey (optional) + * @return ApiKeyWithTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key rotated -
404 API key not found -
+ */ + public ApiKeyWithTokenResponse rotateApiKey(@javax.annotation.Nonnull String id, @javax.annotation.Nullable RotateApiKey rotateApiKey) throws ApiException { + ApiResponse localVarResp = rotateApiKeyWithHttpInfo(id, rotateApiKey); + return localVarResp.getData(); + } + + /** + * Rotate an API key + * Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown once**, so store it securely. **Self-only:** You can only rotate the API key that was used to authenticate this request. Attempting to rotate a different key returns `403 Forbidden`. **Grace period:** When enabled for your organization, the previous token remains valid after rotation, giving you time to deploy the new token without downtime. Pass `grace_period_minutes` (integer, 0–1440, default 30) to control how long the old token stays valid. Set to 0 to immediately invalidate the old token. The `grace_period_ends_at` field in the response confirms the exact time the old token will stop working. **Expiration:** Optionally provide a new `expires_at` date (ISO 8601, up to 5 years). Defaults to 90 days from now if omitted. Dates in the past are rejected. **Typical rotation workflow:** 1. Call this endpoint to get a new token (optionally with a custom `grace_period_minutes`). 2. Deploy the new token to your systems. 3. The old token continues working for `grace_period_minutes` (if grace period is enabled). 4. After the grace period, the old token is automatically invalidated. + * @param id (required) + * @param rotateApiKey (optional) + * @return ApiResponse<ApiKeyWithTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key rotated -
404 API key not found -
+ */ + public ApiResponse rotateApiKeyWithHttpInfo(@javax.annotation.Nonnull String id, @javax.annotation.Nullable RotateApiKey rotateApiKey) throws ApiException { + okhttp3.Call localVarCall = rotateApiKeyValidateBeforeCall(id, rotateApiKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Rotate an API key (asynchronously) + * Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown once**, so store it securely. **Self-only:** You can only rotate the API key that was used to authenticate this request. Attempting to rotate a different key returns `403 Forbidden`. **Grace period:** When enabled for your organization, the previous token remains valid after rotation, giving you time to deploy the new token without downtime. Pass `grace_period_minutes` (integer, 0–1440, default 30) to control how long the old token stays valid. Set to 0 to immediately invalidate the old token. The `grace_period_ends_at` field in the response confirms the exact time the old token will stop working. **Expiration:** Optionally provide a new `expires_at` date (ISO 8601, up to 5 years). Defaults to 90 days from now if omitted. Dates in the past are rejected. **Typical rotation workflow:** 1. Call this endpoint to get a new token (optionally with a custom `grace_period_minutes`). 2. Deploy the new token to your systems. 3. The old token continues working for `grace_period_minutes` (if grace period is enabled). 4. After the grace period, the old token is automatically invalidated. + * @param id (required) + * @param rotateApiKey (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key rotated -
404 API key not found -
+ */ + public okhttp3.Call rotateApiKeyAsync(@javax.annotation.Nonnull String id, @javax.annotation.Nullable RotateApiKey rotateApiKey, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = rotateApiKeyValidateBeforeCall(id, rotateApiKey, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateApiKey + * @param id (required) + * @param updateApiKey (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key updated -
404 API key not found -
+ */ + public okhttp3.Call updateApiKeyCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull UpdateApiKey updateApiKey, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateApiKey; + + // create path and map variables + String localVarPath = "/v1/api_keys/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateApiKeyValidateBeforeCall(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull UpdateApiKey updateApiKey, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateApiKey(Async)"); + } + + // verify the required parameter 'updateApiKey' is set + if (updateApiKey == null) { + throw new ApiException("Missing the required parameter 'updateApiKey' when calling updateApiKey(Async)"); + } + + return updateApiKeyCall(id, updateApiKey, _callback); + + } + + /** + * Update an API key + * Update an API key's mutable attributes: `name`, `description`, and `expires_at`. The key's `kind`, `role_id`, `on_call_role_id`, and token cannot be changed after creation. To issue a new token, use the rotate endpoint. To change the role or kind, revoke the key and create a new one. The new `expires_at` must be in the future and within 5 years. + * @param id (required) + * @param updateApiKey (required) + * @return ApiKeyResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key updated -
404 API key not found -
+ */ + public ApiKeyResponse updateApiKey(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull UpdateApiKey updateApiKey) throws ApiException { + ApiResponse localVarResp = updateApiKeyWithHttpInfo(id, updateApiKey); + return localVarResp.getData(); + } + + /** + * Update an API key + * Update an API key's mutable attributes: `name`, `description`, and `expires_at`. The key's `kind`, `role_id`, `on_call_role_id`, and token cannot be changed after creation. To issue a new token, use the rotate endpoint. To change the role or kind, revoke the key and create a new one. The new `expires_at` must be in the future and within 5 years. + * @param id (required) + * @param updateApiKey (required) + * @return ApiResponse<ApiKeyResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key updated -
404 API key not found -
+ */ + public ApiResponse updateApiKeyWithHttpInfo(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull UpdateApiKey updateApiKey) throws ApiException { + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall(id, updateApiKey, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an API key (asynchronously) + * Update an API key's mutable attributes: `name`, `description`, and `expires_at`. The key's `kind`, `role_id`, `on_call_role_id`, and token cannot be changed after creation. To issue a new token, use the rotate endpoint. To change the role or kind, revoke the key and create a new one. The new `expires_at` must be in the future and within 5 years. + * @param id (required) + * @param updateApiKey (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 API key updated -
404 API key not found -
+ */ + public okhttp3.Call updateApiKeyAsync(@javax.annotation.Nonnull UUID id, @javax.annotation.Nonnull UpdateApiKey updateApiKey, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateApiKeyValidateBeforeCall(id, updateApiKey, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/CatalogChecklistTemplatesApi.java b/src/main/java/com/rootly/client/api/CatalogChecklistTemplatesApi.java new file mode 100644 index 00000000..11833c75 --- /dev/null +++ b/src/main/java/com/rootly/client/api/CatalogChecklistTemplatesApi.java @@ -0,0 +1,958 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.CatalogChecklistTemplateList; +import com.rootly.client.model.CatalogChecklistTemplateResponse; +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.GetAlertFieldIdParameter; +import com.rootly.client.model.NewCatalogChecklistTemplate; +import com.rootly.client.model.UpdateCatalogChecklistTemplate; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CatalogChecklistTemplatesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CatalogChecklistTemplatesApi() { + this(Configuration.getDefaultApiClient()); + } + + public CatalogChecklistTemplatesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createCatalogChecklistTemplate + * @param newCatalogChecklistTemplate (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 ignores user-provided field_key for custom fields -
422 returns 422 when scope_type is missing for Catalog scope_id -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createCatalogChecklistTemplateCall(@javax.annotation.Nonnull NewCatalogChecklistTemplate newCatalogChecklistTemplate, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newCatalogChecklistTemplate; + + // create path and map variables + String localVarPath = "/v1/catalog_checklist_templates"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCatalogChecklistTemplateValidateBeforeCall(@javax.annotation.Nonnull NewCatalogChecklistTemplate newCatalogChecklistTemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'newCatalogChecklistTemplate' is set + if (newCatalogChecklistTemplate == null) { + throw new ApiException("Missing the required parameter 'newCatalogChecklistTemplate' when calling createCatalogChecklistTemplate(Async)"); + } + + return createCatalogChecklistTemplateCall(newCatalogChecklistTemplate, _callback); + + } + + /** + * Creates a catalog checklist template + * Creates a new catalog checklist template + * @param newCatalogChecklistTemplate (required) + * @return CatalogChecklistTemplateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 ignores user-provided field_key for custom fields -
422 returns 422 when scope_type is missing for Catalog scope_id -
401 responds with unauthorized for invalid token -
+ */ + public CatalogChecklistTemplateResponse createCatalogChecklistTemplate(@javax.annotation.Nonnull NewCatalogChecklistTemplate newCatalogChecklistTemplate) throws ApiException { + ApiResponse localVarResp = createCatalogChecklistTemplateWithHttpInfo(newCatalogChecklistTemplate); + return localVarResp.getData(); + } + + /** + * Creates a catalog checklist template + * Creates a new catalog checklist template + * @param newCatalogChecklistTemplate (required) + * @return ApiResponse<CatalogChecklistTemplateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 ignores user-provided field_key for custom fields -
422 returns 422 when scope_type is missing for Catalog scope_id -
401 responds with unauthorized for invalid token -
+ */ + public ApiResponse createCatalogChecklistTemplateWithHttpInfo(@javax.annotation.Nonnull NewCatalogChecklistTemplate newCatalogChecklistTemplate) throws ApiException { + okhttp3.Call localVarCall = createCatalogChecklistTemplateValidateBeforeCall(newCatalogChecklistTemplate, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Creates a catalog checklist template (asynchronously) + * Creates a new catalog checklist template + * @param newCatalogChecklistTemplate (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 ignores user-provided field_key for custom fields -
422 returns 422 when scope_type is missing for Catalog scope_id -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createCatalogChecklistTemplateAsync(@javax.annotation.Nonnull NewCatalogChecklistTemplate newCatalogChecklistTemplate, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createCatalogChecklistTemplateValidateBeforeCall(newCatalogChecklistTemplate, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCatalogChecklistTemplate + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template deleted -
404 catalog checklist template not found -
+ */ + public okhttp3.Call deleteCatalogChecklistTemplateCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_checklist_templates/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCatalogChecklistTemplateValidateBeforeCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteCatalogChecklistTemplate(Async)"); + } + + return deleteCatalogChecklistTemplateCall(id, _callback); + + } + + /** + * Delete a catalog checklist template + * Delete a specific catalog checklist template by id + * @param id (required) + * @return CatalogChecklistTemplateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template deleted -
404 catalog checklist template not found -
+ */ + public CatalogChecklistTemplateResponse deleteCatalogChecklistTemplate(@javax.annotation.Nonnull GetAlertFieldIdParameter id) throws ApiException { + ApiResponse localVarResp = deleteCatalogChecklistTemplateWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Delete a catalog checklist template + * Delete a specific catalog checklist template by id + * @param id (required) + * @return ApiResponse<CatalogChecklistTemplateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template deleted -
404 catalog checklist template not found -
+ */ + public ApiResponse deleteCatalogChecklistTemplateWithHttpInfo(@javax.annotation.Nonnull GetAlertFieldIdParameter id) throws ApiException { + okhttp3.Call localVarCall = deleteCatalogChecklistTemplateValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete a catalog checklist template (asynchronously) + * Delete a specific catalog checklist template by id + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template deleted -
404 catalog checklist template not found -
+ */ + public okhttp3.Call deleteCatalogChecklistTemplateAsync(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCatalogChecklistTemplateValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCatalogChecklistTemplate + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template found by slug -
404 resource not found for another team -
+ */ + public okhttp3.Call getCatalogChecklistTemplateCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_checklist_templates/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCatalogChecklistTemplateValidateBeforeCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getCatalogChecklistTemplate(Async)"); + } + + return getCatalogChecklistTemplateCall(id, _callback); + + } + + /** + * Retrieves a catalog checklist template + * Retrieves a specific catalog checklist template by id + * @param id (required) + * @return CatalogChecklistTemplateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template found by slug -
404 resource not found for another team -
+ */ + public CatalogChecklistTemplateResponse getCatalogChecklistTemplate(@javax.annotation.Nonnull GetAlertFieldIdParameter id) throws ApiException { + ApiResponse localVarResp = getCatalogChecklistTemplateWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Retrieves a catalog checklist template + * Retrieves a specific catalog checklist template by id + * @param id (required) + * @return ApiResponse<CatalogChecklistTemplateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template found by slug -
404 resource not found for another team -
+ */ + public ApiResponse getCatalogChecklistTemplateWithHttpInfo(@javax.annotation.Nonnull GetAlertFieldIdParameter id) throws ApiException { + okhttp3.Call localVarCall = getCatalogChecklistTemplateValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves a catalog checklist template (asynchronously) + * Retrieves a specific catalog checklist template by id + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog checklist template found by slug -
404 resource not found for another team -
+ */ + public okhttp3.Call getCatalogChecklistTemplateAsync(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCatalogChecklistTemplateValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listCatalogChecklistTemplates + * @param include comma separated if needed. eg: template_fields,template_owners (optional) + * @param sort comma separated if needed. eg: created_at,updated_at (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterName (optional) + * @param filterSlug (optional) + * @param filterCatalogType (optional) + * @param filterScopeType (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public okhttp3.Call listCatalogChecklistTemplatesCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable String sort, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterCatalogType, @javax.annotation.Nullable String filterScopeType, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_checklist_templates"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[number]", pageNumber)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + if (filterName != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[name]", filterName)); + } + + if (filterSlug != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[slug]", filterSlug)); + } + + if (filterCatalogType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[catalog_type]", filterCatalogType)); + } + + if (filterScopeType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[scope_type]", filterScopeType)); + } + + if (filterCreatedAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gt]", filterCreatedAtGt)); + } + + if (filterCreatedAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gte]", filterCreatedAtGte)); + } + + if (filterCreatedAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lt]", filterCreatedAtLt)); + } + + if (filterCreatedAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lte]", filterCreatedAtLte)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCatalogChecklistTemplatesValidateBeforeCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable String sort, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterCatalogType, @javax.annotation.Nullable String filterScopeType, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + return listCatalogChecklistTemplatesCall(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, _callback); + + } + + /** + * List catalog checklist templates + * List catalog checklist templates + * @param include comma separated if needed. eg: template_fields,template_owners (optional) + * @param sort comma separated if needed. eg: created_at,updated_at (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterName (optional) + * @param filterSlug (optional) + * @param filterCatalogType (optional) + * @param filterScopeType (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @return CatalogChecklistTemplateList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public CatalogChecklistTemplateList listCatalogChecklistTemplates(@javax.annotation.Nullable String include, @javax.annotation.Nullable String sort, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterCatalogType, @javax.annotation.Nullable String filterScopeType, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte) throws ApiException { + ApiResponse localVarResp = listCatalogChecklistTemplatesWithHttpInfo(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + return localVarResp.getData(); + } + + /** + * List catalog checklist templates + * List catalog checklist templates + * @param include comma separated if needed. eg: template_fields,template_owners (optional) + * @param sort comma separated if needed. eg: created_at,updated_at (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterName (optional) + * @param filterSlug (optional) + * @param filterCatalogType (optional) + * @param filterScopeType (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @return ApiResponse<CatalogChecklistTemplateList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public ApiResponse listCatalogChecklistTemplatesWithHttpInfo(@javax.annotation.Nullable String include, @javax.annotation.Nullable String sort, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterCatalogType, @javax.annotation.Nullable String filterScopeType, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte) throws ApiException { + okhttp3.Call localVarCall = listCatalogChecklistTemplatesValidateBeforeCall(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List catalog checklist templates (asynchronously) + * List catalog checklist templates + * @param include comma separated if needed. eg: template_fields,template_owners (optional) + * @param sort comma separated if needed. eg: created_at,updated_at (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterName (optional) + * @param filterSlug (optional) + * @param filterCatalogType (optional) + * @param filterScopeType (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public okhttp3.Call listCatalogChecklistTemplatesAsync(@javax.annotation.Nullable String include, @javax.annotation.Nullable String sort, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterCatalogType, @javax.annotation.Nullable String filterScopeType, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCatalogChecklistTemplatesValidateBeforeCall(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for triggerCatalogChecklistTemplate + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
202 audit triggered -
404 resource not found for another team -
+ */ + public okhttp3.Call triggerCatalogChecklistTemplateCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_checklist_templates/{id}/trigger" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call triggerCatalogChecklistTemplateValidateBeforeCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling triggerCatalogChecklistTemplate(Async)"); + } + + return triggerCatalogChecklistTemplateCall(id, _callback); + + } + + /** + * Trigger an audit for a catalog checklist template + * Triggers an audit for all applicable entities of the checklist template + * @param id (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
202 audit triggered -
404 resource not found for another team -
+ */ + public void triggerCatalogChecklistTemplate(@javax.annotation.Nonnull GetAlertFieldIdParameter id) throws ApiException { + triggerCatalogChecklistTemplateWithHttpInfo(id); + } + + /** + * Trigger an audit for a catalog checklist template + * Triggers an audit for all applicable entities of the checklist template + * @param id (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
202 audit triggered -
404 resource not found for another team -
+ */ + public ApiResponse triggerCatalogChecklistTemplateWithHttpInfo(@javax.annotation.Nonnull GetAlertFieldIdParameter id) throws ApiException { + okhttp3.Call localVarCall = triggerCatalogChecklistTemplateValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Trigger an audit for a catalog checklist template (asynchronously) + * Triggers an audit for all applicable entities of the checklist template + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
202 audit triggered -
404 resource not found for another team -
+ */ + public okhttp3.Call triggerCatalogChecklistTemplateAsync(@javax.annotation.Nonnull GetAlertFieldIdParameter id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = triggerCatalogChecklistTemplateValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateCatalogChecklistTemplate + * @param id (required) + * @param updateCatalogChecklistTemplate (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 ignores user-provided field_key for custom fields on update -
422 rejects duplicate custom fields on update -
+ */ + public okhttp3.Call updateCatalogChecklistTemplateCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, @javax.annotation.Nonnull UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateCatalogChecklistTemplate; + + // create path and map variables + String localVarPath = "/v1/catalog_checklist_templates/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCatalogChecklistTemplateValidateBeforeCall(@javax.annotation.Nonnull GetAlertFieldIdParameter id, @javax.annotation.Nonnull UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateCatalogChecklistTemplate(Async)"); + } + + // verify the required parameter 'updateCatalogChecklistTemplate' is set + if (updateCatalogChecklistTemplate == null) { + throw new ApiException("Missing the required parameter 'updateCatalogChecklistTemplate' when calling updateCatalogChecklistTemplate(Async)"); + } + + return updateCatalogChecklistTemplateCall(id, updateCatalogChecklistTemplate, _callback); + + } + + /** + * Update a catalog checklist template + * Update a specific catalog checklist template by id + * @param id (required) + * @param updateCatalogChecklistTemplate (required) + * @return CatalogChecklistTemplateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 ignores user-provided field_key for custom fields on update -
422 rejects duplicate custom fields on update -
+ */ + public CatalogChecklistTemplateResponse updateCatalogChecklistTemplate(@javax.annotation.Nonnull GetAlertFieldIdParameter id, @javax.annotation.Nonnull UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate) throws ApiException { + ApiResponse localVarResp = updateCatalogChecklistTemplateWithHttpInfo(id, updateCatalogChecklistTemplate); + return localVarResp.getData(); + } + + /** + * Update a catalog checklist template + * Update a specific catalog checklist template by id + * @param id (required) + * @param updateCatalogChecklistTemplate (required) + * @return ApiResponse<CatalogChecklistTemplateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 ignores user-provided field_key for custom fields on update -
422 rejects duplicate custom fields on update -
+ */ + public ApiResponse updateCatalogChecklistTemplateWithHttpInfo(@javax.annotation.Nonnull GetAlertFieldIdParameter id, @javax.annotation.Nonnull UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate) throws ApiException { + okhttp3.Call localVarCall = updateCatalogChecklistTemplateValidateBeforeCall(id, updateCatalogChecklistTemplate, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a catalog checklist template (asynchronously) + * Update a specific catalog checklist template by id + * @param id (required) + * @param updateCatalogChecklistTemplate (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 ignores user-provided field_key for custom fields on update -
422 rejects duplicate custom fields on update -
+ */ + public okhttp3.Call updateCatalogChecklistTemplateAsync(@javax.annotation.Nonnull GetAlertFieldIdParameter id, @javax.annotation.Nonnull UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCatalogChecklistTemplateValidateBeforeCall(id, updateCatalogChecklistTemplate, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/CatalogEntityChecklistsApi.java b/src/main/java/com/rootly/client/api/CatalogEntityChecklistsApi.java new file mode 100644 index 00000000..70c7bf09 --- /dev/null +++ b/src/main/java/com/rootly/client/api/CatalogEntityChecklistsApi.java @@ -0,0 +1,406 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.CatalogEntityChecklistList; +import com.rootly.client.model.CatalogEntityChecklistResponse; +import com.rootly.client.model.ErrorsList; +import java.util.UUID; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CatalogEntityChecklistsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CatalogEntityChecklistsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CatalogEntityChecklistsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for getCatalogEntityChecklist + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog entity checklist found -
404 resource not found for another team -
+ */ + public okhttp3.Call getCatalogEntityChecklistCall(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_entity_checklists/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCatalogEntityChecklistValidateBeforeCall(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getCatalogEntityChecklist(Async)"); + } + + return getCatalogEntityChecklistCall(id, _callback); + + } + + /** + * Retrieves a catalog entity checklist + * Retrieves a specific catalog entity checklist by id + * @param id (required) + * @return CatalogEntityChecklistResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog entity checklist found -
404 resource not found for another team -
+ */ + public CatalogEntityChecklistResponse getCatalogEntityChecklist(@javax.annotation.Nonnull UUID id) throws ApiException { + ApiResponse localVarResp = getCatalogEntityChecklistWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Retrieves a catalog entity checklist + * Retrieves a specific catalog entity checklist by id + * @param id (required) + * @return ApiResponse<CatalogEntityChecklistResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog entity checklist found -
404 resource not found for another team -
+ */ + public ApiResponse getCatalogEntityChecklistWithHttpInfo(@javax.annotation.Nonnull UUID id) throws ApiException { + okhttp3.Call localVarCall = getCatalogEntityChecklistValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves a catalog entity checklist (asynchronously) + * Retrieves a specific catalog entity checklist by id + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 catalog entity checklist found -
404 resource not found for another team -
+ */ + public okhttp3.Call getCatalogEntityChecklistAsync(@javax.annotation.Nonnull UUID id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCatalogEntityChecklistValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listCatalogEntityChecklists + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCatalogChecklistTemplateId (optional) + * @param filterAuditableType (optional) + * @param filterAuditableId (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public okhttp3.Call listCatalogEntityChecklistsCall(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCatalogChecklistTemplateId, @javax.annotation.Nullable String filterAuditableType, @javax.annotation.Nullable String filterAuditableId, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_entity_checklists"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[number]", pageNumber)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + if (filterStatus != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[status]", filterStatus)); + } + + if (filterCatalogChecklistTemplateId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[catalog_checklist_template_id]", filterCatalogChecklistTemplateId)); + } + + if (filterAuditableType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[auditable_type]", filterAuditableType)); + } + + if (filterAuditableId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[auditable_id]", filterAuditableId)); + } + + if (filterCreatedAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gt]", filterCreatedAtGt)); + } + + if (filterCreatedAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gte]", filterCreatedAtGte)); + } + + if (filterCreatedAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lt]", filterCreatedAtLt)); + } + + if (filterCreatedAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lte]", filterCreatedAtLte)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCatalogEntityChecklistsValidateBeforeCall(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCatalogChecklistTemplateId, @javax.annotation.Nullable String filterAuditableType, @javax.annotation.Nullable String filterAuditableId, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + return listCatalogEntityChecklistsCall(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, _callback); + + } + + /** + * List catalog entity checklists + * List catalog entity checklists + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCatalogChecklistTemplateId (optional) + * @param filterAuditableType (optional) + * @param filterAuditableId (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @return CatalogEntityChecklistList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public CatalogEntityChecklistList listCatalogEntityChecklists(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCatalogChecklistTemplateId, @javax.annotation.Nullable String filterAuditableType, @javax.annotation.Nullable String filterAuditableId, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte) throws ApiException { + ApiResponse localVarResp = listCatalogEntityChecklistsWithHttpInfo(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + return localVarResp.getData(); + } + + /** + * List catalog entity checklists + * List catalog entity checklists + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCatalogChecklistTemplateId (optional) + * @param filterAuditableType (optional) + * @param filterAuditableId (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @return ApiResponse<CatalogEntityChecklistList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public ApiResponse listCatalogEntityChecklistsWithHttpInfo(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCatalogChecklistTemplateId, @javax.annotation.Nullable String filterAuditableType, @javax.annotation.Nullable String filterAuditableId, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte) throws ApiException { + okhttp3.Call localVarCall = listCatalogEntityChecklistsValidateBeforeCall(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List catalog entity checklists (asynchronously) + * List catalog entity checklists + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCatalogChecklistTemplateId (optional) + * @param filterAuditableType (optional) + * @param filterAuditableId (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 returns empty list for another team -
+ */ + public okhttp3.Call listCatalogEntityChecklistsAsync(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCatalogChecklistTemplateId, @javax.annotation.Nullable String filterAuditableType, @javax.annotation.Nullable String filterAuditableId, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCatalogEntityChecklistsValidateBeforeCall(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/CatalogPropertiesApi.java b/src/main/java/com/rootly/client/api/CatalogPropertiesApi.java new file mode 100644 index 00000000..dbaee35b --- /dev/null +++ b/src/main/java/com/rootly/client/api/CatalogPropertiesApi.java @@ -0,0 +1,706 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.NewCatalogField; +import com.rootly.client.model.UpdateCatalogField; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CatalogPropertiesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CatalogPropertiesApi() { + this(Configuration.getDefaultApiClient()); + } + + public CatalogPropertiesApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createCatalogProperty + * @param catalogId (required) + * @param newCatalogField (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
201 catalog_property created -
+ */ + public okhttp3.Call createCatalogPropertyCall(@javax.annotation.Nonnull String catalogId, @javax.annotation.Nonnull NewCatalogField newCatalogField, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newCatalogField; + + // create path and map variables + String localVarPath = "/v1/catalogs/{catalog_id}/properties" + .replace("{" + "catalog_id" + "}", localVarApiClient.escapeString(catalogId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCatalogPropertyValidateBeforeCall(@javax.annotation.Nonnull String catalogId, @javax.annotation.Nonnull NewCatalogField newCatalogField, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'catalogId' is set + if (catalogId == null) { + throw new ApiException("Missing the required parameter 'catalogId' when calling createCatalogProperty(Async)"); + } + + // verify the required parameter 'newCatalogField' is set + if (newCatalogField == null) { + throw new ApiException("Missing the required parameter 'newCatalogField' when calling createCatalogProperty(Async)"); + } + + return createCatalogPropertyCall(catalogId, newCatalogField, _callback); + + } + + /** + * Creates a Catalog Property (alias for field) + * Creates a new Catalog Property - returns catalog_properties type + * @param catalogId (required) + * @param newCatalogField (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
201 catalog_property created -
+ */ + public void createCatalogProperty(@javax.annotation.Nonnull String catalogId, @javax.annotation.Nonnull NewCatalogField newCatalogField) throws ApiException { + createCatalogPropertyWithHttpInfo(catalogId, newCatalogField); + } + + /** + * Creates a Catalog Property (alias for field) + * Creates a new Catalog Property - returns catalog_properties type + * @param catalogId (required) + * @param newCatalogField (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
201 catalog_property created -
+ */ + public ApiResponse createCatalogPropertyWithHttpInfo(@javax.annotation.Nonnull String catalogId, @javax.annotation.Nonnull NewCatalogField newCatalogField) throws ApiException { + okhttp3.Call localVarCall = createCatalogPropertyValidateBeforeCall(catalogId, newCatalogField, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Creates a Catalog Property (alias for field) (asynchronously) + * Creates a new Catalog Property - returns catalog_properties type + * @param catalogId (required) + * @param newCatalogField (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
201 catalog_property created -
+ */ + public okhttp3.Call createCatalogPropertyAsync(@javax.annotation.Nonnull String catalogId, @javax.annotation.Nonnull NewCatalogField newCatalogField, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createCatalogPropertyValidateBeforeCall(catalogId, newCatalogField, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteCatalogProperty + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property deleted -
+ */ + public okhttp3.Call deleteCatalogPropertyCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_properties/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCatalogPropertyValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteCatalogProperty(Async)"); + } + + return deleteCatalogPropertyCall(id, _callback); + + } + + /** + * Delete a catalog_property + * Delete a specific catalog_property by id - returns catalog_properties type + * @param id (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property deleted -
+ */ + public void deleteCatalogProperty(@javax.annotation.Nonnull String id) throws ApiException { + deleteCatalogPropertyWithHttpInfo(id); + } + + /** + * Delete a catalog_property + * Delete a specific catalog_property by id - returns catalog_properties type + * @param id (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property deleted -
+ */ + public ApiResponse deleteCatalogPropertyWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = deleteCatalogPropertyValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a catalog_property (asynchronously) + * Delete a specific catalog_property by id - returns catalog_properties type + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property deleted -
+ */ + public okhttp3.Call deleteCatalogPropertyAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCatalogPropertyValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getCatalogProperty + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property found -
+ */ + public okhttp3.Call getCatalogPropertyCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalog_properties/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCatalogPropertyValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getCatalogProperty(Async)"); + } + + return getCatalogPropertyCall(id, _callback); + + } + + /** + * Retrieves a Catalog Property (alias for field) + * Retrieves a specific Catalog Property by id - returns catalog_properties type + * @param id (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property found -
+ */ + public void getCatalogProperty(@javax.annotation.Nonnull String id) throws ApiException { + getCatalogPropertyWithHttpInfo(id); + } + + /** + * Retrieves a Catalog Property (alias for field) + * Retrieves a specific Catalog Property by id - returns catalog_properties type + * @param id (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property found -
+ */ + public ApiResponse getCatalogPropertyWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = getCatalogPropertyValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Retrieves a Catalog Property (alias for field) (asynchronously) + * Retrieves a specific Catalog Property by id - returns catalog_properties type + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property found -
+ */ + public okhttp3.Call getCatalogPropertyAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getCatalogPropertyValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for listCatalogProperties + * @param catalogId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success with catalog_properties type -
+ */ + public okhttp3.Call listCatalogPropertiesCall(@javax.annotation.Nonnull String catalogId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/catalogs/{catalog_id}/properties" + .replace("{" + "catalog_id" + "}", localVarApiClient.escapeString(catalogId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCatalogPropertiesValidateBeforeCall(@javax.annotation.Nonnull String catalogId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'catalogId' is set + if (catalogId == null) { + throw new ApiException("Missing the required parameter 'catalogId' when calling listCatalogProperties(Async)"); + } + + return listCatalogPropertiesCall(catalogId, _callback); + + } + + /** + * List Catalog Properties (alias for fields) + * List Catalog Properties - returns catalog_properties type + * @param catalogId (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success with catalog_properties type -
+ */ + public void listCatalogProperties(@javax.annotation.Nonnull String catalogId) throws ApiException { + listCatalogPropertiesWithHttpInfo(catalogId); + } + + /** + * List Catalog Properties (alias for fields) + * List Catalog Properties - returns catalog_properties type + * @param catalogId (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success with catalog_properties type -
+ */ + public ApiResponse listCatalogPropertiesWithHttpInfo(@javax.annotation.Nonnull String catalogId) throws ApiException { + okhttp3.Call localVarCall = listCatalogPropertiesValidateBeforeCall(catalogId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * List Catalog Properties (alias for fields) (asynchronously) + * List Catalog Properties - returns catalog_properties type + * @param catalogId (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success with catalog_properties type -
+ */ + public okhttp3.Call listCatalogPropertiesAsync(@javax.annotation.Nonnull String catalogId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listCatalogPropertiesValidateBeforeCall(catalogId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateCatalogProperty + * @param id (required) + * @param updateCatalogField (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property updated -
+ */ + public okhttp3.Call updateCatalogPropertyCall(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateCatalogField updateCatalogField, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateCatalogField; + + // create path and map variables + String localVarPath = "/v1/catalog_properties/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCatalogPropertyValidateBeforeCall(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateCatalogField updateCatalogField, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateCatalogProperty(Async)"); + } + + // verify the required parameter 'updateCatalogField' is set + if (updateCatalogField == null) { + throw new ApiException("Missing the required parameter 'updateCatalogField' when calling updateCatalogProperty(Async)"); + } + + return updateCatalogPropertyCall(id, updateCatalogField, _callback); + + } + + /** + * Update a catalog_property (alias for field) + * Update a specific catalog_property by id - returns catalog_properties type + * @param id (required) + * @param updateCatalogField (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property updated -
+ */ + public void updateCatalogProperty(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateCatalogField updateCatalogField) throws ApiException { + updateCatalogPropertyWithHttpInfo(id, updateCatalogField); + } + + /** + * Update a catalog_property (alias for field) + * Update a specific catalog_property by id - returns catalog_properties type + * @param id (required) + * @param updateCatalogField (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property updated -
+ */ + public ApiResponse updateCatalogPropertyWithHttpInfo(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateCatalogField updateCatalogField) throws ApiException { + okhttp3.Call localVarCall = updateCatalogPropertyValidateBeforeCall(id, updateCatalogField, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Update a catalog_property (alias for field) (asynchronously) + * Update a specific catalog_property by id - returns catalog_properties type + * @param id (required) + * @param updateCatalogField (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 catalog_property updated -
+ */ + public okhttp3.Call updateCatalogPropertyAsync(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateCatalogField updateCatalogField, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCatalogPropertyValidateBeforeCall(id, updateCatalogField, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/MeetingRecordingsApi.java b/src/main/java/com/rootly/client/api/MeetingRecordingsApi.java new file mode 100644 index 00000000..e722c428 --- /dev/null +++ b/src/main/java/com/rootly/client/api/MeetingRecordingsApi.java @@ -0,0 +1,1238 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.MeetingRecordingList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MeetingRecordingsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MeetingRecordingsApi() { + this(Configuration.getDefaultApiClient()); + } + + public MeetingRecordingsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createMeetingRecording + * @param incidentId Incident UUID (required) + * @param platform Meeting platform (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 recording session created -
422 validation error (e.g. bot already active) -
+ */ + public okhttp3.Call createMeetingRecordingCall(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable String platform, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/incidents/{incident_id}/meeting_recordings" + .replace("{" + "incident_id" + "}", localVarApiClient.escapeString(incidentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (platform != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("platform", platform)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable String platform, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + throw new ApiException("Missing the required parameter 'incidentId' when calling createMeetingRecording(Async)"); + } + + return createMeetingRecordingCall(incidentId, platform, _callback); + + } + + /** + * Create meeting recording + * Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, a new bot is invited (session 1). If previous sessions exist, a new session is created (re-invite). The bot joins the meeting, records audio/video, and generates a transcript when the session ends. + * @param incidentId Incident UUID (required) + * @param platform Meeting platform (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 recording session created -
422 validation error (e.g. bot already active) -
+ */ + public void createMeetingRecording(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable String platform) throws ApiException { + createMeetingRecordingWithHttpInfo(incidentId, platform); + } + + /** + * Create meeting recording + * Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, a new bot is invited (session 1). If previous sessions exist, a new session is created (re-invite). The bot joins the meeting, records audio/video, and generates a transcript when the session ends. + * @param incidentId Incident UUID (required) + * @param platform Meeting platform (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 recording session created -
422 validation error (e.g. bot already active) -
+ */ + public ApiResponse createMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable String platform) throws ApiException { + okhttp3.Call localVarCall = createMeetingRecordingValidateBeforeCall(incidentId, platform, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Create meeting recording (asynchronously) + * Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, a new bot is invited (session 1). If previous sessions exist, a new session is created (re-invite). The bot joins the meeting, records audio/video, and generates a transcript when the session ends. + * @param incidentId Incident UUID (required) + * @param platform Meeting platform (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
201 recording session created -
422 validation error (e.g. bot already active) -
+ */ + public okhttp3.Call createMeetingRecordingAsync(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable String platform, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createMeetingRecordingValidateBeforeCall(incidentId, platform, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteMeetingRecording + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording deleted -
422 cannot delete active recording -
+ */ + public okhttp3.Call deleteMeetingRecordingCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteMeetingRecording(Async)"); + } + + return deleteMeetingRecordingCall(id, _callback); + + } + + /** + * Delete a meeting recording + * Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings (pending, recording, paused) must be stopped first. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording deleted -
422 cannot delete active recording -
+ */ + public void deleteMeetingRecording(@javax.annotation.Nonnull String id) throws ApiException { + deleteMeetingRecordingWithHttpInfo(id); + } + + /** + * Delete a meeting recording + * Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings (pending, recording, paused) must be stopped first. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording deleted -
422 cannot delete active recording -
+ */ + public ApiResponse deleteMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = deleteMeetingRecordingValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a meeting recording (asynchronously) + * Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings (pending, recording, paused) must be stopped first. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording deleted -
422 cannot delete active recording -
+ */ + public okhttp3.Call deleteMeetingRecordingAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteMeetingRecordingValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteMeetingRecordingVideo + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 video deleted -
422 cannot delete video (active recording or no video) -
+ */ + public okhttp3.Call deleteMeetingRecordingVideoCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}/delete_video" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteMeetingRecordingVideoValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteMeetingRecordingVideo(Async)"); + } + + return deleteMeetingRecordingVideoCall(id, _callback); + + } + + /** + * Delete video from a meeting recording + * Delete only the video file from a meeting recording. The transcript, summary, and all metadata are preserved. Only non-active recordings with an attached video can have their video deleted. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 video deleted -
422 cannot delete video (active recording or no video) -
+ */ + public void deleteMeetingRecordingVideo(@javax.annotation.Nonnull String id) throws ApiException { + deleteMeetingRecordingVideoWithHttpInfo(id); + } + + /** + * Delete video from a meeting recording + * Delete only the video file from a meeting recording. The transcript, summary, and all metadata are preserved. Only non-active recordings with an attached video can have their video deleted. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 video deleted -
422 cannot delete video (active recording or no video) -
+ */ + public ApiResponse deleteMeetingRecordingVideoWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = deleteMeetingRecordingVideoValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete video from a meeting recording (asynchronously) + * Delete only the video file from a meeting recording. The transcript, summary, and all metadata are preserved. Only non-active recordings with an attached video can have their video deleted. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 video deleted -
422 cannot delete video (active recording or no video) -
+ */ + public okhttp3.Call deleteMeetingRecordingVideoAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteMeetingRecordingVideoValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getMeetingRecording + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording found -
404 meeting recording not found -
+ */ + public okhttp3.Call getMeetingRecordingCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getMeetingRecording(Async)"); + } + + return getMeetingRecordingCall(id, _callback); + + } + + /** + * Get a meeting recording + * Retrieve a single meeting recording session including its status, duration, speaker count, word count, and transcript summary. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording found -
404 meeting recording not found -
+ */ + public void getMeetingRecording(@javax.annotation.Nonnull String id) throws ApiException { + getMeetingRecordingWithHttpInfo(id); + } + + /** + * Get a meeting recording + * Retrieve a single meeting recording session including its status, duration, speaker count, word count, and transcript summary. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording found -
404 meeting recording not found -
+ */ + public ApiResponse getMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = getMeetingRecordingValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Get a meeting recording (asynchronously) + * Retrieve a single meeting recording session including its status, duration, speaker count, word count, and transcript summary. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recording found -
404 meeting recording not found -
+ */ + public okhttp3.Call getMeetingRecordingAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getMeetingRecordingValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for leaveMeetingRecording + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 bot left the call -
422 bot is not in a call -
+ */ + public okhttp3.Call leaveMeetingRecordingCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}/leave" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call leaveMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling leaveMeetingRecording(Async)"); + } + + return leaveMeetingRecordingCall(id, _callback); + + } + + /** + * Leave a meeting call + * Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the bot. The session will transition to analyzing and then completed once transcript processing finishes. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 bot left the call -
422 bot is not in a call -
+ */ + public void leaveMeetingRecording(@javax.annotation.Nonnull String id) throws ApiException { + leaveMeetingRecordingWithHttpInfo(id); + } + + /** + * Leave a meeting call + * Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the bot. The session will transition to analyzing and then completed once transcript processing finishes. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 bot left the call -
422 bot is not in a call -
+ */ + public ApiResponse leaveMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = leaveMeetingRecordingValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Leave a meeting call (asynchronously) + * Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the bot. The session will transition to analyzing and then completed once transcript processing finishes. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 bot left the call -
422 bot is not in a call -
+ */ + public okhttp3.Call leaveMeetingRecordingAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = leaveMeetingRecordingValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for listMeetingRecordings + * @param incidentId Incident UUID (required) + * @param pageNumber Page number (optional) + * @param pageSize Number of recordings per page (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recordings listed -
404 incident not found -
+ */ + public okhttp3.Call listMeetingRecordingsCall(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/incidents/{incident_id}/meeting_recordings" + .replace("{" + "incident_id" + "}", localVarApiClient.escapeString(incidentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[number]", pageNumber)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listMeetingRecordingsValidateBeforeCall(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + throw new ApiException("Missing the required parameter 'incidentId' when calling listMeetingRecordings(Async)"); + } + + return listMeetingRecordingsCall(incidentId, pageNumber, pageSize, _callback); + + } + + /** + * List meeting recordings + * List all meeting recording sessions for an incident. Returns recordings sorted by session number. Each recording represents one bot session with its own transcript, status, and metadata. + * @param incidentId Incident UUID (required) + * @param pageNumber Page number (optional) + * @param pageSize Number of recordings per page (optional) + * @return MeetingRecordingList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recordings listed -
404 incident not found -
+ */ + public MeetingRecordingList listMeetingRecordings(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize) throws ApiException { + ApiResponse localVarResp = listMeetingRecordingsWithHttpInfo(incidentId, pageNumber, pageSize); + return localVarResp.getData(); + } + + /** + * List meeting recordings + * List all meeting recording sessions for an incident. Returns recordings sorted by session number. Each recording represents one bot session with its own transcript, status, and metadata. + * @param incidentId Incident UUID (required) + * @param pageNumber Page number (optional) + * @param pageSize Number of recordings per page (optional) + * @return ApiResponse<MeetingRecordingList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recordings listed -
404 incident not found -
+ */ + public ApiResponse listMeetingRecordingsWithHttpInfo(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize) throws ApiException { + okhttp3.Call localVarCall = listMeetingRecordingsValidateBeforeCall(incidentId, pageNumber, pageSize, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List meeting recordings (asynchronously) + * List all meeting recording sessions for an incident. Returns recordings sorted by session number. Each recording represents one bot session with its own transcript, status, and metadata. + * @param incidentId Incident UUID (required) + * @param pageNumber Page number (optional) + * @param pageSize Number of recordings per page (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 meeting recordings listed -
404 incident not found -
+ */ + public okhttp3.Call listMeetingRecordingsAsync(@javax.annotation.Nonnull String incidentId, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listMeetingRecordingsValidateBeforeCall(incidentId, pageNumber, pageSize, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for pauseMeetingRecording + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording paused -
422 recording is not active -
+ */ + public okhttp3.Call pauseMeetingRecordingCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}/pause" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pauseMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling pauseMeetingRecording(Async)"); + } + + return pauseMeetingRecordingCall(id, _callback); + + } + + /** + * Pause a meeting recording + * Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. Use the resume endpoint to continue recording. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording paused -
422 recording is not active -
+ */ + public void pauseMeetingRecording(@javax.annotation.Nonnull String id) throws ApiException { + pauseMeetingRecordingWithHttpInfo(id); + } + + /** + * Pause a meeting recording + * Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. Use the resume endpoint to continue recording. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording paused -
422 recording is not active -
+ */ + public ApiResponse pauseMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = pauseMeetingRecordingValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Pause a meeting recording (asynchronously) + * Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. Use the resume endpoint to continue recording. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording paused -
422 recording is not active -
+ */ + public okhttp3.Call pauseMeetingRecordingAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = pauseMeetingRecordingValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for resumeMeetingRecording + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording resumed -
422 recording is not paused -
+ */ + public okhttp3.Call resumeMeetingRecordingCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}/resume" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resumeMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling resumeMeetingRecording(Async)"); + } + + return resumeMeetingRecordingCall(id, _callback); + + } + + /** + * Resume a meeting recording + * Resume a paused recording session. The bot continues capturing audio/video from the meeting. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording resumed -
422 recording is not paused -
+ */ + public void resumeMeetingRecording(@javax.annotation.Nonnull String id) throws ApiException { + resumeMeetingRecordingWithHttpInfo(id); + } + + /** + * Resume a meeting recording + * Resume a paused recording session. The bot continues capturing audio/video from the meeting. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording resumed -
422 recording is not paused -
+ */ + public ApiResponse resumeMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = resumeMeetingRecordingValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Resume a meeting recording (asynchronously) + * Resume a paused recording session. The bot continues capturing audio/video from the meeting. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording resumed -
422 recording is not paused -
+ */ + public okhttp3.Call resumeMeetingRecordingAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = resumeMeetingRecordingValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for stopMeetingRecording + * @param id Meeting Recording UUID (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording stopped -
422 recording cannot be stopped -
+ */ + public okhttp3.Call stopMeetingRecordingCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/meeting_recordings/{id}/stop" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call stopMeetingRecordingValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling stopMeetingRecording(Async)"); + } + + return stopMeetingRecordingCall(id, _callback); + + } + + /** + * Stop a meeting recording + * Stop an active or paused recording. The bot finishes processing, generates a transcript, and the session status transitions to completed. This is irreversible — to record again, create a new session. + * @param id Meeting Recording UUID (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording stopped -
422 recording cannot be stopped -
+ */ + public void stopMeetingRecording(@javax.annotation.Nonnull String id) throws ApiException { + stopMeetingRecordingWithHttpInfo(id); + } + + /** + * Stop a meeting recording + * Stop an active or paused recording. The bot finishes processing, generates a transcript, and the session status transitions to completed. This is irreversible — to record again, create a new session. + * @param id Meeting Recording UUID (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording stopped -
422 recording cannot be stopped -
+ */ + public ApiResponse stopMeetingRecordingWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = stopMeetingRecordingValidateBeforeCall(id, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Stop a meeting recording (asynchronously) + * Stop an active or paused recording. The bot finishes processing, generates a transcript, and the session status transitions to completed. This is irreversible — to record again, create a new session. + * @param id Meeting Recording UUID (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 recording stopped -
422 recording cannot be stopped -
+ */ + public okhttp3.Call stopMeetingRecordingAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = stopMeetingRecordingValidateBeforeCall(id, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/OnCallPayReportsApi.java b/src/main/java/com/rootly/client/api/OnCallPayReportsApi.java new file mode 100644 index 00000000..3265a0fd --- /dev/null +++ b/src/main/java/com/rootly/client/api/OnCallPayReportsApi.java @@ -0,0 +1,810 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.NewOnCallPayReport; +import com.rootly.client.model.OnCallPayReportList; +import com.rootly.client.model.OnCallPayReportResponse; +import com.rootly.client.model.UpdateOnCallPayReport; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OnCallPayReportsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OnCallPayReportsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OnCallPayReportsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createOnCallPayReport + * @param newOnCallPayReport (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 on_call_pay_report created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createOnCallPayReportCall(@javax.annotation.Nonnull NewOnCallPayReport newOnCallPayReport, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newOnCallPayReport; + + // create path and map variables + String localVarPath = "/v1/on_call_pay_reports"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOnCallPayReportValidateBeforeCall(@javax.annotation.Nonnull NewOnCallPayReport newOnCallPayReport, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'newOnCallPayReport' is set + if (newOnCallPayReport == null) { + throw new ApiException("Missing the required parameter 'newOnCallPayReport' when calling createOnCallPayReport(Async)"); + } + + return createOnCallPayReportCall(newOnCallPayReport, _callback); + + } + + /** + * Creates an On-Call Pay Report + * Generates a new on-call pay report for the given date range. The report is generated asynchronously. + * @param newOnCallPayReport (required) + * @return OnCallPayReportResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 on_call_pay_report created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public OnCallPayReportResponse createOnCallPayReport(@javax.annotation.Nonnull NewOnCallPayReport newOnCallPayReport) throws ApiException { + ApiResponse localVarResp = createOnCallPayReportWithHttpInfo(newOnCallPayReport); + return localVarResp.getData(); + } + + /** + * Creates an On-Call Pay Report + * Generates a new on-call pay report for the given date range. The report is generated asynchronously. + * @param newOnCallPayReport (required) + * @return ApiResponse<OnCallPayReportResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 on_call_pay_report created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public ApiResponse createOnCallPayReportWithHttpInfo(@javax.annotation.Nonnull NewOnCallPayReport newOnCallPayReport) throws ApiException { + okhttp3.Call localVarCall = createOnCallPayReportValidateBeforeCall(newOnCallPayReport, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Creates an On-Call Pay Report (asynchronously) + * Generates a new on-call pay report for the given date range. The report is generated asynchronously. + * @param newOnCallPayReport (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 on_call_pay_report created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createOnCallPayReportAsync(@javax.annotation.Nonnull NewOnCallPayReport newOnCallPayReport, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createOnCallPayReportValidateBeforeCall(newOnCallPayReport, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOnCallPayReport + * @param id (required) + * @param include (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report found -
404 resource not found for different team -
+ */ + public okhttp3.Call getOnCallPayReportCall(@javax.annotation.Nonnull String id, @javax.annotation.Nullable String include, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/on_call_pay_reports/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOnCallPayReportValidateBeforeCall(@javax.annotation.Nonnull String id, @javax.annotation.Nullable String include, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getOnCallPayReport(Async)"); + } + + return getOnCallPayReportCall(id, include, _callback); + + } + + /** + * Retrieves an On-Call Pay Report + * Retrieves a specific on-call pay report by id + * @param id (required) + * @param include (optional) + * @return OnCallPayReportResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report found -
404 resource not found for different team -
+ */ + public OnCallPayReportResponse getOnCallPayReport(@javax.annotation.Nonnull String id, @javax.annotation.Nullable String include) throws ApiException { + ApiResponse localVarResp = getOnCallPayReportWithHttpInfo(id, include); + return localVarResp.getData(); + } + + /** + * Retrieves an On-Call Pay Report + * Retrieves a specific on-call pay report by id + * @param id (required) + * @param include (optional) + * @return ApiResponse<OnCallPayReportResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report found -
404 resource not found for different team -
+ */ + public ApiResponse getOnCallPayReportWithHttpInfo(@javax.annotation.Nonnull String id, @javax.annotation.Nullable String include) throws ApiException { + okhttp3.Call localVarCall = getOnCallPayReportValidateBeforeCall(id, include, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an On-Call Pay Report (asynchronously) + * Retrieves a specific on-call pay report by id + * @param id (required) + * @param include (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report found -
404 resource not found for different team -
+ */ + public okhttp3.Call getOnCallPayReportAsync(@javax.annotation.Nonnull String id, @javax.annotation.Nullable String include, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getOnCallPayReportValidateBeforeCall(id, include, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listOnCallPayReports + * @param include (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public okhttp3.Call listOnCallPayReportsCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/on_call_pay_reports"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[number]", pageNumber)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + if (filterStatus != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[status]", filterStatus)); + } + + if (filterCreatedAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gt]", filterCreatedAtGt)); + } + + if (filterCreatedAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gte]", filterCreatedAtGte)); + } + + if (filterCreatedAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lt]", filterCreatedAtLt)); + } + + if (filterCreatedAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lte]", filterCreatedAtLte)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOnCallPayReportsValidateBeforeCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + return listOnCallPayReportsCall(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, _callback); + + } + + /** + * List On-Call Pay Reports + * List on-call pay reports + * @param include (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @return OnCallPayReportList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public OnCallPayReportList listOnCallPayReports(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte) throws ApiException { + ApiResponse localVarResp = listOnCallPayReportsWithHttpInfo(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + return localVarResp.getData(); + } + + /** + * List On-Call Pay Reports + * List on-call pay reports + * @param include (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @return ApiResponse<OnCallPayReportList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public ApiResponse listOnCallPayReportsWithHttpInfo(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte) throws ApiException { + okhttp3.Call localVarCall = listOnCallPayReportsValidateBeforeCall(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List On-Call Pay Reports (asynchronously) + * List on-call pay reports + * @param include (optional) + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterStatus (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public okhttp3.Call listOnCallPayReportsAsync(@javax.annotation.Nullable String include, @javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterStatus, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listOnCallPayReportsValidateBeforeCall(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for regenerateOnCallPayReport + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report regeneration triggered -
404 on_call_pay_report not found -
+ */ + public okhttp3.Call regenerateOnCallPayReportCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/on_call_pay_reports/{id}/regenerate" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call regenerateOnCallPayReportValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling regenerateOnCallPayReport(Async)"); + } + + return regenerateOnCallPayReportCall(id, _callback); + + } + + /** + * Regenerate an On-Call Pay Report + * Triggers regeneration of an existing on-call pay report. + * @param id (required) + * @return OnCallPayReportResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report regeneration triggered -
404 on_call_pay_report not found -
+ */ + public OnCallPayReportResponse regenerateOnCallPayReport(@javax.annotation.Nonnull String id) throws ApiException { + ApiResponse localVarResp = regenerateOnCallPayReportWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Regenerate an On-Call Pay Report + * Triggers regeneration of an existing on-call pay report. + * @param id (required) + * @return ApiResponse<OnCallPayReportResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report regeneration triggered -
404 on_call_pay_report not found -
+ */ + public ApiResponse regenerateOnCallPayReportWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = regenerateOnCallPayReportValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Regenerate an On-Call Pay Report (asynchronously) + * Triggers regeneration of an existing on-call pay report. + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report regeneration triggered -
404 on_call_pay_report not found -
+ */ + public okhttp3.Call regenerateOnCallPayReportAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = regenerateOnCallPayReportValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateOnCallPayReport + * @param id (required) + * @param updateOnCallPayReport (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report updated -
404 not allowed when flipper disabled -
422 invalid request -
+ */ + public okhttp3.Call updateOnCallPayReportCall(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateOnCallPayReport updateOnCallPayReport, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateOnCallPayReport; + + // create path and map variables + String localVarPath = "/v1/on_call_pay_reports/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateOnCallPayReportValidateBeforeCall(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateOnCallPayReport updateOnCallPayReport, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateOnCallPayReport(Async)"); + } + + // verify the required parameter 'updateOnCallPayReport' is set + if (updateOnCallPayReport == null) { + throw new ApiException("Missing the required parameter 'updateOnCallPayReport' when calling updateOnCallPayReport(Async)"); + } + + return updateOnCallPayReportCall(id, updateOnCallPayReport, _callback); + + } + + /** + * Update an On-Call Pay Report + * Update a specific on-call pay report by id. Triggers report regeneration. + * @param id (required) + * @param updateOnCallPayReport (required) + * @return OnCallPayReportResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report updated -
404 not allowed when flipper disabled -
422 invalid request -
+ */ + public OnCallPayReportResponse updateOnCallPayReport(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateOnCallPayReport updateOnCallPayReport) throws ApiException { + ApiResponse localVarResp = updateOnCallPayReportWithHttpInfo(id, updateOnCallPayReport); + return localVarResp.getData(); + } + + /** + * Update an On-Call Pay Report + * Update a specific on-call pay report by id. Triggers report regeneration. + * @param id (required) + * @param updateOnCallPayReport (required) + * @return ApiResponse<OnCallPayReportResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report updated -
404 not allowed when flipper disabled -
422 invalid request -
+ */ + public ApiResponse updateOnCallPayReportWithHttpInfo(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateOnCallPayReport updateOnCallPayReport) throws ApiException { + okhttp3.Call localVarCall = updateOnCallPayReportValidateBeforeCall(id, updateOnCallPayReport, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an On-Call Pay Report (asynchronously) + * Update a specific on-call pay report by id. Triggers report regeneration. + * @param id (required) + * @param updateOnCallPayReport (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 on_call_pay_report updated -
404 not allowed when flipper disabled -
422 invalid request -
+ */ + public okhttp3.Call updateOnCallPayReportAsync(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateOnCallPayReport updateOnCallPayReport, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateOnCallPayReportValidateBeforeCall(id, updateOnCallPayReport, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/OnCallsApi.java b/src/main/java/com/rootly/client/api/OnCallsApi.java new file mode 100644 index 00000000..b2b5da2a --- /dev/null +++ b/src/main/java/com/rootly/client/api/OnCallsApi.java @@ -0,0 +1,284 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.ErrorsList; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OnCallsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OnCallsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OnCallsApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for listOncalls + * @param include comma separated if needed. eg: user,schedule (optional) + * @param since Start of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to current time. (optional) + * @param until End of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to 'since' time. (optional) + * @param earliest When true, returns only the first on-call user per escalation policy level (optional) + * @param timeZone Timezone for response times (e.g., America/New_York). Defaults to UTC. (optional) + * @param filterEscalationPolicyIds Comma-separated escalation policy IDs (optional) + * @param filterScheduleIds Comma-separated schedule IDs (optional) + * @param filterUserIds Comma-separated user IDs (optional) + * @param filterServiceIds Comma-separated service IDs (optional) + * @param filterGroupIds Comma-separated group IDs (teams) (optional) + * @param filterNotificationTypes Comma-separated notification types to include. One or both of: audible, quiet. When present, oncalls are returned from every non-deferral escalation path whose notification_type is in the filter, sorted audible-first. When absent, only the default path's oncalls are returned (existing behavior). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 success -
404 resource not found when alerting is disabled -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call listOncallsCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable String since, @javax.annotation.Nullable String until, @javax.annotation.Nullable Boolean earliest, @javax.annotation.Nullable String timeZone, @javax.annotation.Nullable String filterEscalationPolicyIds, @javax.annotation.Nullable String filterScheduleIds, @javax.annotation.Nullable String filterUserIds, @javax.annotation.Nullable String filterServiceIds, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterNotificationTypes, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/oncalls"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (include != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("include", include)); + } + + if (since != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("since", since)); + } + + if (until != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("until", until)); + } + + if (earliest != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("earliest", earliest)); + } + + if (timeZone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("time_zone", timeZone)); + } + + if (filterEscalationPolicyIds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[escalation_policy_ids]", filterEscalationPolicyIds)); + } + + if (filterScheduleIds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[schedule_ids]", filterScheduleIds)); + } + + if (filterUserIds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[user_ids]", filterUserIds)); + } + + if (filterServiceIds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[service_ids]", filterServiceIds)); + } + + if (filterGroupIds != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[group_ids]", filterGroupIds)); + } + + if (filterNotificationTypes != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[notification_types]", filterNotificationTypes)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listOncallsValidateBeforeCall(@javax.annotation.Nullable String include, @javax.annotation.Nullable String since, @javax.annotation.Nullable String until, @javax.annotation.Nullable Boolean earliest, @javax.annotation.Nullable String timeZone, @javax.annotation.Nullable String filterEscalationPolicyIds, @javax.annotation.Nullable String filterScheduleIds, @javax.annotation.Nullable String filterUserIds, @javax.annotation.Nullable String filterServiceIds, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterNotificationTypes, final ApiCallback _callback) throws ApiException { + return listOncallsCall(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes, _callback); + + } + + /** + * List on-calls + * List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. + * @param include comma separated if needed. eg: user,schedule (optional) + * @param since Start of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to current time. (optional) + * @param until End of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to 'since' time. (optional) + * @param earliest When true, returns only the first on-call user per escalation policy level (optional) + * @param timeZone Timezone for response times (e.g., America/New_York). Defaults to UTC. (optional) + * @param filterEscalationPolicyIds Comma-separated escalation policy IDs (optional) + * @param filterScheduleIds Comma-separated schedule IDs (optional) + * @param filterUserIds Comma-separated user IDs (optional) + * @param filterServiceIds Comma-separated service IDs (optional) + * @param filterGroupIds Comma-separated group IDs (teams) (optional) + * @param filterNotificationTypes Comma-separated notification types to include. One or both of: audible, quiet. When present, oncalls are returned from every non-deferral escalation path whose notification_type is in the filter, sorted audible-first. When absent, only the default path's oncalls are returned (existing behavior). (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 success -
404 resource not found when alerting is disabled -
401 responds with unauthorized for invalid token -
+ */ + public void listOncalls(@javax.annotation.Nullable String include, @javax.annotation.Nullable String since, @javax.annotation.Nullable String until, @javax.annotation.Nullable Boolean earliest, @javax.annotation.Nullable String timeZone, @javax.annotation.Nullable String filterEscalationPolicyIds, @javax.annotation.Nullable String filterScheduleIds, @javax.annotation.Nullable String filterUserIds, @javax.annotation.Nullable String filterServiceIds, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterNotificationTypes) throws ApiException { + listOncallsWithHttpInfo(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes); + } + + /** + * List on-calls + * List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. + * @param include comma separated if needed. eg: user,schedule (optional) + * @param since Start of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to current time. (optional) + * @param until End of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to 'since' time. (optional) + * @param earliest When true, returns only the first on-call user per escalation policy level (optional) + * @param timeZone Timezone for response times (e.g., America/New_York). Defaults to UTC. (optional) + * @param filterEscalationPolicyIds Comma-separated escalation policy IDs (optional) + * @param filterScheduleIds Comma-separated schedule IDs (optional) + * @param filterUserIds Comma-separated user IDs (optional) + * @param filterServiceIds Comma-separated service IDs (optional) + * @param filterGroupIds Comma-separated group IDs (teams) (optional) + * @param filterNotificationTypes Comma-separated notification types to include. One or both of: audible, quiet. When present, oncalls are returned from every non-deferral escalation path whose notification_type is in the filter, sorted audible-first. When absent, only the default path's oncalls are returned (existing behavior). (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 success -
404 resource not found when alerting is disabled -
401 responds with unauthorized for invalid token -
+ */ + public ApiResponse listOncallsWithHttpInfo(@javax.annotation.Nullable String include, @javax.annotation.Nullable String since, @javax.annotation.Nullable String until, @javax.annotation.Nullable Boolean earliest, @javax.annotation.Nullable String timeZone, @javax.annotation.Nullable String filterEscalationPolicyIds, @javax.annotation.Nullable String filterScheduleIds, @javax.annotation.Nullable String filterUserIds, @javax.annotation.Nullable String filterServiceIds, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterNotificationTypes) throws ApiException { + okhttp3.Call localVarCall = listOncallsValidateBeforeCall(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * List on-calls (asynchronously) + * List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. + * @param include comma separated if needed. eg: user,schedule (optional) + * @param since Start of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to current time. (optional) + * @param until End of time range in ISO-8601 format (e.g., 2025-01-01T00:00:00Z). Defaults to 'since' time. (optional) + * @param earliest When true, returns only the first on-call user per escalation policy level (optional) + * @param timeZone Timezone for response times (e.g., America/New_York). Defaults to UTC. (optional) + * @param filterEscalationPolicyIds Comma-separated escalation policy IDs (optional) + * @param filterScheduleIds Comma-separated schedule IDs (optional) + * @param filterUserIds Comma-separated user IDs (optional) + * @param filterServiceIds Comma-separated service IDs (optional) + * @param filterGroupIds Comma-separated group IDs (teams) (optional) + * @param filterNotificationTypes Comma-separated notification types to include. One or both of: audible, quiet. When present, oncalls are returned from every non-deferral escalation path whose notification_type is in the filter, sorted audible-first. When absent, only the default path's oncalls are returned (existing behavior). (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
200 success -
404 resource not found when alerting is disabled -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call listOncallsAsync(@javax.annotation.Nullable String include, @javax.annotation.Nullable String since, @javax.annotation.Nullable String until, @javax.annotation.Nullable Boolean earliest, @javax.annotation.Nullable String timeZone, @javax.annotation.Nullable String filterEscalationPolicyIds, @javax.annotation.Nullable String filterScheduleIds, @javax.annotation.Nullable String filterUserIds, @javax.annotation.Nullable String filterServiceIds, @javax.annotation.Nullable String filterGroupIds, @javax.annotation.Nullable String filterNotificationTypes, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listOncallsValidateBeforeCall(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/api/SlasApi.java b/src/main/java/com/rootly/client/api/SlasApi.java new file mode 100644 index 00000000..3732d4fd --- /dev/null +++ b/src/main/java/com/rootly/client/api/SlasApi.java @@ -0,0 +1,814 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiCallback; +import com.rootly.client.ApiClient; +import com.rootly.client.ApiException; +import com.rootly.client.ApiResponse; +import com.rootly.client.Configuration; +import com.rootly.client.Pair; +import com.rootly.client.ProgressRequestBody; +import com.rootly.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.NewSla; +import com.rootly.client.model.SlaList; +import com.rootly.client.model.SlaResponse; +import com.rootly.client.model.UpdateSla; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SlasApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SlasApi() { + this(Configuration.getDefaultApiClient()); + } + + public SlasApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createSLA + * @param newSla (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 SLA created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createSLACall(@javax.annotation.Nonnull NewSla newSla, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = newSla; + + // create path and map variables + String localVarPath = "/v1/slas"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSLAValidateBeforeCall(@javax.annotation.Nonnull NewSla newSla, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'newSla' is set + if (newSla == null) { + throw new ApiException("Missing the required parameter 'newSla' when calling createSLA(Async)"); + } + + return createSLACall(newSla, _callback); + + } + + /** + * Creates an SLA + * Creates a new SLA from provided data + * @param newSla (required) + * @return SlaResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 SLA created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public SlaResponse createSLA(@javax.annotation.Nonnull NewSla newSla) throws ApiException { + ApiResponse localVarResp = createSLAWithHttpInfo(newSla); + return localVarResp.getData(); + } + + /** + * Creates an SLA + * Creates a new SLA from provided data + * @param newSla (required) + * @return ApiResponse<SlaResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 SLA created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public ApiResponse createSLAWithHttpInfo(@javax.annotation.Nonnull NewSla newSla) throws ApiException { + okhttp3.Call localVarCall = createSLAValidateBeforeCall(newSla, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Creates an SLA (asynchronously) + * Creates a new SLA from provided data + * @param newSla (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + + +
Response Details
Status Code Description Response Headers
201 SLA created -
422 invalid request -
401 responds with unauthorized for invalid token -
+ */ + public okhttp3.Call createSLAAsync(@javax.annotation.Nonnull NewSla newSla, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createSLAValidateBeforeCall(newSla, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSLA + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA deleted -
404 resource not found for another team -
+ */ + public okhttp3.Call deleteSLACall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/slas/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSLAValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteSLA(Async)"); + } + + return deleteSLACall(id, _callback); + + } + + /** + * Delete an SLA + * Delete a specific SLA by id + * @param id (required) + * @return SlaResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA deleted -
404 resource not found for another team -
+ */ + public SlaResponse deleteSLA(@javax.annotation.Nonnull String id) throws ApiException { + ApiResponse localVarResp = deleteSLAWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Delete an SLA + * Delete a specific SLA by id + * @param id (required) + * @return ApiResponse<SlaResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA deleted -
404 resource not found for another team -
+ */ + public ApiResponse deleteSLAWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = deleteSLAValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete an SLA (asynchronously) + * Delete a specific SLA by id + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA deleted -
404 resource not found for another team -
+ */ + public okhttp3.Call deleteSLAAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSLAValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSLA + * @param id (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA found -
404 resource not found for another team -
+ */ + public okhttp3.Call getSLACall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/slas/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSLAValidateBeforeCall(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getSLA(Async)"); + } + + return getSLACall(id, _callback); + + } + + /** + * Retrieves an SLA + * Retrieves a specific SLA by id + * @param id (required) + * @return SlaResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA found -
404 resource not found for another team -
+ */ + public SlaResponse getSLA(@javax.annotation.Nonnull String id) throws ApiException { + ApiResponse localVarResp = getSLAWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Retrieves an SLA + * Retrieves a specific SLA by id + * @param id (required) + * @return ApiResponse<SlaResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA found -
404 resource not found for another team -
+ */ + public ApiResponse getSLAWithHttpInfo(@javax.annotation.Nonnull String id) throws ApiException { + okhttp3.Call localVarCall = getSLAValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieves an SLA (asynchronously) + * Retrieves a specific SLA by id + * @param id (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA found -
404 resource not found for another team -
+ */ + public okhttp3.Call getSLAAsync(@javax.annotation.Nonnull String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSLAValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listSLAs + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterSearch (optional) + * @param filterSlug (optional) + * @param filterName (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param sort (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public okhttp3.Call listSLAsCall(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String sort, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/v1/slas"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (pageNumber != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[number]", pageNumber)); + } + + if (pageSize != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page[size]", pageSize)); + } + + if (filterSearch != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[search]", filterSearch)); + } + + if (filterSlug != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[slug]", filterSlug)); + } + + if (filterName != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[name]", filterName)); + } + + if (filterCreatedAtGt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gt]", filterCreatedAtGt)); + } + + if (filterCreatedAtGte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][gte]", filterCreatedAtGte)); + } + + if (filterCreatedAtLt != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lt]", filterCreatedAtLt)); + } + + if (filterCreatedAtLte != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("filter[created_at][lte]", filterCreatedAtLte)); + } + + if (sort != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort)); + } + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listSLAsValidateBeforeCall(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String sort, final ApiCallback _callback) throws ApiException { + return listSLAsCall(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort, _callback); + + } + + /** + * List SLAs + * List SLAs + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterSearch (optional) + * @param filterSlug (optional) + * @param filterName (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param sort (optional) + * @return SlaList + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public SlaList listSLAs(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String sort) throws ApiException { + ApiResponse localVarResp = listSLAsWithHttpInfo(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort); + return localVarResp.getData(); + } + + /** + * List SLAs + * List SLAs + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterSearch (optional) + * @param filterSlug (optional) + * @param filterName (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param sort (optional) + * @return ApiResponse<SlaList> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public ApiResponse listSLAsWithHttpInfo(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String sort) throws ApiException { + okhttp3.Call localVarCall = listSLAsValidateBeforeCall(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List SLAs (asynchronously) + * List SLAs + * @param pageNumber (optional) + * @param pageSize (optional) + * @param filterSearch (optional) + * @param filterSlug (optional) + * @param filterName (optional) + * @param filterCreatedAtGt (optional) + * @param filterCreatedAtGte (optional) + * @param filterCreatedAtLt (optional) + * @param filterCreatedAtLte (optional) + * @param sort (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 success -
+ */ + public okhttp3.Call listSLAsAsync(@javax.annotation.Nullable Integer pageNumber, @javax.annotation.Nullable Integer pageSize, @javax.annotation.Nullable String filterSearch, @javax.annotation.Nullable String filterSlug, @javax.annotation.Nullable String filterName, @javax.annotation.Nullable String filterCreatedAtGt, @javax.annotation.Nullable String filterCreatedAtGte, @javax.annotation.Nullable String filterCreatedAtLt, @javax.annotation.Nullable String filterCreatedAtLte, @javax.annotation.Nullable String sort, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = listSLAsValidateBeforeCall(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSLA + * @param id (required) + * @param updateSla (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA updated -
404 resource not found for another team -
+ */ + public okhttp3.Call updateSLACall(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateSla updateSla, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = updateSla; + + // create path and map variables + String localVarPath = "/v1/slas/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/vnd.api+json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/vnd.api+json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "bearer_auth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSLAValidateBeforeCall(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateSla updateSla, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateSLA(Async)"); + } + + // verify the required parameter 'updateSla' is set + if (updateSla == null) { + throw new ApiException("Missing the required parameter 'updateSla' when calling updateSLA(Async)"); + } + + return updateSLACall(id, updateSla, _callback); + + } + + /** + * Update an SLA + * Update a specific SLA by id + * @param id (required) + * @param updateSla (required) + * @return SlaResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA updated -
404 resource not found for another team -
+ */ + public SlaResponse updateSLA(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateSla updateSla) throws ApiException { + ApiResponse localVarResp = updateSLAWithHttpInfo(id, updateSla); + return localVarResp.getData(); + } + + /** + * Update an SLA + * Update a specific SLA by id + * @param id (required) + * @param updateSla (required) + * @return ApiResponse<SlaResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA updated -
404 resource not found for another team -
+ */ + public ApiResponse updateSLAWithHttpInfo(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateSla updateSla) throws ApiException { + okhttp3.Call localVarCall = updateSLAValidateBeforeCall(id, updateSla, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update an SLA (asynchronously) + * Update a specific SLA by id + * @param id (required) + * @param updateSla (required) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + + +
Response Details
Status Code Description Response Headers
200 SLA updated -
404 resource not found for another team -
+ */ + public okhttp3.Call updateSLAAsync(@javax.annotation.Nonnull String id, @javax.annotation.Nonnull UpdateSla updateSla, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSLAValidateBeforeCall(id, updateSla, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/rootly/client/model/AddMicrosoftTeamsChatTabTaskParams.java b/src/main/java/com/rootly/client/model/AddMicrosoftTeamsChatTabTaskParams.java new file mode 100644 index 00000000..27185d9a --- /dev/null +++ b/src/main/java/com/rootly/client/model/AddMicrosoftTeamsChatTabTaskParams.java @@ -0,0 +1,360 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * AddMicrosoftTeamsChatTabTaskParams + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class AddMicrosoftTeamsChatTabTaskParams { + /** + * Gets or Sets taskType + */ + @JsonAdapter(TaskTypeEnum.Adapter.class) + public enum TaskTypeEnum { + ADD_MICROSOFT_TEAMS_CHAT_TAB("add_microsoft_teams_chat_tab"); + + private String value; + + TaskTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TaskTypeEnum fromValue(String value) { + for (TaskTypeEnum b : TaskTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TaskTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TaskTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TaskTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TASK_TYPE = "task_type"; + @SerializedName(SERIALIZED_NAME_TASK_TYPE) + @javax.annotation.Nullable + private TaskTypeEnum taskType; + + public static final String SERIALIZED_NAME_CHAT = "chat"; + @SerializedName(SERIALIZED_NAME_CHAT) + @javax.annotation.Nonnull + private AddActionItemTaskParamsPostToSlackChannelsInner chat; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nonnull + private String title; + + public static final String SERIALIZED_NAME_LINK = "link"; + @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nonnull + private String link; + + public AddMicrosoftTeamsChatTabTaskParams() { + } + + public AddMicrosoftTeamsChatTabTaskParams taskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get taskType + * @return taskType + */ + @javax.annotation.Nullable + public TaskTypeEnum getTaskType() { + return taskType; + } + + public void setTaskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + } + + + public AddMicrosoftTeamsChatTabTaskParams chat(@javax.annotation.Nonnull AddActionItemTaskParamsPostToSlackChannelsInner chat) { + this.chat = chat; + return this; + } + + /** + * Get chat + * @return chat + */ + @javax.annotation.Nonnull + public AddActionItemTaskParamsPostToSlackChannelsInner getChat() { + return chat; + } + + public void setChat(@javax.annotation.Nonnull AddActionItemTaskParamsPostToSlackChannelsInner chat) { + this.chat = chat; + } + + + public AddMicrosoftTeamsChatTabTaskParams title(@javax.annotation.Nonnull String title) { + this.title = title; + return this; + } + + /** + * The tab title + * @return title + */ + @javax.annotation.Nonnull + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + + public AddMicrosoftTeamsChatTabTaskParams link(@javax.annotation.Nonnull String link) { + this.link = link; + return this; + } + + /** + * The tab link + * @return link + */ + @javax.annotation.Nonnull + public String getLink() { + return link; + } + + public void setLink(@javax.annotation.Nonnull String link) { + this.link = link; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddMicrosoftTeamsChatTabTaskParams addMicrosoftTeamsChatTabTaskParams = (AddMicrosoftTeamsChatTabTaskParams) o; + return Objects.equals(this.taskType, addMicrosoftTeamsChatTabTaskParams.taskType) && + Objects.equals(this.chat, addMicrosoftTeamsChatTabTaskParams.chat) && + Objects.equals(this.title, addMicrosoftTeamsChatTabTaskParams.title) && + Objects.equals(this.link, addMicrosoftTeamsChatTabTaskParams.link); + } + + @Override + public int hashCode() { + return Objects.hash(taskType, chat, title, link); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddMicrosoftTeamsChatTabTaskParams {\n"); + sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n"); + sb.append(" chat: ").append(toIndentedString(chat)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("task_type"); + openapiFields.add("chat"); + openapiFields.add("title"); + openapiFields.add("link"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("chat"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("link"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AddMicrosoftTeamsChatTabTaskParams + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddMicrosoftTeamsChatTabTaskParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddMicrosoftTeamsChatTabTaskParams is not found in the empty JSON string", AddMicrosoftTeamsChatTabTaskParams.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AddMicrosoftTeamsChatTabTaskParams.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddMicrosoftTeamsChatTabTaskParams` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddMicrosoftTeamsChatTabTaskParams.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) && !jsonObj.get("task_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_type").toString())); + } + // validate the optional field `task_type` + if (jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) { + TaskTypeEnum.validateJsonElement(jsonObj.get("task_type")); + } + // validate the required field `chat` + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonObj.get("chat")); + if (!jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if (!jsonObj.get("link").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `link` to be a primitive type in the JSON string but got `%s`", jsonObj.get("link").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AddMicrosoftTeamsChatTabTaskParams.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddMicrosoftTeamsChatTabTaskParams' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddMicrosoftTeamsChatTabTaskParams.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AddMicrosoftTeamsChatTabTaskParams value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AddMicrosoftTeamsChatTabTaskParams read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddMicrosoftTeamsChatTabTaskParams given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddMicrosoftTeamsChatTabTaskParams + * @throws IOException if the JSON string is invalid with respect to AddMicrosoftTeamsChatTabTaskParams + */ + public static AddMicrosoftTeamsChatTabTaskParams fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddMicrosoftTeamsChatTabTaskParams.class); + } + + /** + * Convert an instance of AddMicrosoftTeamsChatTabTaskParams to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditions.java b/src/main/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditions.java new file mode 100644 index 00000000..8f4a1be9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditions.java @@ -0,0 +1,316 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AlertTriggerParamsAlertPayloadConditionsConditionsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * AlertTriggerParamsAlertPayloadConditions + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class AlertTriggerParamsAlertPayloadConditions { + /** + * Gets or Sets logic + */ + @JsonAdapter(LogicEnum.Adapter.class) + public enum LogicEnum { + ALL("ALL"), + + ANY("ANY"), + + NONE("NONE"); + + private String value; + + LogicEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static LogicEnum fromValue(String value) { + for (LogicEnum b : LogicEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LogicEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public LogicEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LogicEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + LogicEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_LOGIC = "logic"; + @SerializedName(SERIALIZED_NAME_LOGIC) + @javax.annotation.Nullable + private LogicEnum logic; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + @javax.annotation.Nullable + private List conditions = new ArrayList<>(); + + public AlertTriggerParamsAlertPayloadConditions() { + } + + public AlertTriggerParamsAlertPayloadConditions logic(@javax.annotation.Nullable LogicEnum logic) { + this.logic = logic; + return this; + } + + /** + * Get logic + * @return logic + */ + @javax.annotation.Nullable + public LogicEnum getLogic() { + return logic; + } + + public void setLogic(@javax.annotation.Nullable LogicEnum logic) { + this.logic = logic; + } + + + public AlertTriggerParamsAlertPayloadConditions conditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + return this; + } + + public AlertTriggerParamsAlertPayloadConditions addConditionsItem(AlertTriggerParamsAlertPayloadConditionsConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Get conditions + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlertTriggerParamsAlertPayloadConditions alertTriggerParamsAlertPayloadConditions = (AlertTriggerParamsAlertPayloadConditions) o; + return Objects.equals(this.logic, alertTriggerParamsAlertPayloadConditions.logic) && + Objects.equals(this.conditions, alertTriggerParamsAlertPayloadConditions.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(logic, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlertTriggerParamsAlertPayloadConditions {\n"); + sb.append(" logic: ").append(toIndentedString(logic)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("logic"); + openapiFields.add("conditions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AlertTriggerParamsAlertPayloadConditions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AlertTriggerParamsAlertPayloadConditions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AlertTriggerParamsAlertPayloadConditions is not found in the empty JSON string", AlertTriggerParamsAlertPayloadConditions.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AlertTriggerParamsAlertPayloadConditions.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AlertTriggerParamsAlertPayloadConditions` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("logic") != null && !jsonObj.get("logic").isJsonNull()) && !jsonObj.get("logic").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logic").toString())); + } + // validate the optional field `logic` + if (jsonObj.get("logic") != null && !jsonObj.get("logic").isJsonNull()) { + LogicEnum.validateJsonElement(jsonObj.get("logic")); + } + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + AlertTriggerParamsAlertPayloadConditionsConditionsInner.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AlertTriggerParamsAlertPayloadConditions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AlertTriggerParamsAlertPayloadConditions' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AlertTriggerParamsAlertPayloadConditions.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AlertTriggerParamsAlertPayloadConditions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AlertTriggerParamsAlertPayloadConditions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AlertTriggerParamsAlertPayloadConditions given an JSON string + * + * @param jsonString JSON string + * @return An instance of AlertTriggerParamsAlertPayloadConditions + * @throws IOException if the JSON string is invalid with respect to AlertTriggerParamsAlertPayloadConditions + */ + public static AlertTriggerParamsAlertPayloadConditions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AlertTriggerParamsAlertPayloadConditions.class); + } + + /** + * Convert an instance of AlertTriggerParamsAlertPayloadConditions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsConditionsInner.java b/src/main/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsConditionsInner.java new file mode 100644 index 00000000..26a2e376 --- /dev/null +++ b/src/main/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsConditionsInner.java @@ -0,0 +1,381 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * AlertTriggerParamsAlertPayloadConditionsConditionsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class AlertTriggerParamsAlertPayloadConditionsConditionsInner { + public static final String SERIALIZED_NAME_QUERY = "query"; + @SerializedName(SERIALIZED_NAME_QUERY) + @javax.annotation.Nonnull + private String query; + + /** + * Gets or Sets operator + */ + @JsonAdapter(OperatorEnum.Adapter.class) + public enum OperatorEnum { + IS("IS"), + + IS_NOT("IS NOT"), + + ANY("ANY"), + + CONTAINS("CONTAINS"), + + CONTAINS_ALL("CONTAINS_ALL"), + + CONTAINS_NONE("CONTAINS_NONE"), + + NONE("NONE"), + + SET("SET"), + + UNSET("UNSET"); + + private String value; + + OperatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OperatorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperatorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperatorEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OperatorEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nonnull + private OperatorEnum operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + @SerializedName(SERIALIZED_NAME_VALUES) + @javax.annotation.Nullable + private List values = new ArrayList<>(); + + public static final String SERIALIZED_NAME_USE_REGEXP = "use_regexp"; + @SerializedName(SERIALIZED_NAME_USE_REGEXP) + @javax.annotation.Nullable + private Boolean useRegexp; + + public AlertTriggerParamsAlertPayloadConditionsConditionsInner() { + } + + public AlertTriggerParamsAlertPayloadConditionsConditionsInner query(@javax.annotation.Nonnull String query) { + this.query = query; + return this; + } + + /** + * Get query + * @return query + */ + @javax.annotation.Nonnull + public String getQuery() { + return query; + } + + public void setQuery(@javax.annotation.Nonnull String query) { + this.query = query; + } + + + public AlertTriggerParamsAlertPayloadConditionsConditionsInner operator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + return this; + } + + /** + * Get operator + * @return operator + */ + @javax.annotation.Nonnull + public OperatorEnum getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + } + + + public AlertTriggerParamsAlertPayloadConditionsConditionsInner values(@javax.annotation.Nullable List values) { + this.values = values; + return this; + } + + public AlertTriggerParamsAlertPayloadConditionsConditionsInner addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Get values + * @return values + */ + @javax.annotation.Nullable + public List getValues() { + return values; + } + + public void setValues(@javax.annotation.Nullable List values) { + this.values = values; + } + + + public AlertTriggerParamsAlertPayloadConditionsConditionsInner useRegexp(@javax.annotation.Nullable Boolean useRegexp) { + this.useRegexp = useRegexp; + return this; + } + + /** + * Get useRegexp + * @return useRegexp + */ + @javax.annotation.Nullable + public Boolean getUseRegexp() { + return useRegexp; + } + + public void setUseRegexp(@javax.annotation.Nullable Boolean useRegexp) { + this.useRegexp = useRegexp; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AlertTriggerParamsAlertPayloadConditionsConditionsInner alertTriggerParamsAlertPayloadConditionsConditionsInner = (AlertTriggerParamsAlertPayloadConditionsConditionsInner) o; + return Objects.equals(this.query, alertTriggerParamsAlertPayloadConditionsConditionsInner.query) && + Objects.equals(this.operator, alertTriggerParamsAlertPayloadConditionsConditionsInner.operator) && + Objects.equals(this.values, alertTriggerParamsAlertPayloadConditionsConditionsInner.values) && + Objects.equals(this.useRegexp, alertTriggerParamsAlertPayloadConditionsConditionsInner.useRegexp); + } + + @Override + public int hashCode() { + return Objects.hash(query, operator, values, useRegexp); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AlertTriggerParamsAlertPayloadConditionsConditionsInner {\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" useRegexp: ").append(toIndentedString(useRegexp)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("query"); + openapiFields.add("operator"); + openapiFields.add("values"); + openapiFields.add("use_regexp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("query"); + openapiRequiredFields.add("operator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to AlertTriggerParamsAlertPayloadConditionsConditionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AlertTriggerParamsAlertPayloadConditionsConditionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AlertTriggerParamsAlertPayloadConditionsConditionsInner is not found in the empty JSON string", AlertTriggerParamsAlertPayloadConditionsConditionsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!AlertTriggerParamsAlertPayloadConditionsConditionsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AlertTriggerParamsAlertPayloadConditionsConditionsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AlertTriggerParamsAlertPayloadConditionsConditionsInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("query").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `query` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query").toString())); + } + if (!jsonObj.get("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + // validate the required field `operator` + OperatorEnum.validateJsonElement(jsonObj.get("operator")); + // ensure the optional json data is an array if present + if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonNull() && !jsonObj.get("values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AlertTriggerParamsAlertPayloadConditionsConditionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AlertTriggerParamsAlertPayloadConditionsConditionsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AlertTriggerParamsAlertPayloadConditionsConditionsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AlertTriggerParamsAlertPayloadConditionsConditionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AlertTriggerParamsAlertPayloadConditionsConditionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AlertTriggerParamsAlertPayloadConditionsConditionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of AlertTriggerParamsAlertPayloadConditionsConditionsInner + * @throws IOException if the JSON string is invalid with respect to AlertTriggerParamsAlertPayloadConditionsConditionsInner + */ + public static AlertTriggerParamsAlertPayloadConditionsConditionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AlertTriggerParamsAlertPayloadConditionsConditionsInner.class); + } + + /** + * Convert an instance of AlertTriggerParamsAlertPayloadConditionsConditionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKey.java b/src/main/java/com/rootly/client/model/ApiKey.java new file mode 100644 index 00000000..1e903791 --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKey.java @@ -0,0 +1,555 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKey + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKey { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * The kind of the API key + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + PERSONAL("personal"), + + TEAM("team"), + + ORGANIZATION("organization"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + public static final String SERIALIZED_NAME_ROLE_ID = "role_id"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nullable + private String roleId; + + public static final String SERIALIZED_NAME_ON_CALL_ROLE_ID = "on_call_role_id"; + @SerializedName(SERIALIZED_NAME_ON_CALL_ROLE_ID) + @javax.annotation.Nullable + private String onCallRoleId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private String updatedAt; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nullable + private String expiresAt; + + public static final String SERIALIZED_NAME_LAST_USED_AT = "last_used_at"; + @SerializedName(SERIALIZED_NAME_LAST_USED_AT) + @javax.annotation.Nullable + private String lastUsedAt; + + public static final String SERIALIZED_NAME_GRACE_PERIOD_ENDS_AT = "grace_period_ends_at"; + @SerializedName(SERIALIZED_NAME_GRACE_PERIOD_ENDS_AT) + @javax.annotation.Nullable + private String gracePeriodEndsAt; + + public ApiKey() { + } + + public ApiKey name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the API key + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public ApiKey description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the API key + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ApiKey kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * The kind of the API key + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public ApiKey roleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + return this; + } + + /** + * The role ID + * @return roleId + */ + @javax.annotation.Nullable + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + } + + + public ApiKey onCallRoleId(@javax.annotation.Nullable String onCallRoleId) { + this.onCallRoleId = onCallRoleId; + return this; + } + + /** + * The on-call role ID + * @return onCallRoleId + */ + @javax.annotation.Nullable + public String getOnCallRoleId() { + return onCallRoleId; + } + + public void setOnCallRoleId(@javax.annotation.Nullable String onCallRoleId) { + this.onCallRoleId = onCallRoleId; + } + + + public ApiKey createdAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + } + + + public ApiKey updatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ApiKey expiresAt(@javax.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Expiration date + * @return expiresAt + */ + @javax.annotation.Nullable + public String getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + } + + + public ApiKey lastUsedAt(@javax.annotation.Nullable String lastUsedAt) { + this.lastUsedAt = lastUsedAt; + return this; + } + + /** + * Date of last use + * @return lastUsedAt + */ + @javax.annotation.Nullable + public String getLastUsedAt() { + return lastUsedAt; + } + + public void setLastUsedAt(@javax.annotation.Nullable String lastUsedAt) { + this.lastUsedAt = lastUsedAt; + } + + + public ApiKey gracePeriodEndsAt(@javax.annotation.Nullable String gracePeriodEndsAt) { + this.gracePeriodEndsAt = gracePeriodEndsAt; + return this; + } + + /** + * Grace period end date + * @return gracePeriodEndsAt + */ + @javax.annotation.Nullable + public String getGracePeriodEndsAt() { + return gracePeriodEndsAt; + } + + public void setGracePeriodEndsAt(@javax.annotation.Nullable String gracePeriodEndsAt) { + this.gracePeriodEndsAt = gracePeriodEndsAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKey apiKey = (ApiKey) o; + return Objects.equals(this.name, apiKey.name) && + Objects.equals(this.description, apiKey.description) && + Objects.equals(this.kind, apiKey.kind) && + Objects.equals(this.roleId, apiKey.roleId) && + Objects.equals(this.onCallRoleId, apiKey.onCallRoleId) && + Objects.equals(this.createdAt, apiKey.createdAt) && + Objects.equals(this.updatedAt, apiKey.updatedAt) && + Objects.equals(this.expiresAt, apiKey.expiresAt) && + Objects.equals(this.lastUsedAt, apiKey.lastUsedAt) && + Objects.equals(this.gracePeriodEndsAt, apiKey.gracePeriodEndsAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, kind, roleId, onCallRoleId, createdAt, updatedAt, expiresAt, lastUsedAt, gracePeriodEndsAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKey {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" onCallRoleId: ").append(toIndentedString(onCallRoleId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" lastUsedAt: ").append(toIndentedString(lastUsedAt)).append("\n"); + sb.append(" gracePeriodEndsAt: ").append(toIndentedString(gracePeriodEndsAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("kind"); + openapiFields.add("role_id"); + openapiFields.add("on_call_role_id"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("expires_at"); + openapiFields.add("last_used_at"); + openapiFields.add("grace_period_ends_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("kind"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKey is not found in the empty JSON string", ApiKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKey` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKey.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if ((jsonObj.get("role_id") != null && !jsonObj.get("role_id").isJsonNull()) && !jsonObj.get("role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role_id").toString())); + } + if ((jsonObj.get("on_call_role_id") != null && !jsonObj.get("on_call_role_id").isJsonNull()) && !jsonObj.get("on_call_role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `on_call_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("on_call_role_id").toString())); + } + if (!jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if (!jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + if ((jsonObj.get("expires_at") != null && !jsonObj.get("expires_at").isJsonNull()) && !jsonObj.get("expires_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires_at").toString())); + } + if ((jsonObj.get("last_used_at") != null && !jsonObj.get("last_used_at").isJsonNull()) && !jsonObj.get("last_used_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `last_used_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_used_at").toString())); + } + if ((jsonObj.get("grace_period_ends_at") != null && !jsonObj.get("grace_period_ends_at").isJsonNull()) && !jsonObj.get("grace_period_ends_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grace_period_ends_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grace_period_ends_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKey + * @throws IOException if the JSON string is invalid with respect to ApiKey + */ + public static ApiKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKey.class); + } + + /** + * Convert an instance of ApiKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKeyList.java b/src/main/java/com/rootly/client/model/ApiKeyList.java new file mode 100644 index 00000000..89c81b02 --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKeyList.java @@ -0,0 +1,294 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKeyList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKeyList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private Links links; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public ApiKeyList() { + } + + public ApiKeyList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public ApiKeyList addDataItem(ApiKeyResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public ApiKeyList links(@javax.annotation.Nonnull Links links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public Links getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull Links links) { + this.links = links; + } + + + public ApiKeyList meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyList apiKeyList = (ApiKeyList) o; + return Objects.equals(this.data, apiKeyList.data) && + Objects.equals(this.links, apiKeyList.links) && + Objects.equals(this.meta, apiKeyList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyList {\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("}"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("links"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("links"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKeyList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKeyList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKeyList is not found in the empty JSON string", ApiKeyList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKeyList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeyList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKeyList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ApiKeyResponseData.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `links` + Links.validateJsonElement(jsonObj.get("links")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKeyList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyList + * @throws IOException if the JSON string is invalid with respect to ApiKeyList + */ + public static ApiKeyList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyList.class); + } + + /** + * Convert an instance of ApiKeyList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKeyResponse.java b/src/main/java/com/rootly/client/model/ApiKeyResponse.java new file mode 100644 index 00000000..94830633 --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKeyResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKeyResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKeyResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private ApiKeyResponseData data; + + public ApiKeyResponse() { + } + + public ApiKeyResponse data(@javax.annotation.Nonnull ApiKeyResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public ApiKeyResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull ApiKeyResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyResponse apiKeyResponse = (ApiKeyResponse) o; + return Objects.equals(this.data, apiKeyResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKeyResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKeyResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKeyResponse is not found in the empty JSON string", ApiKeyResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKeyResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeyResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKeyResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + ApiKeyResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKeyResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyResponse + * @throws IOException if the JSON string is invalid with respect to ApiKeyResponse + */ + public static ApiKeyResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyResponse.class); + } + + /** + * Convert an instance of ApiKeyResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKeyResponseData.java b/src/main/java/com/rootly/client/model/ApiKeyResponseData.java new file mode 100644 index 00000000..b604a396 --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKeyResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKey; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKeyResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKeyResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + API_KEYS("api_keys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private ApiKey attributes; + + public ApiKeyResponseData() { + } + + public ApiKeyResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the API key + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public ApiKeyResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public ApiKeyResponseData attributes(@javax.annotation.Nonnull ApiKey attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public ApiKey getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull ApiKey attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyResponseData apiKeyResponseData = (ApiKeyResponseData) o; + return Objects.equals(this.id, apiKeyResponseData.id) && + Objects.equals(this.type, apiKeyResponseData.type) && + Objects.equals(this.attributes, apiKeyResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKeyResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKeyResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKeyResponseData is not found in the empty JSON string", ApiKeyResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKeyResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeyResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKeyResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + ApiKey.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKeyResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyResponseData + * @throws IOException if the JSON string is invalid with respect to ApiKeyResponseData + */ + public static ApiKeyResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyResponseData.class); + } + + /** + * Convert an instance of ApiKeyResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponse.java b/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponse.java new file mode 100644 index 00000000..307a3c7a --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyWithTokenResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKeyWithTokenResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKeyWithTokenResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private ApiKeyWithTokenResponseData data; + + public ApiKeyWithTokenResponse() { + } + + public ApiKeyWithTokenResponse data(@javax.annotation.Nonnull ApiKeyWithTokenResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public ApiKeyWithTokenResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull ApiKeyWithTokenResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyWithTokenResponse apiKeyWithTokenResponse = (ApiKeyWithTokenResponse) o; + return Objects.equals(this.data, apiKeyWithTokenResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyWithTokenResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKeyWithTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKeyWithTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKeyWithTokenResponse is not found in the empty JSON string", ApiKeyWithTokenResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKeyWithTokenResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeyWithTokenResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKeyWithTokenResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + ApiKeyWithTokenResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKeyWithTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyWithTokenResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyWithTokenResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyWithTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyWithTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyWithTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyWithTokenResponse + * @throws IOException if the JSON string is invalid with respect to ApiKeyWithTokenResponse + */ + public static ApiKeyWithTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyWithTokenResponse.class); + } + + /** + * Convert an instance of ApiKeyWithTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponseData.java b/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponseData.java new file mode 100644 index 00000000..ded1f272 --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyWithTokenResponseDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKeyWithTokenResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKeyWithTokenResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + API_KEYS("api_keys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private ApiKeyWithTokenResponseDataAttributes attributes; + + public ApiKeyWithTokenResponseData() { + } + + public ApiKeyWithTokenResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the API key + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public ApiKeyWithTokenResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public ApiKeyWithTokenResponseData attributes(@javax.annotation.Nonnull ApiKeyWithTokenResponseDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public ApiKeyWithTokenResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull ApiKeyWithTokenResponseDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyWithTokenResponseData apiKeyWithTokenResponseData = (ApiKeyWithTokenResponseData) o; + return Objects.equals(this.id, apiKeyWithTokenResponseData.id) && + Objects.equals(this.type, apiKeyWithTokenResponseData.type) && + Objects.equals(this.attributes, apiKeyWithTokenResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyWithTokenResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKeyWithTokenResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKeyWithTokenResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKeyWithTokenResponseData is not found in the empty JSON string", ApiKeyWithTokenResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKeyWithTokenResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeyWithTokenResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKeyWithTokenResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + ApiKeyWithTokenResponseDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKeyWithTokenResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyWithTokenResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyWithTokenResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyWithTokenResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyWithTokenResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyWithTokenResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyWithTokenResponseData + * @throws IOException if the JSON string is invalid with respect to ApiKeyWithTokenResponseData + */ + public static ApiKeyWithTokenResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyWithTokenResponseData.class); + } + + /** + * Convert an instance of ApiKeyWithTokenResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponseDataAttributes.java b/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponseDataAttributes.java new file mode 100644 index 00000000..7149583a --- /dev/null +++ b/src/main/java/com/rootly/client/model/ApiKeyWithTokenResponseDataAttributes.java @@ -0,0 +1,586 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * ApiKeyWithTokenResponseDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class ApiKeyWithTokenResponseDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * The kind of the API key + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + PERSONAL("personal"), + + TEAM("team"), + + ORGANIZATION("organization"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + public static final String SERIALIZED_NAME_ROLE_ID = "role_id"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nullable + private String roleId; + + public static final String SERIALIZED_NAME_ON_CALL_ROLE_ID = "on_call_role_id"; + @SerializedName(SERIALIZED_NAME_ON_CALL_ROLE_ID) + @javax.annotation.Nullable + private String onCallRoleId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private String updatedAt; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nullable + private String expiresAt; + + public static final String SERIALIZED_NAME_LAST_USED_AT = "last_used_at"; + @SerializedName(SERIALIZED_NAME_LAST_USED_AT) + @javax.annotation.Nullable + private String lastUsedAt; + + public static final String SERIALIZED_NAME_GRACE_PERIOD_ENDS_AT = "grace_period_ends_at"; + @SerializedName(SERIALIZED_NAME_GRACE_PERIOD_ENDS_AT) + @javax.annotation.Nullable + private String gracePeriodEndsAt; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public ApiKeyWithTokenResponseDataAttributes() { + } + + public ApiKeyWithTokenResponseDataAttributes name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the API key + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public ApiKeyWithTokenResponseDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the API key + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ApiKeyWithTokenResponseDataAttributes kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * The kind of the API key + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public ApiKeyWithTokenResponseDataAttributes roleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + return this; + } + + /** + * The role ID + * @return roleId + */ + @javax.annotation.Nullable + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + } + + + public ApiKeyWithTokenResponseDataAttributes onCallRoleId(@javax.annotation.Nullable String onCallRoleId) { + this.onCallRoleId = onCallRoleId; + return this; + } + + /** + * The on-call role ID + * @return onCallRoleId + */ + @javax.annotation.Nullable + public String getOnCallRoleId() { + return onCallRoleId; + } + + public void setOnCallRoleId(@javax.annotation.Nullable String onCallRoleId) { + this.onCallRoleId = onCallRoleId; + } + + + public ApiKeyWithTokenResponseDataAttributes createdAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + } + + + public ApiKeyWithTokenResponseDataAttributes updatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + } + + + public ApiKeyWithTokenResponseDataAttributes expiresAt(@javax.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * Expiration date + * @return expiresAt + */ + @javax.annotation.Nullable + public String getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nullable String expiresAt) { + this.expiresAt = expiresAt; + } + + + public ApiKeyWithTokenResponseDataAttributes lastUsedAt(@javax.annotation.Nullable String lastUsedAt) { + this.lastUsedAt = lastUsedAt; + return this; + } + + /** + * Date of last use + * @return lastUsedAt + */ + @javax.annotation.Nullable + public String getLastUsedAt() { + return lastUsedAt; + } + + public void setLastUsedAt(@javax.annotation.Nullable String lastUsedAt) { + this.lastUsedAt = lastUsedAt; + } + + + public ApiKeyWithTokenResponseDataAttributes gracePeriodEndsAt(@javax.annotation.Nullable String gracePeriodEndsAt) { + this.gracePeriodEndsAt = gracePeriodEndsAt; + return this; + } + + /** + * Grace period end date + * @return gracePeriodEndsAt + */ + @javax.annotation.Nullable + public String getGracePeriodEndsAt() { + return gracePeriodEndsAt; + } + + public void setGracePeriodEndsAt(@javax.annotation.Nullable String gracePeriodEndsAt) { + this.gracePeriodEndsAt = gracePeriodEndsAt; + } + + + public ApiKeyWithTokenResponseDataAttributes token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * The API key token (only shown once) + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiKeyWithTokenResponseDataAttributes apiKeyWithTokenResponseDataAttributes = (ApiKeyWithTokenResponseDataAttributes) o; + return Objects.equals(this.name, apiKeyWithTokenResponseDataAttributes.name) && + Objects.equals(this.description, apiKeyWithTokenResponseDataAttributes.description) && + Objects.equals(this.kind, apiKeyWithTokenResponseDataAttributes.kind) && + Objects.equals(this.roleId, apiKeyWithTokenResponseDataAttributes.roleId) && + Objects.equals(this.onCallRoleId, apiKeyWithTokenResponseDataAttributes.onCallRoleId) && + Objects.equals(this.createdAt, apiKeyWithTokenResponseDataAttributes.createdAt) && + Objects.equals(this.updatedAt, apiKeyWithTokenResponseDataAttributes.updatedAt) && + Objects.equals(this.expiresAt, apiKeyWithTokenResponseDataAttributes.expiresAt) && + Objects.equals(this.lastUsedAt, apiKeyWithTokenResponseDataAttributes.lastUsedAt) && + Objects.equals(this.gracePeriodEndsAt, apiKeyWithTokenResponseDataAttributes.gracePeriodEndsAt) && + Objects.equals(this.token, apiKeyWithTokenResponseDataAttributes.token); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, kind, roleId, onCallRoleId, createdAt, updatedAt, expiresAt, lastUsedAt, gracePeriodEndsAt, token); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiKeyWithTokenResponseDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" onCallRoleId: ").append(toIndentedString(onCallRoleId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" lastUsedAt: ").append(toIndentedString(lastUsedAt)).append("\n"); + sb.append(" gracePeriodEndsAt: ").append(toIndentedString(gracePeriodEndsAt)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("kind"); + openapiFields.add("role_id"); + openapiFields.add("on_call_role_id"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("expires_at"); + openapiFields.add("last_used_at"); + openapiFields.add("grace_period_ends_at"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("kind"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + openapiRequiredFields.add("token"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiKeyWithTokenResponseDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiKeyWithTokenResponseDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiKeyWithTokenResponseDataAttributes is not found in the empty JSON string", ApiKeyWithTokenResponseDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!ApiKeyWithTokenResponseDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiKeyWithTokenResponseDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ApiKeyWithTokenResponseDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if ((jsonObj.get("role_id") != null && !jsonObj.get("role_id").isJsonNull()) && !jsonObj.get("role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role_id").toString())); + } + if ((jsonObj.get("on_call_role_id") != null && !jsonObj.get("on_call_role_id").isJsonNull()) && !jsonObj.get("on_call_role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `on_call_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("on_call_role_id").toString())); + } + if (!jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if (!jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + if ((jsonObj.get("expires_at") != null && !jsonObj.get("expires_at").isJsonNull()) && !jsonObj.get("expires_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires_at").toString())); + } + if ((jsonObj.get("last_used_at") != null && !jsonObj.get("last_used_at").isJsonNull()) && !jsonObj.get("last_used_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `last_used_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("last_used_at").toString())); + } + if ((jsonObj.get("grace_period_ends_at") != null && !jsonObj.get("grace_period_ends_at").isJsonNull()) && !jsonObj.get("grace_period_ends_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grace_period_ends_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grace_period_ends_at").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ApiKeyWithTokenResponseDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiKeyWithTokenResponseDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiKeyWithTokenResponseDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ApiKeyWithTokenResponseDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ApiKeyWithTokenResponseDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiKeyWithTokenResponseDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiKeyWithTokenResponseDataAttributes + * @throws IOException if the JSON string is invalid with respect to ApiKeyWithTokenResponseDataAttributes + */ + public static ApiKeyWithTokenResponseDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiKeyWithTokenResponseDataAttributes.class); + } + + /** + * Convert an instance of ApiKeyWithTokenResponseDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/BuiltinField.java b/src/main/java/com/rootly/client/model/BuiltinField.java new file mode 100644 index 00000000..9480fc2b --- /dev/null +++ b/src/main/java/com/rootly/client/model/BuiltinField.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * BuiltinField + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class BuiltinField { + /** + * Gets or Sets fieldSource + */ + @JsonAdapter(FieldSourceEnum.Adapter.class) + public enum FieldSourceEnum { + BUILTIN("builtin"); + + private String value; + + FieldSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FieldSourceEnum fromValue(String value) { + for (FieldSourceEnum b : FieldSourceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FieldSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FieldSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FieldSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FieldSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FIELD_SOURCE = "field_source"; + @SerializedName(SERIALIZED_NAME_FIELD_SOURCE) + @javax.annotation.Nonnull + private FieldSourceEnum fieldSource; + + public static final String SERIALIZED_NAME_FIELD_KEY = "field_key"; + @SerializedName(SERIALIZED_NAME_FIELD_KEY) + @javax.annotation.Nonnull + private String fieldKey; + + public BuiltinField() { + } + + public BuiltinField fieldSource(@javax.annotation.Nonnull FieldSourceEnum fieldSource) { + this.fieldSource = fieldSource; + return this; + } + + /** + * Get fieldSource + * @return fieldSource + */ + @javax.annotation.Nonnull + public FieldSourceEnum getFieldSource() { + return fieldSource; + } + + public void setFieldSource(@javax.annotation.Nonnull FieldSourceEnum fieldSource) { + this.fieldSource = fieldSource; + } + + + public BuiltinField fieldKey(@javax.annotation.Nonnull String fieldKey) { + this.fieldKey = fieldKey; + return this; + } + + /** + * Key identifying the builtin field + * @return fieldKey + */ + @javax.annotation.Nonnull + public String getFieldKey() { + return fieldKey; + } + + public void setFieldKey(@javax.annotation.Nonnull String fieldKey) { + this.fieldKey = fieldKey; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BuiltinField builtinField = (BuiltinField) o; + return Objects.equals(this.fieldSource, builtinField.fieldSource) && + Objects.equals(this.fieldKey, builtinField.fieldKey); + } + + @Override + public int hashCode() { + return Objects.hash(fieldSource, fieldKey); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BuiltinField {\n"); + sb.append(" fieldSource: ").append(toIndentedString(fieldSource)).append("\n"); + sb.append(" fieldKey: ").append(toIndentedString(fieldKey)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("field_source"); + openapiFields.add("field_key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("field_source"); + openapiRequiredFields.add("field_key"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to BuiltinField + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BuiltinField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BuiltinField is not found in the empty JSON string", BuiltinField.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!BuiltinField.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BuiltinField` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BuiltinField.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("field_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field_source").toString())); + } + // validate the required field `field_source` + FieldSourceEnum.validateJsonElement(jsonObj.get("field_source")); + if (!jsonObj.get("field_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field_key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BuiltinField.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BuiltinField' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BuiltinField.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BuiltinField value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BuiltinField read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BuiltinField given an JSON string + * + * @param jsonString JSON string + * @return An instance of BuiltinField + * @throws IOException if the JSON string is invalid with respect to BuiltinField + */ + public static BuiltinField fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BuiltinField.class); + } + + /** + * Convert an instance of BuiltinField to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogChecklistTemplate.java b/src/main/java/com/rootly/client/model/CatalogChecklistTemplate.java new file mode 100644 index 00000000..1e901cd9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogChecklistTemplate.java @@ -0,0 +1,661 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplateFieldsInner; +import com.rootly.client.model.CatalogChecklistTemplateOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogChecklistTemplate + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogChecklistTemplate { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SLUG = "slug"; + @SerializedName(SERIALIZED_NAME_SLUG) + @javax.annotation.Nullable + private String slug; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * The catalog type + */ + @JsonAdapter(CatalogTypeEnum.Adapter.class) + public enum CatalogTypeEnum { + SERVICE("Service"), + + FUNCTIONALITY("Functionality"), + + ENVIRONMENT("Environment"), + + GROUP("Group"), + + CAUSE("Cause"), + + INCIDENT_TYPE("IncidentType"), + + CATALOG("Catalog"); + + private String value; + + CatalogTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CatalogTypeEnum fromValue(String value) { + for (CatalogTypeEnum b : CatalogTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CatalogTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CatalogTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CatalogTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CatalogTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CATALOG_TYPE = "catalog_type"; + @SerializedName(SERIALIZED_NAME_CATALOG_TYPE) + @javax.annotation.Nonnull + private CatalogTypeEnum catalogType; + + /** + * The scope type + */ + @JsonAdapter(ScopeTypeEnum.Adapter.class) + public enum ScopeTypeEnum { + TEAM("Team"), + + CATALOG("Catalog"); + + private String value; + + ScopeTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeTypeEnum fromValue(String value) { + for (ScopeTypeEnum b : ScopeTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ScopeTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE_TYPE = "scope_type"; + @SerializedName(SERIALIZED_NAME_SCOPE_TYPE) + @javax.annotation.Nonnull + private ScopeTypeEnum scopeType; + + public static final String SERIALIZED_NAME_SCOPE_ID = "scope_id"; + @SerializedName(SERIALIZED_NAME_SCOPE_ID) + @javax.annotation.Nonnull + private String scopeId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private String updatedAt; + + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + @javax.annotation.Nullable + private List fields; + + public static final String SERIALIZED_NAME_OWNERS = "owners"; + @SerializedName(SERIALIZED_NAME_OWNERS) + @javax.annotation.Nullable + private List owners; + + public CatalogChecklistTemplate() { + } + + public CatalogChecklistTemplate name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the checklist template + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CatalogChecklistTemplate slug(@javax.annotation.Nullable String slug) { + this.slug = slug; + return this; + } + + /** + * The slug of the checklist template + * @return slug + */ + @javax.annotation.Nullable + public String getSlug() { + return slug; + } + + public void setSlug(@javax.annotation.Nullable String slug) { + this.slug = slug; + } + + + public CatalogChecklistTemplate description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the checklist template + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public CatalogChecklistTemplate catalogType(@javax.annotation.Nonnull CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + return this; + } + + /** + * The catalog type + * @return catalogType + */ + @javax.annotation.Nonnull + public CatalogTypeEnum getCatalogType() { + return catalogType; + } + + public void setCatalogType(@javax.annotation.Nonnull CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + } + + + public CatalogChecklistTemplate scopeType(@javax.annotation.Nonnull ScopeTypeEnum scopeType) { + this.scopeType = scopeType; + return this; + } + + /** + * The scope type + * @return scopeType + */ + @javax.annotation.Nonnull + public ScopeTypeEnum getScopeType() { + return scopeType; + } + + public void setScopeType(@javax.annotation.Nonnull ScopeTypeEnum scopeType) { + this.scopeType = scopeType; + } + + + public CatalogChecklistTemplate scopeId(@javax.annotation.Nonnull String scopeId) { + this.scopeId = scopeId; + return this; + } + + /** + * The scope ID + * @return scopeId + */ + @javax.annotation.Nonnull + public String getScopeId() { + return scopeId; + } + + public void setScopeId(@javax.annotation.Nonnull String scopeId) { + this.scopeId = scopeId; + } + + + public CatalogChecklistTemplate createdAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + } + + + public CatalogChecklistTemplate updatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + } + + + public CatalogChecklistTemplate fields(@javax.annotation.Nullable List fields) { + this.fields = fields; + return this; + } + + public CatalogChecklistTemplate addFieldsItem(CatalogChecklistTemplateFieldsInner fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Template fields in position order + * @return fields + */ + @javax.annotation.Nullable + public List getFields() { + return fields; + } + + public void setFields(@javax.annotation.Nullable List fields) { + this.fields = fields; + } + + + public CatalogChecklistTemplate owners(@javax.annotation.Nullable List owners) { + this.owners = owners; + return this; + } + + public CatalogChecklistTemplate addOwnersItem(CatalogChecklistTemplateOwnersInner ownersItem) { + if (this.owners == null) { + this.owners = new ArrayList<>(); + } + this.owners.add(ownersItem); + return this; + } + + /** + * Template owners + * @return owners + */ + @javax.annotation.Nullable + public List getOwners() { + return owners; + } + + public void setOwners(@javax.annotation.Nullable List owners) { + this.owners = owners; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogChecklistTemplate catalogChecklistTemplate = (CatalogChecklistTemplate) o; + return Objects.equals(this.name, catalogChecklistTemplate.name) && + Objects.equals(this.slug, catalogChecklistTemplate.slug) && + Objects.equals(this.description, catalogChecklistTemplate.description) && + Objects.equals(this.catalogType, catalogChecklistTemplate.catalogType) && + Objects.equals(this.scopeType, catalogChecklistTemplate.scopeType) && + Objects.equals(this.scopeId, catalogChecklistTemplate.scopeId) && + Objects.equals(this.createdAt, catalogChecklistTemplate.createdAt) && + Objects.equals(this.updatedAt, catalogChecklistTemplate.updatedAt) && + Objects.equals(this.fields, catalogChecklistTemplate.fields) && + Objects.equals(this.owners, catalogChecklistTemplate.owners); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, slug, description, catalogType, scopeType, scopeId, createdAt, updatedAt, fields, owners); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogChecklistTemplate {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" catalogType: ").append(toIndentedString(catalogType)).append("\n"); + sb.append(" scopeType: ").append(toIndentedString(scopeType)).append("\n"); + sb.append(" scopeId: ").append(toIndentedString(scopeId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" owners: ").append(toIndentedString(owners)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("slug"); + openapiFields.add("description"); + openapiFields.add("catalog_type"); + openapiFields.add("scope_type"); + openapiFields.add("scope_id"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("fields"); + openapiFields.add("owners"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("catalog_type"); + openapiRequiredFields.add("scope_type"); + openapiRequiredFields.add("scope_id"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogChecklistTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogChecklistTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogChecklistTemplate is not found in the empty JSON string", CatalogChecklistTemplate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogChecklistTemplate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogChecklistTemplate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogChecklistTemplate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("slug") != null && !jsonObj.get("slug").isJsonNull()) && !jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("catalog_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_type").toString())); + } + // validate the required field `catalog_type` + CatalogTypeEnum.validateJsonElement(jsonObj.get("catalog_type")); + if (!jsonObj.get("scope_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope_type").toString())); + } + // validate the required field `scope_type` + ScopeTypeEnum.validateJsonElement(jsonObj.get("scope_type")); + if (!jsonObj.get("scope_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope_id").toString())); + } + if (!jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if (!jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + if (jsonObj.get("fields") != null && !jsonObj.get("fields").isJsonNull()) { + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + if (jsonArrayfields != null) { + // ensure the json data is an array + if (!jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); + } + + // validate the optional field `fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + CatalogChecklistTemplateFieldsInner.validateJsonElement(jsonArrayfields.get(i)); + }; + } + } + if (jsonObj.get("owners") != null && !jsonObj.get("owners").isJsonNull()) { + JsonArray jsonArrayowners = jsonObj.getAsJsonArray("owners"); + if (jsonArrayowners != null) { + // ensure the json data is an array + if (!jsonObj.get("owners").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `owners` to be an array in the JSON string but got `%s`", jsonObj.get("owners").toString())); + } + + // validate the optional field `owners` (array) + for (int i = 0; i < jsonArrayowners.size(); i++) { + CatalogChecklistTemplateOwnersInner.validateJsonElement(jsonArrayowners.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogChecklistTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogChecklistTemplate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogChecklistTemplate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogChecklistTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogChecklistTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogChecklistTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogChecklistTemplate + * @throws IOException if the JSON string is invalid with respect to CatalogChecklistTemplate + */ + public static CatalogChecklistTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogChecklistTemplate.class); + } + + /** + * Convert an instance of CatalogChecklistTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogChecklistTemplateFieldsInner.java b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateFieldsInner.java new file mode 100644 index 00000000..94e583c1 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateFieldsInner.java @@ -0,0 +1,334 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogChecklistTemplateFieldsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogChecklistTemplateFieldsInner { + /** + * Source of the field + */ + @JsonAdapter(FieldSourceEnum.Adapter.class) + public enum FieldSourceEnum { + BUILTIN("builtin"), + + CUSTOM("custom"); + + private String value; + + FieldSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FieldSourceEnum fromValue(String value) { + for (FieldSourceEnum b : FieldSourceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final FieldSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FieldSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FieldSourceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + FieldSourceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_FIELD_SOURCE = "field_source"; + @SerializedName(SERIALIZED_NAME_FIELD_SOURCE) + @javax.annotation.Nullable + private FieldSourceEnum fieldSource; + + public static final String SERIALIZED_NAME_FIELD_KEY = "field_key"; + @SerializedName(SERIALIZED_NAME_FIELD_KEY) + @javax.annotation.Nullable + private String fieldKey; + + public static final String SERIALIZED_NAME_CATALOG_PROPERTY_ID = "catalog_property_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_PROPERTY_ID) + @javax.annotation.Nullable + private String catalogPropertyId; + + public CatalogChecklistTemplateFieldsInner() { + } + + public CatalogChecklistTemplateFieldsInner fieldSource(@javax.annotation.Nullable FieldSourceEnum fieldSource) { + this.fieldSource = fieldSource; + return this; + } + + /** + * Source of the field + * @return fieldSource + */ + @javax.annotation.Nullable + public FieldSourceEnum getFieldSource() { + return fieldSource; + } + + public void setFieldSource(@javax.annotation.Nullable FieldSourceEnum fieldSource) { + this.fieldSource = fieldSource; + } + + + public CatalogChecklistTemplateFieldsInner fieldKey(@javax.annotation.Nullable String fieldKey) { + this.fieldKey = fieldKey; + return this; + } + + /** + * Key identifying the field + * @return fieldKey + */ + @javax.annotation.Nullable + public String getFieldKey() { + return fieldKey; + } + + public void setFieldKey(@javax.annotation.Nullable String fieldKey) { + this.fieldKey = fieldKey; + } + + + public CatalogChecklistTemplateFieldsInner catalogPropertyId(@javax.annotation.Nullable String catalogPropertyId) { + this.catalogPropertyId = catalogPropertyId; + return this; + } + + /** + * ID of the catalog property for custom fields + * @return catalogPropertyId + */ + @javax.annotation.Nullable + public String getCatalogPropertyId() { + return catalogPropertyId; + } + + public void setCatalogPropertyId(@javax.annotation.Nullable String catalogPropertyId) { + this.catalogPropertyId = catalogPropertyId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogChecklistTemplateFieldsInner catalogChecklistTemplateFieldsInner = (CatalogChecklistTemplateFieldsInner) o; + return Objects.equals(this.fieldSource, catalogChecklistTemplateFieldsInner.fieldSource) && + Objects.equals(this.fieldKey, catalogChecklistTemplateFieldsInner.fieldKey) && + Objects.equals(this.catalogPropertyId, catalogChecklistTemplateFieldsInner.catalogPropertyId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(fieldSource, fieldKey, catalogPropertyId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogChecklistTemplateFieldsInner {\n"); + sb.append(" fieldSource: ").append(toIndentedString(fieldSource)).append("\n"); + sb.append(" fieldKey: ").append(toIndentedString(fieldKey)).append("\n"); + sb.append(" catalogPropertyId: ").append(toIndentedString(catalogPropertyId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("field_source"); + openapiFields.add("field_key"); + openapiFields.add("catalog_property_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogChecklistTemplateFieldsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogChecklistTemplateFieldsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogChecklistTemplateFieldsInner is not found in the empty JSON string", CatalogChecklistTemplateFieldsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogChecklistTemplateFieldsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogChecklistTemplateFieldsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("field_source") != null && !jsonObj.get("field_source").isJsonNull()) && !jsonObj.get("field_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field_source").toString())); + } + // validate the optional field `field_source` + if (jsonObj.get("field_source") != null && !jsonObj.get("field_source").isJsonNull()) { + FieldSourceEnum.validateJsonElement(jsonObj.get("field_source")); + } + if ((jsonObj.get("field_key") != null && !jsonObj.get("field_key").isJsonNull()) && !jsonObj.get("field_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field_key").toString())); + } + if ((jsonObj.get("catalog_property_id") != null && !jsonObj.get("catalog_property_id").isJsonNull()) && !jsonObj.get("catalog_property_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_property_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_property_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogChecklistTemplateFieldsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogChecklistTemplateFieldsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogChecklistTemplateFieldsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogChecklistTemplateFieldsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogChecklistTemplateFieldsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogChecklistTemplateFieldsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogChecklistTemplateFieldsInner + * @throws IOException if the JSON string is invalid with respect to CatalogChecklistTemplateFieldsInner + */ + public static CatalogChecklistTemplateFieldsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogChecklistTemplateFieldsInner.class); + } + + /** + * Convert an instance of CatalogChecklistTemplateFieldsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogChecklistTemplateList.java b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateList.java new file mode 100644 index 00000000..afcc186d --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateList.java @@ -0,0 +1,296 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplateResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogChecklistTemplateList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogChecklistTemplateList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nullable + private Links links; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nullable + private Meta meta; + + public CatalogChecklistTemplateList() { + } + + public CatalogChecklistTemplateList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public CatalogChecklistTemplateList addDataItem(CatalogChecklistTemplateResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public CatalogChecklistTemplateList links(@javax.annotation.Nullable Links links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nullable + public Links getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nullable Links links) { + this.links = links; + } + + + public CatalogChecklistTemplateList meta(@javax.annotation.Nullable Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nullable + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nullable Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogChecklistTemplateList catalogChecklistTemplateList = (CatalogChecklistTemplateList) o; + return Objects.equals(this.data, catalogChecklistTemplateList.data) && + Objects.equals(this.links, catalogChecklistTemplateList.links) && + Objects.equals(this.meta, catalogChecklistTemplateList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogChecklistTemplateList {\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("}"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("links"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogChecklistTemplateList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogChecklistTemplateList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogChecklistTemplateList is not found in the empty JSON string", CatalogChecklistTemplateList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogChecklistTemplateList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogChecklistTemplateList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogChecklistTemplateList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + CatalogChecklistTemplateResponseData.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `links` + if (jsonObj.get("links") != null && !jsonObj.get("links").isJsonNull()) { + Links.validateJsonElement(jsonObj.get("links")); + } + // validate the optional field `meta` + if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { + Meta.validateJsonElement(jsonObj.get("meta")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogChecklistTemplateList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogChecklistTemplateList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogChecklistTemplateList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogChecklistTemplateList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogChecklistTemplateList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogChecklistTemplateList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogChecklistTemplateList + * @throws IOException if the JSON string is invalid with respect to CatalogChecklistTemplateList + */ + public static CatalogChecklistTemplateList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogChecklistTemplateList.class); + } + + /** + * Convert an instance of CatalogChecklistTemplateList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogChecklistTemplateOwnersInner.java b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateOwnersInner.java new file mode 100644 index 00000000..9f715263 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateOwnersInner.java @@ -0,0 +1,292 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogChecklistTemplateOwnersInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogChecklistTemplateOwnersInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + /** + * Type of owner + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + FIELD("field"), + + USER("user"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public CatalogChecklistTemplateOwnersInner() { + } + + public CatalogChecklistTemplateOwnersInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * User ID for user owners, or field key for field owners + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CatalogChecklistTemplateOwnersInner type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Type of owner + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogChecklistTemplateOwnersInner catalogChecklistTemplateOwnersInner = (CatalogChecklistTemplateOwnersInner) o; + return Objects.equals(this.id, catalogChecklistTemplateOwnersInner.id) && + Objects.equals(this.type, catalogChecklistTemplateOwnersInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogChecklistTemplateOwnersInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogChecklistTemplateOwnersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogChecklistTemplateOwnersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogChecklistTemplateOwnersInner is not found in the empty JSON string", CatalogChecklistTemplateOwnersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogChecklistTemplateOwnersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogChecklistTemplateOwnersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogChecklistTemplateOwnersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogChecklistTemplateOwnersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogChecklistTemplateOwnersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogChecklistTemplateOwnersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogChecklistTemplateOwnersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogChecklistTemplateOwnersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogChecklistTemplateOwnersInner + * @throws IOException if the JSON string is invalid with respect to CatalogChecklistTemplateOwnersInner + */ + public static CatalogChecklistTemplateOwnersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogChecklistTemplateOwnersInner.class); + } + + /** + * Convert an instance of CatalogChecklistTemplateOwnersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogChecklistTemplateResponse.java b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateResponse.java new file mode 100644 index 00000000..1ab26164 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplateResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogChecklistTemplateResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogChecklistTemplateResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private CatalogChecklistTemplateResponseData data; + + public CatalogChecklistTemplateResponse() { + } + + public CatalogChecklistTemplateResponse data(@javax.annotation.Nonnull CatalogChecklistTemplateResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public CatalogChecklistTemplateResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull CatalogChecklistTemplateResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogChecklistTemplateResponse catalogChecklistTemplateResponse = (CatalogChecklistTemplateResponse) o; + return Objects.equals(this.data, catalogChecklistTemplateResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogChecklistTemplateResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogChecklistTemplateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogChecklistTemplateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogChecklistTemplateResponse is not found in the empty JSON string", CatalogChecklistTemplateResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogChecklistTemplateResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogChecklistTemplateResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogChecklistTemplateResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + CatalogChecklistTemplateResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogChecklistTemplateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogChecklistTemplateResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogChecklistTemplateResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogChecklistTemplateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogChecklistTemplateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogChecklistTemplateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogChecklistTemplateResponse + * @throws IOException if the JSON string is invalid with respect to CatalogChecklistTemplateResponse + */ + public static CatalogChecklistTemplateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogChecklistTemplateResponse.class); + } + + /** + * Convert an instance of CatalogChecklistTemplateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogChecklistTemplateResponseData.java b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateResponseData.java new file mode 100644 index 00000000..4d644edd --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogChecklistTemplateResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplate; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogChecklistTemplateResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogChecklistTemplateResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_CHECKLIST_TEMPLATES("catalog_checklist_templates"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private CatalogChecklistTemplate attributes; + + public CatalogChecklistTemplateResponseData() { + } + + public CatalogChecklistTemplateResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the checklist template + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public CatalogChecklistTemplateResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public CatalogChecklistTemplateResponseData attributes(@javax.annotation.Nonnull CatalogChecklistTemplate attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public CatalogChecklistTemplate getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull CatalogChecklistTemplate attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogChecklistTemplateResponseData catalogChecklistTemplateResponseData = (CatalogChecklistTemplateResponseData) o; + return Objects.equals(this.id, catalogChecklistTemplateResponseData.id) && + Objects.equals(this.type, catalogChecklistTemplateResponseData.type) && + Objects.equals(this.attributes, catalogChecklistTemplateResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogChecklistTemplateResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogChecklistTemplateResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogChecklistTemplateResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogChecklistTemplateResponseData is not found in the empty JSON string", CatalogChecklistTemplateResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogChecklistTemplateResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogChecklistTemplateResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogChecklistTemplateResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + CatalogChecklistTemplate.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogChecklistTemplateResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogChecklistTemplateResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogChecklistTemplateResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogChecklistTemplateResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogChecklistTemplateResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogChecklistTemplateResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogChecklistTemplateResponseData + * @throws IOException if the JSON string is invalid with respect to CatalogChecklistTemplateResponseData + */ + public static CatalogChecklistTemplateResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogChecklistTemplateResponseData.class); + } + + /** + * Convert an instance of CatalogChecklistTemplateResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklist.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklist.java new file mode 100644 index 00000000..c42b60ff --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklist.java @@ -0,0 +1,695 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistFieldsInner; +import com.rootly.client.model.CatalogEntityChecklistChecklistOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklist + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklist { + public static final String SERIALIZED_NAME_CATALOG_CHECKLIST_TEMPLATE_ID = "catalog_checklist_template_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_CHECKLIST_TEMPLATE_ID) + @javax.annotation.Nonnull + private String catalogChecklistTemplateId; + + /** + * The type of the auditable entity + */ + @JsonAdapter(AuditableTypeEnum.Adapter.class) + public enum AuditableTypeEnum { + SERVICE("Service"), + + FUNCTIONALITY("Functionality"), + + ENVIRONMENT("Environment"), + + GROUP("Group"), + + CAUSE("Cause"), + + INCIDENT_TYPE("IncidentType"), + + CATALOG_ENTITY("CatalogEntity"); + + private String value; + + AuditableTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuditableTypeEnum fromValue(String value) { + for (AuditableTypeEnum b : AuditableTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuditableTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuditableTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuditableTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuditableTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_AUDITABLE_TYPE = "auditable_type"; + @SerializedName(SERIALIZED_NAME_AUDITABLE_TYPE) + @javax.annotation.Nonnull + private AuditableTypeEnum auditableType; + + public static final String SERIALIZED_NAME_AUDITABLE_ID = "auditable_id"; + @SerializedName(SERIALIZED_NAME_AUDITABLE_ID) + @javax.annotation.Nonnull + private String auditableId; + + /** + * The status of the checklist + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + TRIGGERED("triggered"), + + IN_PROGRESS("in_progress"), + + COMPLETED("completed"), + + CANCELLED("cancelled"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public static final String SERIALIZED_NAME_STARTED_AT = "started_at"; + @SerializedName(SERIALIZED_NAME_STARTED_AT) + @javax.annotation.Nullable + private String startedAt; + + public static final String SERIALIZED_NAME_COMPLETED_AT = "completed_at"; + @SerializedName(SERIALIZED_NAME_COMPLETED_AT) + @javax.annotation.Nullable + private String completedAt; + + public static final String SERIALIZED_NAME_COMPLETED_BY_USER_ID = "completed_by_user_id"; + @SerializedName(SERIALIZED_NAME_COMPLETED_BY_USER_ID) + @javax.annotation.Nullable + private String completedByUserId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private String updatedAt; + + public static final String SERIALIZED_NAME_CHECKLIST_FIELDS = "checklist_fields"; + @SerializedName(SERIALIZED_NAME_CHECKLIST_FIELDS) + @javax.annotation.Nullable + private List checklistFields; + + public static final String SERIALIZED_NAME_CHECKLIST_OWNERS = "checklist_owners"; + @SerializedName(SERIALIZED_NAME_CHECKLIST_OWNERS) + @javax.annotation.Nullable + private List checklistOwners; + + public CatalogEntityChecklist() { + } + + public CatalogEntityChecklist catalogChecklistTemplateId(@javax.annotation.Nonnull String catalogChecklistTemplateId) { + this.catalogChecklistTemplateId = catalogChecklistTemplateId; + return this; + } + + /** + * The ID of the checklist template + * @return catalogChecklistTemplateId + */ + @javax.annotation.Nonnull + public String getCatalogChecklistTemplateId() { + return catalogChecklistTemplateId; + } + + public void setCatalogChecklistTemplateId(@javax.annotation.Nonnull String catalogChecklistTemplateId) { + this.catalogChecklistTemplateId = catalogChecklistTemplateId; + } + + + public CatalogEntityChecklist auditableType(@javax.annotation.Nonnull AuditableTypeEnum auditableType) { + this.auditableType = auditableType; + return this; + } + + /** + * The type of the auditable entity + * @return auditableType + */ + @javax.annotation.Nonnull + public AuditableTypeEnum getAuditableType() { + return auditableType; + } + + public void setAuditableType(@javax.annotation.Nonnull AuditableTypeEnum auditableType) { + this.auditableType = auditableType; + } + + + public CatalogEntityChecklist auditableId(@javax.annotation.Nonnull String auditableId) { + this.auditableId = auditableId; + return this; + } + + /** + * The ID of the auditable entity + * @return auditableId + */ + @javax.annotation.Nonnull + public String getAuditableId() { + return auditableId; + } + + public void setAuditableId(@javax.annotation.Nonnull String auditableId) { + this.auditableId = auditableId; + } + + + public CatalogEntityChecklist status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the checklist + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public CatalogEntityChecklist startedAt(@javax.annotation.Nullable String startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * When the checklist was started + * @return startedAt + */ + @javax.annotation.Nullable + public String getStartedAt() { + return startedAt; + } + + public void setStartedAt(@javax.annotation.Nullable String startedAt) { + this.startedAt = startedAt; + } + + + public CatalogEntityChecklist completedAt(@javax.annotation.Nullable String completedAt) { + this.completedAt = completedAt; + return this; + } + + /** + * When the checklist was completed + * @return completedAt + */ + @javax.annotation.Nullable + public String getCompletedAt() { + return completedAt; + } + + public void setCompletedAt(@javax.annotation.Nullable String completedAt) { + this.completedAt = completedAt; + } + + + public CatalogEntityChecklist completedByUserId(@javax.annotation.Nullable String completedByUserId) { + this.completedByUserId = completedByUserId; + return this; + } + + /** + * The ID of the user who completed the checklist + * @return completedByUserId + */ + @javax.annotation.Nullable + public String getCompletedByUserId() { + return completedByUserId; + } + + public void setCompletedByUserId(@javax.annotation.Nullable String completedByUserId) { + this.completedByUserId = completedByUserId; + } + + + public CatalogEntityChecklist createdAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + } + + + public CatalogEntityChecklist updatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + } + + + public CatalogEntityChecklist checklistFields(@javax.annotation.Nullable List checklistFields) { + this.checklistFields = checklistFields; + return this; + } + + public CatalogEntityChecklist addChecklistFieldsItem(CatalogEntityChecklistChecklistFieldsInner checklistFieldsItem) { + if (this.checklistFields == null) { + this.checklistFields = new ArrayList<>(); + } + this.checklistFields.add(checklistFieldsItem); + return this; + } + + /** + * Checklist fields + * @return checklistFields + */ + @javax.annotation.Nullable + public List getChecklistFields() { + return checklistFields; + } + + public void setChecklistFields(@javax.annotation.Nullable List checklistFields) { + this.checklistFields = checklistFields; + } + + + public CatalogEntityChecklist checklistOwners(@javax.annotation.Nullable List checklistOwners) { + this.checklistOwners = checklistOwners; + return this; + } + + public CatalogEntityChecklist addChecklistOwnersItem(CatalogEntityChecklistChecklistOwnersInner checklistOwnersItem) { + if (this.checklistOwners == null) { + this.checklistOwners = new ArrayList<>(); + } + this.checklistOwners.add(checklistOwnersItem); + return this; + } + + /** + * Checklist owners + * @return checklistOwners + */ + @javax.annotation.Nullable + public List getChecklistOwners() { + return checklistOwners; + } + + public void setChecklistOwners(@javax.annotation.Nullable List checklistOwners) { + this.checklistOwners = checklistOwners; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklist catalogEntityChecklist = (CatalogEntityChecklist) o; + return Objects.equals(this.catalogChecklistTemplateId, catalogEntityChecklist.catalogChecklistTemplateId) && + Objects.equals(this.auditableType, catalogEntityChecklist.auditableType) && + Objects.equals(this.auditableId, catalogEntityChecklist.auditableId) && + Objects.equals(this.status, catalogEntityChecklist.status) && + Objects.equals(this.startedAt, catalogEntityChecklist.startedAt) && + Objects.equals(this.completedAt, catalogEntityChecklist.completedAt) && + Objects.equals(this.completedByUserId, catalogEntityChecklist.completedByUserId) && + Objects.equals(this.createdAt, catalogEntityChecklist.createdAt) && + Objects.equals(this.updatedAt, catalogEntityChecklist.updatedAt) && + Objects.equals(this.checklistFields, catalogEntityChecklist.checklistFields) && + Objects.equals(this.checklistOwners, catalogEntityChecklist.checklistOwners); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(catalogChecklistTemplateId, auditableType, auditableId, status, startedAt, completedAt, completedByUserId, createdAt, updatedAt, checklistFields, checklistOwners); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklist {\n"); + sb.append(" catalogChecklistTemplateId: ").append(toIndentedString(catalogChecklistTemplateId)).append("\n"); + sb.append(" auditableType: ").append(toIndentedString(auditableType)).append("\n"); + sb.append(" auditableId: ").append(toIndentedString(auditableId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); + sb.append(" completedByUserId: ").append(toIndentedString(completedByUserId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" checklistFields: ").append(toIndentedString(checklistFields)).append("\n"); + sb.append(" checklistOwners: ").append(toIndentedString(checklistOwners)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("catalog_checklist_template_id"); + openapiFields.add("auditable_type"); + openapiFields.add("auditable_id"); + openapiFields.add("status"); + openapiFields.add("started_at"); + openapiFields.add("completed_at"); + openapiFields.add("completed_by_user_id"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("checklist_fields"); + openapiFields.add("checklist_owners"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("catalog_checklist_template_id"); + openapiRequiredFields.add("auditable_type"); + openapiRequiredFields.add("auditable_id"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklist + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklist.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklist is not found in the empty JSON string", CatalogEntityChecklist.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklist.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklist` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogEntityChecklist.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("catalog_checklist_template_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_checklist_template_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_checklist_template_id").toString())); + } + if (!jsonObj.get("auditable_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `auditable_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auditable_type").toString())); + } + // validate the required field `auditable_type` + AuditableTypeEnum.validateJsonElement(jsonObj.get("auditable_type")); + if (!jsonObj.get("auditable_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `auditable_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("auditable_id").toString())); + } + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("started_at") != null && !jsonObj.get("started_at").isJsonNull()) && !jsonObj.get("started_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `started_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("started_at").toString())); + } + if ((jsonObj.get("completed_at") != null && !jsonObj.get("completed_at").isJsonNull()) && !jsonObj.get("completed_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completed_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completed_at").toString())); + } + if ((jsonObj.get("completed_by_user_id") != null && !jsonObj.get("completed_by_user_id").isJsonNull()) && !jsonObj.get("completed_by_user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completed_by_user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completed_by_user_id").toString())); + } + if (!jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if (!jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + if (jsonObj.get("checklist_fields") != null && !jsonObj.get("checklist_fields").isJsonNull()) { + JsonArray jsonArraychecklistFields = jsonObj.getAsJsonArray("checklist_fields"); + if (jsonArraychecklistFields != null) { + // ensure the json data is an array + if (!jsonObj.get("checklist_fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `checklist_fields` to be an array in the JSON string but got `%s`", jsonObj.get("checklist_fields").toString())); + } + + // validate the optional field `checklist_fields` (array) + for (int i = 0; i < jsonArraychecklistFields.size(); i++) { + CatalogEntityChecklistChecklistFieldsInner.validateJsonElement(jsonArraychecklistFields.get(i)); + }; + } + } + if (jsonObj.get("checklist_owners") != null && !jsonObj.get("checklist_owners").isJsonNull()) { + JsonArray jsonArraychecklistOwners = jsonObj.getAsJsonArray("checklist_owners"); + if (jsonArraychecklistOwners != null) { + // ensure the json data is an array + if (!jsonObj.get("checklist_owners").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `checklist_owners` to be an array in the JSON string but got `%s`", jsonObj.get("checklist_owners").toString())); + } + + // validate the optional field `checklist_owners` (array) + for (int i = 0; i < jsonArraychecklistOwners.size(); i++) { + CatalogEntityChecklistChecklistOwnersInner.validateJsonElement(jsonArraychecklistOwners.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklist.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklist' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklist.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklist value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklist read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklist given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklist + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklist + */ + public static CatalogEntityChecklist fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklist.class); + } + + /** + * Convert an instance of CatalogEntityChecklist to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInner.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInner.java new file mode 100644 index 00000000..dfbf34ef --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInner.java @@ -0,0 +1,208 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistFieldsInnerData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistChecklistFieldsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistChecklistFieldsInner { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private CatalogEntityChecklistChecklistFieldsInnerData data; + + public CatalogEntityChecklistChecklistFieldsInner() { + } + + public CatalogEntityChecklistChecklistFieldsInner data(@javax.annotation.Nullable CatalogEntityChecklistChecklistFieldsInnerData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public CatalogEntityChecklistChecklistFieldsInnerData getData() { + return data; + } + + public void setData(@javax.annotation.Nullable CatalogEntityChecklistChecklistFieldsInnerData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistChecklistFieldsInner catalogEntityChecklistChecklistFieldsInner = (CatalogEntityChecklistChecklistFieldsInner) o; + return Objects.equals(this.data, catalogEntityChecklistChecklistFieldsInner.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistChecklistFieldsInner {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistChecklistFieldsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistChecklistFieldsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistChecklistFieldsInner is not found in the empty JSON string", CatalogEntityChecklistChecklistFieldsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistChecklistFieldsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistChecklistFieldsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CatalogEntityChecklistChecklistFieldsInnerData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistChecklistFieldsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistChecklistFieldsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistChecklistFieldsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistChecklistFieldsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistChecklistFieldsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistChecklistFieldsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistChecklistFieldsInner + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistChecklistFieldsInner + */ + public static CatalogEntityChecklistChecklistFieldsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistChecklistFieldsInner.class); + } + + /** + * Convert an instance of CatalogEntityChecklistChecklistFieldsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerData.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerData.java new file mode 100644 index 00000000..63235852 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerData.java @@ -0,0 +1,322 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistFieldsInnerDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistChecklistFieldsInnerData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistChecklistFieldsInnerData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_ENTITY_CHECKLIST_FIELDS("catalog_entity_checklist_fields"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private CatalogEntityChecklistChecklistFieldsInnerDataAttributes attributes; + + public CatalogEntityChecklistChecklistFieldsInnerData() { + } + + public CatalogEntityChecklistChecklistFieldsInnerData id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * ID of the checklist field + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CatalogEntityChecklistChecklistFieldsInnerData type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public CatalogEntityChecklistChecklistFieldsInnerData attributes(@javax.annotation.Nullable CatalogEntityChecklistChecklistFieldsInnerDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable CatalogEntityChecklistChecklistFieldsInnerDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistChecklistFieldsInnerData catalogEntityChecklistChecklistFieldsInnerData = (CatalogEntityChecklistChecklistFieldsInnerData) o; + return Objects.equals(this.id, catalogEntityChecklistChecklistFieldsInnerData.id) && + Objects.equals(this.type, catalogEntityChecklistChecklistFieldsInnerData.type) && + Objects.equals(this.attributes, catalogEntityChecklistChecklistFieldsInnerData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistChecklistFieldsInnerData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistChecklistFieldsInnerData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistChecklistFieldsInnerData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistChecklistFieldsInnerData is not found in the empty JSON string", CatalogEntityChecklistChecklistFieldsInnerData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistChecklistFieldsInnerData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistChecklistFieldsInnerData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + // validate the optional field `attributes` + if (jsonObj.get("attributes") != null && !jsonObj.get("attributes").isJsonNull()) { + CatalogEntityChecklistChecklistFieldsInnerDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistChecklistFieldsInnerData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistChecklistFieldsInnerData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistChecklistFieldsInnerData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistChecklistFieldsInnerData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistChecklistFieldsInnerData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistChecklistFieldsInnerData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistChecklistFieldsInnerData + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistChecklistFieldsInnerData + */ + public static CatalogEntityChecklistChecklistFieldsInnerData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistChecklistFieldsInnerData.class); + } + + /** + * Convert an instance of CatalogEntityChecklistChecklistFieldsInnerData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataAttributes.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataAttributes.java new file mode 100644 index 00000000..3179b9bc --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataAttributes.java @@ -0,0 +1,452 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistChecklistFieldsInnerDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistChecklistFieldsInnerDataAttributes { + public static final String SERIALIZED_NAME_CATALOG_ENTITY_CHECKLIST_ID = "catalog_entity_checklist_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_ENTITY_CHECKLIST_ID) + @javax.annotation.Nullable + private String catalogEntityChecklistId; + + public static final String SERIALIZED_NAME_CATALOG_CHECKLIST_TEMPLATE_FIELD_ID = "catalog_checklist_template_field_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_CHECKLIST_TEMPLATE_FIELD_ID) + @javax.annotation.Nullable + private String catalogChecklistTemplateFieldId; + + public static final String SERIALIZED_NAME_FIELD_KEY = "field_key"; + @SerializedName(SERIALIZED_NAME_FIELD_KEY) + @javax.annotation.Nullable + private String fieldKey; + + public static final String SERIALIZED_NAME_CHECKED = "checked"; + @SerializedName(SERIALIZED_NAME_CHECKED) + @javax.annotation.Nullable + private Boolean checked; + + public static final String SERIALIZED_NAME_VALUE_SNAPSHOT = "value_snapshot"; + @SerializedName(SERIALIZED_NAME_VALUE_SNAPSHOT) + @javax.annotation.Nullable + private Object valueSnapshot; + + public static final String SERIALIZED_NAME_COMPLETED_BY_USER_ID = "completed_by_user_id"; + @SerializedName(SERIALIZED_NAME_COMPLETED_BY_USER_ID) + @javax.annotation.Nullable + private String completedByUserId; + + public static final String SERIALIZED_NAME_COMPLETED_AT = "completed_at"; + @SerializedName(SERIALIZED_NAME_COMPLETED_AT) + @javax.annotation.Nullable + private String completedAt; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private String updatedAt; + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes() { + } + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes catalogEntityChecklistId(@javax.annotation.Nullable String catalogEntityChecklistId) { + this.catalogEntityChecklistId = catalogEntityChecklistId; + return this; + } + + /** + * The ID of the parent checklist + * @return catalogEntityChecklistId + */ + @javax.annotation.Nullable + public String getCatalogEntityChecklistId() { + return catalogEntityChecklistId; + } + + public void setCatalogEntityChecklistId(@javax.annotation.Nullable String catalogEntityChecklistId) { + this.catalogEntityChecklistId = catalogEntityChecklistId; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes catalogChecklistTemplateFieldId(@javax.annotation.Nullable String catalogChecklistTemplateFieldId) { + this.catalogChecklistTemplateFieldId = catalogChecklistTemplateFieldId; + return this; + } + + /** + * The ID of the template field + * @return catalogChecklistTemplateFieldId + */ + @javax.annotation.Nullable + public String getCatalogChecklistTemplateFieldId() { + return catalogChecklistTemplateFieldId; + } + + public void setCatalogChecklistTemplateFieldId(@javax.annotation.Nullable String catalogChecklistTemplateFieldId) { + this.catalogChecklistTemplateFieldId = catalogChecklistTemplateFieldId; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes fieldKey(@javax.annotation.Nullable String fieldKey) { + this.fieldKey = fieldKey; + return this; + } + + /** + * The field key + * @return fieldKey + */ + @javax.annotation.Nullable + public String getFieldKey() { + return fieldKey; + } + + public void setFieldKey(@javax.annotation.Nullable String fieldKey) { + this.fieldKey = fieldKey; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes checked(@javax.annotation.Nullable Boolean checked) { + this.checked = checked; + return this; + } + + /** + * Whether the field is checked + * @return checked + */ + @javax.annotation.Nullable + public Boolean getChecked() { + return checked; + } + + public void setChecked(@javax.annotation.Nullable Boolean checked) { + this.checked = checked; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes valueSnapshot(@javax.annotation.Nullable Object valueSnapshot) { + this.valueSnapshot = valueSnapshot; + return this; + } + + /** + * The value snapshot at time of checking + * @return valueSnapshot + */ + @javax.annotation.Nullable + public Object getValueSnapshot() { + return valueSnapshot; + } + + public void setValueSnapshot(@javax.annotation.Nullable Object valueSnapshot) { + this.valueSnapshot = valueSnapshot; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes completedByUserId(@javax.annotation.Nullable String completedByUserId) { + this.completedByUserId = completedByUserId; + return this; + } + + /** + * The ID of the user who checked the field + * @return completedByUserId + */ + @javax.annotation.Nullable + public String getCompletedByUserId() { + return completedByUserId; + } + + public void setCompletedByUserId(@javax.annotation.Nullable String completedByUserId) { + this.completedByUserId = completedByUserId; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes completedAt(@javax.annotation.Nullable String completedAt) { + this.completedAt = completedAt; + return this; + } + + /** + * When the field was checked + * @return completedAt + */ + @javax.annotation.Nullable + public String getCompletedAt() { + return completedAt; + } + + public void setCompletedAt(@javax.annotation.Nullable String completedAt) { + this.completedAt = completedAt; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes createdAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nullable + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes updatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistChecklistFieldsInnerDataAttributes catalogEntityChecklistChecklistFieldsInnerDataAttributes = (CatalogEntityChecklistChecklistFieldsInnerDataAttributes) o; + return Objects.equals(this.catalogEntityChecklistId, catalogEntityChecklistChecklistFieldsInnerDataAttributes.catalogEntityChecklistId) && + Objects.equals(this.catalogChecklistTemplateFieldId, catalogEntityChecklistChecklistFieldsInnerDataAttributes.catalogChecklistTemplateFieldId) && + Objects.equals(this.fieldKey, catalogEntityChecklistChecklistFieldsInnerDataAttributes.fieldKey) && + Objects.equals(this.checked, catalogEntityChecklistChecklistFieldsInnerDataAttributes.checked) && + Objects.equals(this.valueSnapshot, catalogEntityChecklistChecklistFieldsInnerDataAttributes.valueSnapshot) && + Objects.equals(this.completedByUserId, catalogEntityChecklistChecklistFieldsInnerDataAttributes.completedByUserId) && + Objects.equals(this.completedAt, catalogEntityChecklistChecklistFieldsInnerDataAttributes.completedAt) && + Objects.equals(this.createdAt, catalogEntityChecklistChecklistFieldsInnerDataAttributes.createdAt) && + Objects.equals(this.updatedAt, catalogEntityChecklistChecklistFieldsInnerDataAttributes.updatedAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(catalogEntityChecklistId, catalogChecklistTemplateFieldId, fieldKey, checked, valueSnapshot, completedByUserId, completedAt, createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistChecklistFieldsInnerDataAttributes {\n"); + sb.append(" catalogEntityChecklistId: ").append(toIndentedString(catalogEntityChecklistId)).append("\n"); + sb.append(" catalogChecklistTemplateFieldId: ").append(toIndentedString(catalogChecklistTemplateFieldId)).append("\n"); + sb.append(" fieldKey: ").append(toIndentedString(fieldKey)).append("\n"); + sb.append(" checked: ").append(toIndentedString(checked)).append("\n"); + sb.append(" valueSnapshot: ").append(toIndentedString(valueSnapshot)).append("\n"); + sb.append(" completedByUserId: ").append(toIndentedString(completedByUserId)).append("\n"); + sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("catalog_entity_checklist_id"); + openapiFields.add("catalog_checklist_template_field_id"); + openapiFields.add("field_key"); + openapiFields.add("checked"); + openapiFields.add("value_snapshot"); + openapiFields.add("completed_by_user_id"); + openapiFields.add("completed_at"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistChecklistFieldsInnerDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistChecklistFieldsInnerDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistChecklistFieldsInnerDataAttributes is not found in the empty JSON string", CatalogEntityChecklistChecklistFieldsInnerDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistChecklistFieldsInnerDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistChecklistFieldsInnerDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("catalog_entity_checklist_id") != null && !jsonObj.get("catalog_entity_checklist_id").isJsonNull()) && !jsonObj.get("catalog_entity_checklist_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_entity_checklist_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_entity_checklist_id").toString())); + } + if ((jsonObj.get("catalog_checklist_template_field_id") != null && !jsonObj.get("catalog_checklist_template_field_id").isJsonNull()) && !jsonObj.get("catalog_checklist_template_field_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_checklist_template_field_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_checklist_template_field_id").toString())); + } + if ((jsonObj.get("field_key") != null && !jsonObj.get("field_key").isJsonNull()) && !jsonObj.get("field_key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field_key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field_key").toString())); + } + if ((jsonObj.get("completed_by_user_id") != null && !jsonObj.get("completed_by_user_id").isJsonNull()) && !jsonObj.get("completed_by_user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completed_by_user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completed_by_user_id").toString())); + } + if ((jsonObj.get("completed_at") != null && !jsonObj.get("completed_at").isJsonNull()) && !jsonObj.get("completed_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completed_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completed_at").toString())); + } + if ((jsonObj.get("created_at") != null && !jsonObj.get("created_at").isJsonNull()) && !jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if ((jsonObj.get("updated_at") != null && !jsonObj.get("updated_at").isJsonNull()) && !jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistChecklistFieldsInnerDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistChecklistFieldsInnerDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistChecklistFieldsInnerDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistChecklistFieldsInnerDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistChecklistFieldsInnerDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistChecklistFieldsInnerDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistChecklistFieldsInnerDataAttributes + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistChecklistFieldsInnerDataAttributes + */ + public static CatalogEntityChecklistChecklistFieldsInnerDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistChecklistFieldsInnerDataAttributes.class); + } + + /** + * Convert an instance of CatalogEntityChecklistChecklistFieldsInnerDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInner.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInner.java new file mode 100644 index 00000000..b83ba77a --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInner.java @@ -0,0 +1,208 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistOwnersInnerData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistChecklistOwnersInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistChecklistOwnersInner { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private CatalogEntityChecklistChecklistOwnersInnerData data; + + public CatalogEntityChecklistChecklistOwnersInner() { + } + + public CatalogEntityChecklistChecklistOwnersInner data(@javax.annotation.Nullable CatalogEntityChecklistChecklistOwnersInnerData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public CatalogEntityChecklistChecklistOwnersInnerData getData() { + return data; + } + + public void setData(@javax.annotation.Nullable CatalogEntityChecklistChecklistOwnersInnerData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistChecklistOwnersInner catalogEntityChecklistChecklistOwnersInner = (CatalogEntityChecklistChecklistOwnersInner) o; + return Objects.equals(this.data, catalogEntityChecklistChecklistOwnersInner.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistChecklistOwnersInner {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistChecklistOwnersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistChecklistOwnersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistChecklistOwnersInner is not found in the empty JSON string", CatalogEntityChecklistChecklistOwnersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistChecklistOwnersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistChecklistOwnersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + CatalogEntityChecklistChecklistOwnersInnerData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistChecklistOwnersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistChecklistOwnersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistChecklistOwnersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistChecklistOwnersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistChecklistOwnersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistChecklistOwnersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistChecklistOwnersInner + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistChecklistOwnersInner + */ + public static CatalogEntityChecklistChecklistOwnersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistChecklistOwnersInner.class); + } + + /** + * Convert an instance of CatalogEntityChecklistChecklistOwnersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerData.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerData.java new file mode 100644 index 00000000..84ff3c08 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerData.java @@ -0,0 +1,322 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistOwnersInnerDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistChecklistOwnersInnerData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistChecklistOwnersInnerData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_ENTITY_CHECKLIST_OWNERS("catalog_entity_checklist_owners"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private CatalogEntityChecklistChecklistOwnersInnerDataAttributes attributes; + + public CatalogEntityChecklistChecklistOwnersInnerData() { + } + + public CatalogEntityChecklistChecklistOwnersInnerData id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * ID of the checklist owner + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CatalogEntityChecklistChecklistOwnersInnerData type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public CatalogEntityChecklistChecklistOwnersInnerData attributes(@javax.annotation.Nullable CatalogEntityChecklistChecklistOwnersInnerDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable CatalogEntityChecklistChecklistOwnersInnerDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistChecklistOwnersInnerData catalogEntityChecklistChecklistOwnersInnerData = (CatalogEntityChecklistChecklistOwnersInnerData) o; + return Objects.equals(this.id, catalogEntityChecklistChecklistOwnersInnerData.id) && + Objects.equals(this.type, catalogEntityChecklistChecklistOwnersInnerData.type) && + Objects.equals(this.attributes, catalogEntityChecklistChecklistOwnersInnerData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistChecklistOwnersInnerData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistChecklistOwnersInnerData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistChecklistOwnersInnerData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistChecklistOwnersInnerData is not found in the empty JSON string", CatalogEntityChecklistChecklistOwnersInnerData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistChecklistOwnersInnerData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistChecklistOwnersInnerData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + // validate the optional field `attributes` + if (jsonObj.get("attributes") != null && !jsonObj.get("attributes").isJsonNull()) { + CatalogEntityChecklistChecklistOwnersInnerDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistChecklistOwnersInnerData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistChecklistOwnersInnerData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistChecklistOwnersInnerData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistChecklistOwnersInnerData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistChecklistOwnersInnerData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistChecklistOwnersInnerData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistChecklistOwnersInnerData + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistChecklistOwnersInnerData + */ + public static CatalogEntityChecklistChecklistOwnersInnerData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistChecklistOwnersInnerData.class); + } + + /** + * Convert an instance of CatalogEntityChecklistChecklistOwnersInnerData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataAttributes.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataAttributes.java new file mode 100644 index 00000000..fbb3e10f --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataAttributes.java @@ -0,0 +1,296 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistChecklistOwnersInnerDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistChecklistOwnersInnerDataAttributes { + public static final String SERIALIZED_NAME_CATALOG_ENTITY_CHECKLIST_ID = "catalog_entity_checklist_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_ENTITY_CHECKLIST_ID) + @javax.annotation.Nullable + private String catalogEntityChecklistId; + + public static final String SERIALIZED_NAME_OWNER_USER_ID = "owner_user_id"; + @SerializedName(SERIALIZED_NAME_OWNER_USER_ID) + @javax.annotation.Nullable + private String ownerUserId; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private String updatedAt; + + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes() { + } + + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes catalogEntityChecklistId(@javax.annotation.Nullable String catalogEntityChecklistId) { + this.catalogEntityChecklistId = catalogEntityChecklistId; + return this; + } + + /** + * The ID of the parent checklist + * @return catalogEntityChecklistId + */ + @javax.annotation.Nullable + public String getCatalogEntityChecklistId() { + return catalogEntityChecklistId; + } + + public void setCatalogEntityChecklistId(@javax.annotation.Nullable String catalogEntityChecklistId) { + this.catalogEntityChecklistId = catalogEntityChecklistId; + } + + + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes ownerUserId(@javax.annotation.Nullable String ownerUserId) { + this.ownerUserId = ownerUserId; + return this; + } + + /** + * The ID of the owner user + * @return ownerUserId + */ + @javax.annotation.Nullable + public String getOwnerUserId() { + return ownerUserId; + } + + public void setOwnerUserId(@javax.annotation.Nullable String ownerUserId) { + this.ownerUserId = ownerUserId; + } + + + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes createdAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nullable + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes updatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistChecklistOwnersInnerDataAttributes catalogEntityChecklistChecklistOwnersInnerDataAttributes = (CatalogEntityChecklistChecklistOwnersInnerDataAttributes) o; + return Objects.equals(this.catalogEntityChecklistId, catalogEntityChecklistChecklistOwnersInnerDataAttributes.catalogEntityChecklistId) && + Objects.equals(this.ownerUserId, catalogEntityChecklistChecklistOwnersInnerDataAttributes.ownerUserId) && + Objects.equals(this.createdAt, catalogEntityChecklistChecklistOwnersInnerDataAttributes.createdAt) && + Objects.equals(this.updatedAt, catalogEntityChecklistChecklistOwnersInnerDataAttributes.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(catalogEntityChecklistId, ownerUserId, createdAt, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistChecklistOwnersInnerDataAttributes {\n"); + sb.append(" catalogEntityChecklistId: ").append(toIndentedString(catalogEntityChecklistId)).append("\n"); + sb.append(" ownerUserId: ").append(toIndentedString(ownerUserId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("catalog_entity_checklist_id"); + openapiFields.add("owner_user_id"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistChecklistOwnersInnerDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistChecklistOwnersInnerDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistChecklistOwnersInnerDataAttributes is not found in the empty JSON string", CatalogEntityChecklistChecklistOwnersInnerDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistChecklistOwnersInnerDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistChecklistOwnersInnerDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("catalog_entity_checklist_id") != null && !jsonObj.get("catalog_entity_checklist_id").isJsonNull()) && !jsonObj.get("catalog_entity_checklist_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_entity_checklist_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_entity_checklist_id").toString())); + } + if ((jsonObj.get("owner_user_id") != null && !jsonObj.get("owner_user_id").isJsonNull()) && !jsonObj.get("owner_user_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `owner_user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("owner_user_id").toString())); + } + if ((jsonObj.get("created_at") != null && !jsonObj.get("created_at").isJsonNull()) && !jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if ((jsonObj.get("updated_at") != null && !jsonObj.get("updated_at").isJsonNull()) && !jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistChecklistOwnersInnerDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistChecklistOwnersInnerDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistChecklistOwnersInnerDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistChecklistOwnersInnerDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistChecklistOwnersInnerDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistChecklistOwnersInnerDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistChecklistOwnersInnerDataAttributes + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistChecklistOwnersInnerDataAttributes + */ + public static CatalogEntityChecklistChecklistOwnersInnerDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistChecklistOwnersInnerDataAttributes.class); + } + + /** + * Convert an instance of CatalogEntityChecklistChecklistOwnersInnerDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistList.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistList.java new file mode 100644 index 00000000..75f33756 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistList.java @@ -0,0 +1,296 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nullable + private Links links; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nullable + private Meta meta; + + public CatalogEntityChecklistList() { + } + + public CatalogEntityChecklistList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public CatalogEntityChecklistList addDataItem(CatalogEntityChecklistResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public CatalogEntityChecklistList links(@javax.annotation.Nullable Links links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nullable + public Links getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nullable Links links) { + this.links = links; + } + + + public CatalogEntityChecklistList meta(@javax.annotation.Nullable Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nullable + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nullable Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistList catalogEntityChecklistList = (CatalogEntityChecklistList) o; + return Objects.equals(this.data, catalogEntityChecklistList.data) && + Objects.equals(this.links, catalogEntityChecklistList.links) && + Objects.equals(this.meta, catalogEntityChecklistList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistList {\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("}"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("links"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistList is not found in the empty JSON string", CatalogEntityChecklistList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogEntityChecklistList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + CatalogEntityChecklistResponseData.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `links` + if (jsonObj.get("links") != null && !jsonObj.get("links").isJsonNull()) { + Links.validateJsonElement(jsonObj.get("links")); + } + // validate the optional field `meta` + if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { + Meta.validateJsonElement(jsonObj.get("meta")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistList + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistList + */ + public static CatalogEntityChecklistList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistList.class); + } + + /** + * Convert an instance of CatalogEntityChecklistList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistResponse.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistResponse.java new file mode 100644 index 00000000..2b96030e --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private CatalogEntityChecklistResponseData data; + + public CatalogEntityChecklistResponse() { + } + + public CatalogEntityChecklistResponse data(@javax.annotation.Nonnull CatalogEntityChecklistResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public CatalogEntityChecklistResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull CatalogEntityChecklistResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistResponse catalogEntityChecklistResponse = (CatalogEntityChecklistResponse) o; + return Objects.equals(this.data, catalogEntityChecklistResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistResponse is not found in the empty JSON string", CatalogEntityChecklistResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogEntityChecklistResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + CatalogEntityChecklistResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistResponse + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistResponse + */ + public static CatalogEntityChecklistResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistResponse.class); + } + + /** + * Convert an instance of CatalogEntityChecklistResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogEntityChecklistResponseData.java b/src/main/java/com/rootly/client/model/CatalogEntityChecklistResponseData.java new file mode 100644 index 00000000..4da0881e --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogEntityChecklistResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklist; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogEntityChecklistResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogEntityChecklistResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_ENTITY_CHECKLISTS("catalog_entity_checklists"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private CatalogEntityChecklist attributes; + + public CatalogEntityChecklistResponseData() { + } + + public CatalogEntityChecklistResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the entity checklist + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public CatalogEntityChecklistResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public CatalogEntityChecklistResponseData attributes(@javax.annotation.Nonnull CatalogEntityChecklist attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public CatalogEntityChecklist getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull CatalogEntityChecklist attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogEntityChecklistResponseData catalogEntityChecklistResponseData = (CatalogEntityChecklistResponseData) o; + return Objects.equals(this.id, catalogEntityChecklistResponseData.id) && + Objects.equals(this.type, catalogEntityChecklistResponseData.type) && + Objects.equals(this.attributes, catalogEntityChecklistResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogEntityChecklistResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogEntityChecklistResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogEntityChecklistResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogEntityChecklistResponseData is not found in the empty JSON string", CatalogEntityChecklistResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogEntityChecklistResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogEntityChecklistResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogEntityChecklistResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + CatalogEntityChecklist.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogEntityChecklistResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogEntityChecklistResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogEntityChecklistResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogEntityChecklistResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogEntityChecklistResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogEntityChecklistResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogEntityChecklistResponseData + * @throws IOException if the JSON string is invalid with respect to CatalogEntityChecklistResponseData + */ + public static CatalogEntityChecklistResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogEntityChecklistResponseData.class); + } + + /** + * Convert an instance of CatalogEntityChecklistResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogProperty.java b/src/main/java/com/rootly/client/model/CatalogProperty.java new file mode 100644 index 00000000..892b4e52 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogProperty.java @@ -0,0 +1,643 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogProperty + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogProperty { + public static final String SERIALIZED_NAME_CATALOG_ID = "catalog_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_ID) + @javax.annotation.Nullable + private String catalogId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_SLUG = "slug"; + @SerializedName(SERIALIZED_NAME_SLUG) + @javax.annotation.Nullable + private String slug; + + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + TEXT("text"), + + REFERENCE("reference"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + public static final String SERIALIZED_NAME_KIND_CATALOG_ID = "kind_catalog_id"; + @SerializedName(SERIALIZED_NAME_KIND_CATALOG_ID) + @javax.annotation.Nullable + private String kindCatalogId; + + public static final String SERIALIZED_NAME_MULTIPLE = "multiple"; + @SerializedName(SERIALIZED_NAME_MULTIPLE) + @javax.annotation.Nonnull + private Boolean multiple; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public static final String SERIALIZED_NAME_REQUIRED = "required"; + @SerializedName(SERIALIZED_NAME_REQUIRED) + @javax.annotation.Nullable + private Boolean required; + + /** + * The type of catalog the property belongs to. + */ + @JsonAdapter(CatalogTypeEnum.Adapter.class) + public enum CatalogTypeEnum { + CATALOG("catalog"), + + CAUSE("cause"), + + ENVIRONMENT("environment"), + + FUNCTIONALITY("functionality"), + + INCIDENT_TYPE("incident_type"), + + SERVICE("service"), + + TEAM("team"); + + private String value; + + CatalogTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CatalogTypeEnum fromValue(String value) { + for (CatalogTypeEnum b : CatalogTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CatalogTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CatalogTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CatalogTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CatalogTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CATALOG_TYPE = "catalog_type"; + @SerializedName(SERIALIZED_NAME_CATALOG_TYPE) + @javax.annotation.Nullable + private CatalogTypeEnum catalogType; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private String updatedAt; + + public CatalogProperty() { + } + + public CatalogProperty catalogId(@javax.annotation.Nullable String catalogId) { + this.catalogId = catalogId; + return this; + } + + /** + * Get catalogId + * @return catalogId + */ + @javax.annotation.Nullable + public String getCatalogId() { + return catalogId; + } + + public void setCatalogId(@javax.annotation.Nullable String catalogId) { + this.catalogId = catalogId; + } + + + public CatalogProperty name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CatalogProperty slug(@javax.annotation.Nullable String slug) { + this.slug = slug; + return this; + } + + /** + * Get slug + * @return slug + */ + @javax.annotation.Nullable + public String getSlug() { + return slug; + } + + public void setSlug(@javax.annotation.Nullable String slug) { + this.slug = slug; + } + + + public CatalogProperty kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public CatalogProperty kindCatalogId(@javax.annotation.Nullable String kindCatalogId) { + this.kindCatalogId = kindCatalogId; + return this; + } + + /** + * Restricts values to items of specified catalog. + * @return kindCatalogId + */ + @javax.annotation.Nullable + public String getKindCatalogId() { + return kindCatalogId; + } + + public void setKindCatalogId(@javax.annotation.Nullable String kindCatalogId) { + this.kindCatalogId = kindCatalogId; + } + + + public CatalogProperty multiple(@javax.annotation.Nonnull Boolean multiple) { + this.multiple = multiple; + return this; + } + + /** + * Whether the attribute accepts multiple values. + * @return multiple + */ + @javax.annotation.Nonnull + public Boolean getMultiple() { + return multiple; + } + + public void setMultiple(@javax.annotation.Nonnull Boolean multiple) { + this.multiple = multiple; + } + + + public CatalogProperty position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Default position of the item when displayed in a list. + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public CatalogProperty required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Whether the property is required. + * @return required + */ + @javax.annotation.Nullable + public Boolean getRequired() { + return required; + } + + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public CatalogProperty catalogType(@javax.annotation.Nullable CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + return this; + } + + /** + * The type of catalog the property belongs to. + * @return catalogType + */ + @javax.annotation.Nullable + public CatalogTypeEnum getCatalogType() { + return catalogType; + } + + public void setCatalogType(@javax.annotation.Nullable CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + } + + + public CatalogProperty createdAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + } + + + public CatalogProperty updatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogProperty catalogProperty = (CatalogProperty) o; + return Objects.equals(this.catalogId, catalogProperty.catalogId) && + Objects.equals(this.name, catalogProperty.name) && + Objects.equals(this.slug, catalogProperty.slug) && + Objects.equals(this.kind, catalogProperty.kind) && + Objects.equals(this.kindCatalogId, catalogProperty.kindCatalogId) && + Objects.equals(this.multiple, catalogProperty.multiple) && + Objects.equals(this.position, catalogProperty.position) && + Objects.equals(this.required, catalogProperty.required) && + Objects.equals(this.catalogType, catalogProperty.catalogType) && + Objects.equals(this.createdAt, catalogProperty.createdAt) && + Objects.equals(this.updatedAt, catalogProperty.updatedAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(catalogId, name, slug, kind, kindCatalogId, multiple, position, required, catalogType, createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogProperty {\n"); + sb.append(" catalogId: ").append(toIndentedString(catalogId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" kindCatalogId: ").append(toIndentedString(kindCatalogId)).append("\n"); + sb.append(" multiple: ").append(toIndentedString(multiple)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" catalogType: ").append(toIndentedString(catalogType)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("catalog_id"); + openapiFields.add("name"); + openapiFields.add("slug"); + openapiFields.add("kind"); + openapiFields.add("kind_catalog_id"); + openapiFields.add("multiple"); + openapiFields.add("position"); + openapiFields.add("required"); + openapiFields.add("catalog_type"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("catalog_id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("kind"); + openapiRequiredFields.add("multiple"); + openapiRequiredFields.add("position"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogProperty + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogProperty.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogProperty is not found in the empty JSON string", CatalogProperty.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogProperty.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogProperty` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogProperty.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("catalog_id") != null && !jsonObj.get("catalog_id").isJsonNull()) && !jsonObj.get("catalog_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_id").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("slug") != null && !jsonObj.get("slug").isJsonNull()) && !jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); + } + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if ((jsonObj.get("kind_catalog_id") != null && !jsonObj.get("kind_catalog_id").isJsonNull()) && !jsonObj.get("kind_catalog_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind_catalog_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind_catalog_id").toString())); + } + if ((jsonObj.get("catalog_type") != null && !jsonObj.get("catalog_type").isJsonNull()) && !jsonObj.get("catalog_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_type").toString())); + } + // validate the optional field `catalog_type` + if (jsonObj.get("catalog_type") != null && !jsonObj.get("catalog_type").isJsonNull()) { + CatalogTypeEnum.validateJsonElement(jsonObj.get("catalog_type")); + } + if (!jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if (!jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogProperty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogProperty' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogProperty.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogProperty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogProperty read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogProperty given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogProperty + * @throws IOException if the JSON string is invalid with respect to CatalogProperty + */ + public static CatalogProperty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogProperty.class); + } + + /** + * Convert an instance of CatalogProperty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogPropertyList.java b/src/main/java/com/rootly/client/model/CatalogPropertyList.java new file mode 100644 index 00000000..4144ea8d --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogPropertyList.java @@ -0,0 +1,294 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogPropertyResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogPropertyList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogPropertyList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private Links links; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public CatalogPropertyList() { + } + + public CatalogPropertyList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public CatalogPropertyList addDataItem(CatalogPropertyResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public CatalogPropertyList links(@javax.annotation.Nonnull Links links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public Links getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull Links links) { + this.links = links; + } + + + public CatalogPropertyList meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogPropertyList catalogPropertyList = (CatalogPropertyList) o; + return Objects.equals(this.data, catalogPropertyList.data) && + Objects.equals(this.links, catalogPropertyList.links) && + Objects.equals(this.meta, catalogPropertyList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogPropertyList {\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("}"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("links"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("links"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogPropertyList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogPropertyList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogPropertyList is not found in the empty JSON string", CatalogPropertyList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogPropertyList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogPropertyList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogPropertyList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + CatalogPropertyResponseData.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `links` + Links.validateJsonElement(jsonObj.get("links")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogPropertyList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogPropertyList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogPropertyList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogPropertyList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogPropertyList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogPropertyList given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogPropertyList + * @throws IOException if the JSON string is invalid with respect to CatalogPropertyList + */ + public static CatalogPropertyList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogPropertyList.class); + } + + /** + * Convert an instance of CatalogPropertyList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogPropertyResponse.java b/src/main/java/com/rootly/client/model/CatalogPropertyResponse.java new file mode 100644 index 00000000..33372392 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogPropertyResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogPropertyResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogPropertyResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogPropertyResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private CatalogPropertyResponseData data; + + public CatalogPropertyResponse() { + } + + public CatalogPropertyResponse data(@javax.annotation.Nonnull CatalogPropertyResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public CatalogPropertyResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull CatalogPropertyResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogPropertyResponse catalogPropertyResponse = (CatalogPropertyResponse) o; + return Objects.equals(this.data, catalogPropertyResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogPropertyResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogPropertyResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogPropertyResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogPropertyResponse is not found in the empty JSON string", CatalogPropertyResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogPropertyResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogPropertyResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogPropertyResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + CatalogPropertyResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogPropertyResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogPropertyResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogPropertyResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogPropertyResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogPropertyResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogPropertyResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogPropertyResponse + * @throws IOException if the JSON string is invalid with respect to CatalogPropertyResponse + */ + public static CatalogPropertyResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogPropertyResponse.class); + } + + /** + * Convert an instance of CatalogPropertyResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CatalogPropertyResponseData.java b/src/main/java/com/rootly/client/model/CatalogPropertyResponseData.java new file mode 100644 index 00000000..f63b4162 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CatalogPropertyResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogProperty; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CatalogPropertyResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CatalogPropertyResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_PROPERTIES("catalog_properties"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private CatalogProperty attributes; + + public CatalogPropertyResponseData() { + } + + public CatalogPropertyResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the catalog_property + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public CatalogPropertyResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public CatalogPropertyResponseData attributes(@javax.annotation.Nonnull CatalogProperty attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public CatalogProperty getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull CatalogProperty attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatalogPropertyResponseData catalogPropertyResponseData = (CatalogPropertyResponseData) o; + return Objects.equals(this.id, catalogPropertyResponseData.id) && + Objects.equals(this.type, catalogPropertyResponseData.type) && + Objects.equals(this.attributes, catalogPropertyResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatalogPropertyResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CatalogPropertyResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CatalogPropertyResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CatalogPropertyResponseData is not found in the empty JSON string", CatalogPropertyResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CatalogPropertyResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatalogPropertyResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CatalogPropertyResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + CatalogProperty.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CatalogPropertyResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CatalogPropertyResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CatalogPropertyResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CatalogPropertyResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CatalogPropertyResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CatalogPropertyResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatalogPropertyResponseData + * @throws IOException if the JSON string is invalid with respect to CatalogPropertyResponseData + */ + public static CatalogPropertyResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatalogPropertyResponseData.class); + } + + /** + * Convert an instance of CatalogPropertyResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerData.java b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerData.java new file mode 100644 index 00000000..04ee1276 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerData.java @@ -0,0 +1,322 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CommunicationsTemplateCommunicationTemplateStagesInnerData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CommunicationsTemplateCommunicationTemplateStagesInnerData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + COMMUNICATIONS_TEMPLATE_STAGES("communications_template_stages"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes attributes; + + public CommunicationsTemplateCommunicationTemplateStagesInnerData() { + } + + public CommunicationsTemplateCommunicationTemplateStagesInnerData id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * ID of the communication template stage + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerData type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerData attributes(@javax.annotation.Nullable CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommunicationsTemplateCommunicationTemplateStagesInnerData communicationsTemplateCommunicationTemplateStagesInnerData = (CommunicationsTemplateCommunicationTemplateStagesInnerData) o; + return Objects.equals(this.id, communicationsTemplateCommunicationTemplateStagesInnerData.id) && + Objects.equals(this.type, communicationsTemplateCommunicationTemplateStagesInnerData.type) && + Objects.equals(this.attributes, communicationsTemplateCommunicationTemplateStagesInnerData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommunicationsTemplateCommunicationTemplateStagesInnerData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommunicationsTemplateCommunicationTemplateStagesInnerData is not found in the empty JSON string", CommunicationsTemplateCommunicationTemplateStagesInnerData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommunicationsTemplateCommunicationTemplateStagesInnerData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + // validate the optional field `attributes` + if (jsonObj.get("attributes") != null && !jsonObj.get("attributes").isJsonNull()) { + CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommunicationsTemplateCommunicationTemplateStagesInnerData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommunicationsTemplateCommunicationTemplateStagesInnerData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommunicationsTemplateCommunicationTemplateStagesInnerData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommunicationsTemplateCommunicationTemplateStagesInnerData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommunicationsTemplateCommunicationTemplateStagesInnerData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommunicationsTemplateCommunicationTemplateStagesInnerData + * @throws IOException if the JSON string is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerData + */ + public static CommunicationsTemplateCommunicationTemplateStagesInnerData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommunicationsTemplateCommunicationTemplateStagesInnerData.class); + } + + /** + * Convert an instance of CommunicationsTemplateCommunicationTemplateStagesInnerData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.java b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.java new file mode 100644 index 00000000..c7915871 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.java @@ -0,0 +1,432 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage; +import com.rootly.client.model.CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes { + public static final String SERIALIZED_NAME_EMAIL_BODY = "email_body"; + @SerializedName(SERIALIZED_NAME_EMAIL_BODY) + @javax.annotation.Nullable + private String emailBody; + + public static final String SERIALIZED_NAME_EMAIL_SUBJECT = "email_subject"; + @SerializedName(SERIALIZED_NAME_EMAIL_SUBJECT) + @javax.annotation.Nullable + private String emailSubject; + + public static final String SERIALIZED_NAME_SLACK_CONTENT = "slack_content"; + @SerializedName(SERIALIZED_NAME_SLACK_CONTENT) + @javax.annotation.Nullable + private String slackContent; + + public static final String SERIALIZED_NAME_SMS_CONTENT = "sms_content"; + @SerializedName(SERIALIZED_NAME_SMS_CONTENT) + @javax.annotation.Nullable + private String smsContent; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private String updatedAt; + + public static final String SERIALIZED_NAME_COMMUNICATION_STAGE = "communication_stage"; + @SerializedName(SERIALIZED_NAME_COMMUNICATION_STAGE) + @javax.annotation.Nullable + private CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage communicationStage; + + public static final String SERIALIZED_NAME_COMMUNICATION_TEMPLATE = "communication_template"; + @SerializedName(SERIALIZED_NAME_COMMUNICATION_TEMPLATE) + @javax.annotation.Nullable + private CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate communicationTemplate; + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes() { + } + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes emailBody(@javax.annotation.Nullable String emailBody) { + this.emailBody = emailBody; + return this; + } + + /** + * Email body for the stage + * @return emailBody + */ + @javax.annotation.Nullable + public String getEmailBody() { + return emailBody; + } + + public void setEmailBody(@javax.annotation.Nullable String emailBody) { + this.emailBody = emailBody; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes emailSubject(@javax.annotation.Nullable String emailSubject) { + this.emailSubject = emailSubject; + return this; + } + + /** + * Email subject for the stage + * @return emailSubject + */ + @javax.annotation.Nullable + public String getEmailSubject() { + return emailSubject; + } + + public void setEmailSubject(@javax.annotation.Nullable String emailSubject) { + this.emailSubject = emailSubject; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes slackContent(@javax.annotation.Nullable String slackContent) { + this.slackContent = slackContent; + return this; + } + + /** + * Slack content for the stage + * @return slackContent + */ + @javax.annotation.Nullable + public String getSlackContent() { + return slackContent; + } + + public void setSlackContent(@javax.annotation.Nullable String slackContent) { + this.slackContent = slackContent; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes smsContent(@javax.annotation.Nullable String smsContent) { + this.smsContent = smsContent; + return this; + } + + /** + * SMS content for the stage + * @return smsContent + */ + @javax.annotation.Nullable + public String getSmsContent() { + return smsContent; + } + + public void setSmsContent(@javax.annotation.Nullable String smsContent) { + this.smsContent = smsContent; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes createdAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nullable + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes updatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes communicationStage(@javax.annotation.Nullable CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage communicationStage) { + this.communicationStage = communicationStage; + return this; + } + + /** + * Get communicationStage + * @return communicationStage + */ + @javax.annotation.Nullable + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage getCommunicationStage() { + return communicationStage; + } + + public void setCommunicationStage(@javax.annotation.Nullable CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage communicationStage) { + this.communicationStage = communicationStage; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes communicationTemplate(@javax.annotation.Nullable CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate communicationTemplate) { + this.communicationTemplate = communicationTemplate; + return this; + } + + /** + * Get communicationTemplate + * @return communicationTemplate + */ + @javax.annotation.Nullable + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate getCommunicationTemplate() { + return communicationTemplate; + } + + public void setCommunicationTemplate(@javax.annotation.Nullable CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate communicationTemplate) { + this.communicationTemplate = communicationTemplate; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes communicationsTemplateCommunicationTemplateStagesInnerDataAttributes = (CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes) o; + return Objects.equals(this.emailBody, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.emailBody) && + Objects.equals(this.emailSubject, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.emailSubject) && + Objects.equals(this.slackContent, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.slackContent) && + Objects.equals(this.smsContent, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.smsContent) && + Objects.equals(this.createdAt, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.createdAt) && + Objects.equals(this.updatedAt, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.updatedAt) && + Objects.equals(this.communicationStage, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.communicationStage) && + Objects.equals(this.communicationTemplate, communicationsTemplateCommunicationTemplateStagesInnerDataAttributes.communicationTemplate); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(emailBody, emailSubject, slackContent, smsContent, createdAt, updatedAt, communicationStage, communicationTemplate); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes {\n"); + sb.append(" emailBody: ").append(toIndentedString(emailBody)).append("\n"); + sb.append(" emailSubject: ").append(toIndentedString(emailSubject)).append("\n"); + sb.append(" slackContent: ").append(toIndentedString(slackContent)).append("\n"); + sb.append(" smsContent: ").append(toIndentedString(smsContent)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" communicationStage: ").append(toIndentedString(communicationStage)).append("\n"); + sb.append(" communicationTemplate: ").append(toIndentedString(communicationTemplate)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("email_body"); + openapiFields.add("email_subject"); + openapiFields.add("slack_content"); + openapiFields.add("sms_content"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + openapiFields.add("communication_stage"); + openapiFields.add("communication_template"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes is not found in the empty JSON string", CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email_body") != null && !jsonObj.get("email_body").isJsonNull()) && !jsonObj.get("email_body").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email_body` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email_body").toString())); + } + if ((jsonObj.get("email_subject") != null && !jsonObj.get("email_subject").isJsonNull()) && !jsonObj.get("email_subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email_subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email_subject").toString())); + } + if ((jsonObj.get("slack_content") != null && !jsonObj.get("slack_content").isJsonNull()) && !jsonObj.get("slack_content").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `slack_content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slack_content").toString())); + } + if ((jsonObj.get("sms_content") != null && !jsonObj.get("sms_content").isJsonNull()) && !jsonObj.get("sms_content").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sms_content` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sms_content").toString())); + } + if ((jsonObj.get("created_at") != null && !jsonObj.get("created_at").isJsonNull()) && !jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if ((jsonObj.get("updated_at") != null && !jsonObj.get("updated_at").isJsonNull()) && !jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + // validate the optional field `communication_stage` + if (jsonObj.get("communication_stage") != null && !jsonObj.get("communication_stage").isJsonNull()) { + CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.validateJsonElement(jsonObj.get("communication_stage")); + } + // validate the optional field `communication_template` + if (jsonObj.get("communication_template") != null && !jsonObj.get("communication_template").isJsonNull()) { + CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.validateJsonElement(jsonObj.get("communication_template")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + * @throws IOException if the JSON string is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + */ + public static CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes.class); + } + + /** + * Convert an instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.java b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.java new file mode 100644 index 00000000..a460676e --- /dev/null +++ b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.java @@ -0,0 +1,236 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage() { + } + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The communication stage ID + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The communication stage name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage communicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage = (CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage) o; + return Objects.equals(this.id, communicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.id) && + Objects.equals(this.name, communicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage is not found in the empty JSON string", CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + * @throws IOException if the JSON string is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + */ + public static CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage.class); + } + + /** + * Convert an instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.java b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.java new file mode 100644 index 00000000..e14b6a72 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.java @@ -0,0 +1,236 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate() { + } + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The communication template ID + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The communication template name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate communicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate = (CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate) o; + return Objects.equals(this.id, communicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.id) && + Objects.equals(this.name, communicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate is not found in the empty JSON string", CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + * @throws IOException if the JSON string is invalid with respect to CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + */ + public static CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate.class); + } + + /** + * Convert an instance of CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequest.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequest.java new file mode 100644 index 00000000..8474f94e --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequest.java @@ -0,0 +1,208 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorActionRequestAction; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorActionRequest + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorActionRequest { + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + @javax.annotation.Nullable + private CreateEdgeConnectorActionRequestAction action; + + public CreateEdgeConnectorActionRequest() { + } + + public CreateEdgeConnectorActionRequest action(@javax.annotation.Nullable CreateEdgeConnectorActionRequestAction action) { + this.action = action; + return this; + } + + /** + * Get action + * @return action + */ + @javax.annotation.Nullable + public CreateEdgeConnectorActionRequestAction getAction() { + return action; + } + + public void setAction(@javax.annotation.Nullable CreateEdgeConnectorActionRequestAction action) { + this.action = action; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorActionRequest createEdgeConnectorActionRequest = (CreateEdgeConnectorActionRequest) o; + return Objects.equals(this.action, createEdgeConnectorActionRequest.action); + } + + @Override + public int hashCode() { + return Objects.hash(action); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorActionRequest {\n"); + sb.append(" action: ").append(toIndentedString(action)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("action"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorActionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorActionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorActionRequest is not found in the empty JSON string", CreateEdgeConnectorActionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorActionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorActionRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `action` + if (jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) { + CreateEdgeConnectorActionRequestAction.validateJsonElement(jsonObj.get("action")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorActionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorActionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorActionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorActionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorActionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorActionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorActionRequest + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorActionRequest + */ + public static CreateEdgeConnectorActionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorActionRequest.class); + } + + /** + * Convert an instance of CreateEdgeConnectorActionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestAction.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestAction.java new file mode 100644 index 00000000..146518cc --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestAction.java @@ -0,0 +1,331 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorActionRequestActionMetadata; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorActionRequestAction + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorActionRequestAction { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + /** + * Action type + */ + @JsonAdapter(ActionTypeEnum.Adapter.class) + public enum ActionTypeEnum { + SCRIPT("script"), + + HTTP("http"); + + private String value; + + ActionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActionTypeEnum fromValue(String value) { + for (ActionTypeEnum b : ActionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ActionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ACTION_TYPE = "action_type"; + @SerializedName(SERIALIZED_NAME_ACTION_TYPE) + @javax.annotation.Nonnull + private ActionTypeEnum actionType; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private CreateEdgeConnectorActionRequestActionMetadata metadata; + + public CreateEdgeConnectorActionRequestAction() { + } + + public CreateEdgeConnectorActionRequestAction name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Action name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CreateEdgeConnectorActionRequestAction actionType(@javax.annotation.Nonnull ActionTypeEnum actionType) { + this.actionType = actionType; + return this; + } + + /** + * Action type + * @return actionType + */ + @javax.annotation.Nonnull + public ActionTypeEnum getActionType() { + return actionType; + } + + public void setActionType(@javax.annotation.Nonnull ActionTypeEnum actionType) { + this.actionType = actionType; + } + + + public CreateEdgeConnectorActionRequestAction metadata(@javax.annotation.Nullable CreateEdgeConnectorActionRequestActionMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public CreateEdgeConnectorActionRequestActionMetadata getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable CreateEdgeConnectorActionRequestActionMetadata metadata) { + this.metadata = metadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorActionRequestAction createEdgeConnectorActionRequestAction = (CreateEdgeConnectorActionRequestAction) o; + return Objects.equals(this.name, createEdgeConnectorActionRequestAction.name) && + Objects.equals(this.actionType, createEdgeConnectorActionRequestAction.actionType) && + Objects.equals(this.metadata, createEdgeConnectorActionRequestAction.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(name, actionType, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorActionRequestAction {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" actionType: ").append(toIndentedString(actionType)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("action_type"); + openapiFields.add("metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("action_type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorActionRequestAction + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorActionRequestAction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorActionRequestAction is not found in the empty JSON string", CreateEdgeConnectorActionRequestAction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorActionRequestAction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorActionRequestAction` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEdgeConnectorActionRequestAction.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("action_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action_type").toString())); + } + // validate the required field `action_type` + ActionTypeEnum.validateJsonElement(jsonObj.get("action_type")); + // validate the optional field `metadata` + if (jsonObj.get("metadata") != null && !jsonObj.get("metadata").isJsonNull()) { + CreateEdgeConnectorActionRequestActionMetadata.validateJsonElement(jsonObj.get("metadata")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorActionRequestAction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorActionRequestAction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorActionRequestAction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorActionRequestAction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorActionRequestAction read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorActionRequestAction given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorActionRequestAction + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorActionRequestAction + */ + public static CreateEdgeConnectorActionRequestAction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorActionRequestAction.class); + } + + /** + * Convert an instance of CreateEdgeConnectorActionRequestAction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadata.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadata.java new file mode 100644 index 00000000..f3f7ed89 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadata.java @@ -0,0 +1,285 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorActionRequestActionMetadataParametersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorActionRequestActionMetadata + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorActionRequestActionMetadata { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) + @javax.annotation.Nullable + private Integer timeout; + + public static final String SERIALIZED_NAME_PARAMETERS = "parameters"; + @SerializedName(SERIALIZED_NAME_PARAMETERS) + @javax.annotation.Nullable + private List parameters = new ArrayList<>(); + + public CreateEdgeConnectorActionRequestActionMetadata() { + } + + public CreateEdgeConnectorActionRequestActionMetadata description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public CreateEdgeConnectorActionRequestActionMetadata timeout(@javax.annotation.Nullable Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get timeout + * @return timeout + */ + @javax.annotation.Nullable + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(@javax.annotation.Nullable Integer timeout) { + this.timeout = timeout; + } + + + public CreateEdgeConnectorActionRequestActionMetadata parameters(@javax.annotation.Nullable List parameters) { + this.parameters = parameters; + return this; + } + + public CreateEdgeConnectorActionRequestActionMetadata addParametersItem(CreateEdgeConnectorActionRequestActionMetadataParametersInner parametersItem) { + if (this.parameters == null) { + this.parameters = new ArrayList<>(); + } + this.parameters.add(parametersItem); + return this; + } + + /** + * Get parameters + * @return parameters + */ + @javax.annotation.Nullable + public List getParameters() { + return parameters; + } + + public void setParameters(@javax.annotation.Nullable List parameters) { + this.parameters = parameters; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorActionRequestActionMetadata createEdgeConnectorActionRequestActionMetadata = (CreateEdgeConnectorActionRequestActionMetadata) o; + return Objects.equals(this.description, createEdgeConnectorActionRequestActionMetadata.description) && + Objects.equals(this.timeout, createEdgeConnectorActionRequestActionMetadata.timeout) && + Objects.equals(this.parameters, createEdgeConnectorActionRequestActionMetadata.parameters); + } + + @Override + public int hashCode() { + return Objects.hash(description, timeout, parameters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorActionRequestActionMetadata {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("description"); + openapiFields.add("timeout"); + openapiFields.add("parameters"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorActionRequestActionMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorActionRequestActionMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorActionRequestActionMetadata is not found in the empty JSON string", CreateEdgeConnectorActionRequestActionMetadata.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorActionRequestActionMetadata.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorActionRequestActionMetadata` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (jsonObj.get("parameters") != null && !jsonObj.get("parameters").isJsonNull()) { + JsonArray jsonArrayparameters = jsonObj.getAsJsonArray("parameters"); + if (jsonArrayparameters != null) { + // ensure the json data is an array + if (!jsonObj.get("parameters").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `parameters` to be an array in the JSON string but got `%s`", jsonObj.get("parameters").toString())); + } + + // validate the optional field `parameters` (array) + for (int i = 0; i < jsonArrayparameters.size(); i++) { + CreateEdgeConnectorActionRequestActionMetadataParametersInner.validateJsonElement(jsonArrayparameters.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorActionRequestActionMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorActionRequestActionMetadata' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorActionRequestActionMetadata.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorActionRequestActionMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorActionRequestActionMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorActionRequestActionMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorActionRequestActionMetadata + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorActionRequestActionMetadata + */ + public static CreateEdgeConnectorActionRequestActionMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorActionRequestActionMetadata.class); + } + + /** + * Convert an instance of CreateEdgeConnectorActionRequestActionMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataParametersInner.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataParametersInner.java new file mode 100644 index 00000000..1ace247c --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataParametersInner.java @@ -0,0 +1,392 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorActionRequestActionMetadataParametersInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorActionRequestActionMetadataParametersInner { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + STRING("string"), + + NUMBER("number"), + + BOOLEAN("boolean"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public static final String SERIALIZED_NAME_REQUIRED = "required"; + @SerializedName(SERIALIZED_NAME_REQUIRED) + @javax.annotation.Nullable + private Boolean required; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_OPTIONS = "options"; + @SerializedName(SERIALIZED_NAME_OPTIONS) + @javax.annotation.Nullable + private List options = new ArrayList<>(); + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner() { + } + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Get required + * @return required + */ + @javax.annotation.Nullable + public Boolean getRequired() { + return required; + } + + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner options(@javax.annotation.Nullable List options) { + this.options = options; + return this; + } + + public CreateEdgeConnectorActionRequestActionMetadataParametersInner addOptionsItem(String optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } + this.options.add(optionsItem); + return this; + } + + /** + * Get options + * @return options + */ + @javax.annotation.Nullable + public List getOptions() { + return options; + } + + public void setOptions(@javax.annotation.Nullable List options) { + this.options = options; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorActionRequestActionMetadataParametersInner createEdgeConnectorActionRequestActionMetadataParametersInner = (CreateEdgeConnectorActionRequestActionMetadataParametersInner) o; + return Objects.equals(this.name, createEdgeConnectorActionRequestActionMetadataParametersInner.name) && + Objects.equals(this.type, createEdgeConnectorActionRequestActionMetadataParametersInner.type) && + Objects.equals(this.required, createEdgeConnectorActionRequestActionMetadataParametersInner.required) && + Objects.equals(this.description, createEdgeConnectorActionRequestActionMetadataParametersInner.description) && + Objects.equals(this.options, createEdgeConnectorActionRequestActionMetadataParametersInner.options); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, required, description, options); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorActionRequestActionMetadataParametersInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("type"); + openapiFields.add("required"); + openapiFields.add("description"); + openapiFields.add("options"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorActionRequestActionMetadataParametersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorActionRequestActionMetadataParametersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorActionRequestActionMetadataParametersInner is not found in the empty JSON string", CreateEdgeConnectorActionRequestActionMetadataParametersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorActionRequestActionMetadataParametersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorActionRequestActionMetadataParametersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("options") != null && !jsonObj.get("options").isJsonNull() && !jsonObj.get("options").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `options` to be an array in the JSON string but got `%s`", jsonObj.get("options").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorActionRequestActionMetadataParametersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorActionRequestActionMetadataParametersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorActionRequestActionMetadataParametersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorActionRequestActionMetadataParametersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorActionRequestActionMetadataParametersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorActionRequestActionMetadataParametersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorActionRequestActionMetadataParametersInner + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorActionRequestActionMetadataParametersInner + */ + public static CreateEdgeConnectorActionRequestActionMetadataParametersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorActionRequestActionMetadataParametersInner.class); + } + + /** + * Convert an instance of CreateEdgeConnectorActionRequestActionMetadataParametersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequest.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequest.java new file mode 100644 index 00000000..1e13644e --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequest.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorRequestData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorRequest + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private CreateEdgeConnectorRequestData data; + + public CreateEdgeConnectorRequest() { + } + + public CreateEdgeConnectorRequest data(@javax.annotation.Nonnull CreateEdgeConnectorRequestData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public CreateEdgeConnectorRequestData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull CreateEdgeConnectorRequestData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorRequest createEdgeConnectorRequest = (CreateEdgeConnectorRequest) o; + return Objects.equals(this.data, createEdgeConnectorRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorRequest is not found in the empty JSON string", CreateEdgeConnectorRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEdgeConnectorRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + CreateEdgeConnectorRequestData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorRequest + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorRequest + */ + public static CreateEdgeConnectorRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorRequest.class); + } + + /** + * Convert an instance of CreateEdgeConnectorRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequestData.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequestData.java new file mode 100644 index 00000000..367dde91 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequestData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorRequestDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorRequestData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorRequestData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EDGE_CONNECTORS("edge_connectors"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private CreateEdgeConnectorRequestDataAttributes attributes; + + public CreateEdgeConnectorRequestData() { + } + + public CreateEdgeConnectorRequestData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public CreateEdgeConnectorRequestData attributes(@javax.annotation.Nonnull CreateEdgeConnectorRequestDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public CreateEdgeConnectorRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull CreateEdgeConnectorRequestDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorRequestData createEdgeConnectorRequestData = (CreateEdgeConnectorRequestData) o; + return Objects.equals(this.type, createEdgeConnectorRequestData.type) && + Objects.equals(this.attributes, createEdgeConnectorRequestData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorRequestData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorRequestData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorRequestData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorRequestData is not found in the empty JSON string", CreateEdgeConnectorRequestData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorRequestData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorRequestData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEdgeConnectorRequestData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + CreateEdgeConnectorRequestDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorRequestData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorRequestData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorRequestData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorRequestData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorRequestData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorRequestData given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorRequestData + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorRequestData + */ + public static CreateEdgeConnectorRequestData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorRequestData.class); + } + + /** + * Convert an instance of CreateEdgeConnectorRequestData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequestDataAttributes.java b/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequestDataAttributes.java new file mode 100644 index 00000000..c05e7f6c --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateEdgeConnectorRequestDataAttributes.java @@ -0,0 +1,371 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateEdgeConnectorRequestDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateEdgeConnectorRequestDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * Connector status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + PAUSED("paused"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable + private StatusEnum status; + + public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS) + @javax.annotation.Nullable + private List subscriptions = new ArrayList<>(); + + public CreateEdgeConnectorRequestDataAttributes() { + } + + public CreateEdgeConnectorRequestDataAttributes name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Connector name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CreateEdgeConnectorRequestDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Connector description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public CreateEdgeConnectorRequestDataAttributes status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * Connector status + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + } + + + public CreateEdgeConnectorRequestDataAttributes subscriptions(@javax.annotation.Nullable List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + public CreateEdgeConnectorRequestDataAttributes addSubscriptionsItem(String subscriptionsItem) { + if (this.subscriptions == null) { + this.subscriptions = new ArrayList<>(); + } + this.subscriptions.add(subscriptionsItem); + return this; + } + + /** + * Array of event types to subscribe to + * @return subscriptions + */ + @javax.annotation.Nullable + public List getSubscriptions() { + return subscriptions; + } + + public void setSubscriptions(@javax.annotation.Nullable List subscriptions) { + this.subscriptions = subscriptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateEdgeConnectorRequestDataAttributes createEdgeConnectorRequestDataAttributes = (CreateEdgeConnectorRequestDataAttributes) o; + return Objects.equals(this.name, createEdgeConnectorRequestDataAttributes.name) && + Objects.equals(this.description, createEdgeConnectorRequestDataAttributes.description) && + Objects.equals(this.status, createEdgeConnectorRequestDataAttributes.status) && + Objects.equals(this.subscriptions, createEdgeConnectorRequestDataAttributes.subscriptions); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, status, subscriptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateEdgeConnectorRequestDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" subscriptions: ").append(toIndentedString(subscriptions)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("status"); + openapiFields.add("subscriptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateEdgeConnectorRequestDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateEdgeConnectorRequestDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateEdgeConnectorRequestDataAttributes is not found in the empty JSON string", CreateEdgeConnectorRequestDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateEdgeConnectorRequestDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateEdgeConnectorRequestDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateEdgeConnectorRequestDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("subscriptions") != null && !jsonObj.get("subscriptions").isJsonNull() && !jsonObj.get("subscriptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscriptions` to be an array in the JSON string but got `%s`", jsonObj.get("subscriptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateEdgeConnectorRequestDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateEdgeConnectorRequestDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateEdgeConnectorRequestDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateEdgeConnectorRequestDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateEdgeConnectorRequestDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateEdgeConnectorRequestDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateEdgeConnectorRequestDataAttributes + * @throws IOException if the JSON string is invalid with respect to CreateEdgeConnectorRequestDataAttributes + */ + public static CreateEdgeConnectorRequestDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateEdgeConnectorRequestDataAttributes.class); + } + + /** + * Convert an instance of CreateEdgeConnectorRequestDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateGithubIssueTaskParamsIssueType.java b/src/main/java/com/rootly/client/model/CreateGithubIssueTaskParamsIssueType.java new file mode 100644 index 00000000..11ac07a9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateGithubIssueTaskParamsIssueType.java @@ -0,0 +1,236 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * The issue type + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateGithubIssueTaskParamsIssueType { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public CreateGithubIssueTaskParamsIssueType() { + } + + public CreateGithubIssueTaskParamsIssueType id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CreateGithubIssueTaskParamsIssueType name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateGithubIssueTaskParamsIssueType createGithubIssueTaskParamsIssueType = (CreateGithubIssueTaskParamsIssueType) o; + return Objects.equals(this.id, createGithubIssueTaskParamsIssueType.id) && + Objects.equals(this.name, createGithubIssueTaskParamsIssueType.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateGithubIssueTaskParamsIssueType {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateGithubIssueTaskParamsIssueType + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateGithubIssueTaskParamsIssueType.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateGithubIssueTaskParamsIssueType is not found in the empty JSON string", CreateGithubIssueTaskParamsIssueType.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateGithubIssueTaskParamsIssueType.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateGithubIssueTaskParamsIssueType` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateGithubIssueTaskParamsIssueType.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateGithubIssueTaskParamsIssueType' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateGithubIssueTaskParamsIssueType.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateGithubIssueTaskParamsIssueType value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateGithubIssueTaskParamsIssueType read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateGithubIssueTaskParamsIssueType given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateGithubIssueTaskParamsIssueType + * @throws IOException if the JSON string is invalid with respect to CreateGithubIssueTaskParamsIssueType + */ + public static CreateGithubIssueTaskParamsIssueType fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateGithubIssueTaskParamsIssueType.class); + } + + /** + * Convert an instance of CreateGithubIssueTaskParamsIssueType to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/CreateJsmopsAlertTaskParams.java b/src/main/java/com/rootly/client/model/CreateJsmopsAlertTaskParams.java new file mode 100644 index 00000000..88d19294 --- /dev/null +++ b/src/main/java/com/rootly/client/model/CreateJsmopsAlertTaskParams.java @@ -0,0 +1,665 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * CreateJsmopsAlertTaskParams + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class CreateJsmopsAlertTaskParams { + /** + * Gets or Sets taskType + */ + @JsonAdapter(TaskTypeEnum.Adapter.class) + public enum TaskTypeEnum { + CREATE_JSMOPS_ALERT("create_jsmops_alert"); + + private String value; + + TaskTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TaskTypeEnum fromValue(String value) { + for (TaskTypeEnum b : TaskTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TaskTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TaskTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TaskTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TASK_TYPE = "task_type"; + @SerializedName(SERIALIZED_NAME_TASK_TYPE) + @javax.annotation.Nullable + private TaskTypeEnum taskType; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_TEAMS = "teams"; + @SerializedName(SERIALIZED_NAME_TEAMS) + @javax.annotation.Nullable + private List teams = new ArrayList<>(); + + public static final String SERIALIZED_NAME_USERS = "users"; + @SerializedName(SERIALIZED_NAME_USERS) + @javax.annotation.Nullable + private List users = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SCHEDULES = "schedules"; + @SerializedName(SERIALIZED_NAME_SCHEDULES) + @javax.annotation.Nullable + private List schedules = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ESCALATIONS = "escalations"; + @SerializedName(SERIALIZED_NAME_ESCALATIONS) + @javax.annotation.Nullable + private List escalations = new ArrayList<>(); + + /** + * Gets or Sets priority + */ + @JsonAdapter(PriorityEnum.Adapter.class) + public enum PriorityEnum { + P3("P3"), + + P1("P1"), + + P2("P2"), + + P32("P3"), + + P4("P4"), + + P5("P5"), + + AUTO("auto"); + + private String value; + + PriorityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PriorityEnum fromValue(String value) { + for (PriorityEnum b : PriorityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PriorityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PriorityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PriorityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PriorityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PRIORITY = "priority"; + @SerializedName(SERIALIZED_NAME_PRIORITY) + @javax.annotation.Nullable + private PriorityEnum priority = PriorityEnum.P3; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + @SerializedName(SERIALIZED_NAME_DETAILS) + @javax.annotation.Nullable + private String details; + + public CreateJsmopsAlertTaskParams() { + } + + public CreateJsmopsAlertTaskParams taskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get taskType + * @return taskType + */ + @javax.annotation.Nullable + public TaskTypeEnum getTaskType() { + return taskType; + } + + public void setTaskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + } + + + public CreateJsmopsAlertTaskParams message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * Message of the alert + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + public CreateJsmopsAlertTaskParams description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description field of the alert that is generally used to provide a detailed information about the alert + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public CreateJsmopsAlertTaskParams teams(@javax.annotation.Nullable List teams) { + this.teams = teams; + return this; + } + + public CreateJsmopsAlertTaskParams addTeamsItem(AddActionItemTaskParamsPostToSlackChannelsInner teamsItem) { + if (this.teams == null) { + this.teams = new ArrayList<>(); + } + this.teams.add(teamsItem); + return this; + } + + /** + * Get teams + * @return teams + */ + @javax.annotation.Nullable + public List getTeams() { + return teams; + } + + public void setTeams(@javax.annotation.Nullable List teams) { + this.teams = teams; + } + + + public CreateJsmopsAlertTaskParams users(@javax.annotation.Nullable List users) { + this.users = users; + return this; + } + + public CreateJsmopsAlertTaskParams addUsersItem(AddActionItemTaskParamsPostToSlackChannelsInner usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + */ + @javax.annotation.Nullable + public List getUsers() { + return users; + } + + public void setUsers(@javax.annotation.Nullable List users) { + this.users = users; + } + + + public CreateJsmopsAlertTaskParams schedules(@javax.annotation.Nullable List schedules) { + this.schedules = schedules; + return this; + } + + public CreateJsmopsAlertTaskParams addSchedulesItem(AddActionItemTaskParamsPostToSlackChannelsInner schedulesItem) { + if (this.schedules == null) { + this.schedules = new ArrayList<>(); + } + this.schedules.add(schedulesItem); + return this; + } + + /** + * Get schedules + * @return schedules + */ + @javax.annotation.Nullable + public List getSchedules() { + return schedules; + } + + public void setSchedules(@javax.annotation.Nullable List schedules) { + this.schedules = schedules; + } + + + public CreateJsmopsAlertTaskParams escalations(@javax.annotation.Nullable List escalations) { + this.escalations = escalations; + return this; + } + + public CreateJsmopsAlertTaskParams addEscalationsItem(AddActionItemTaskParamsPostToSlackChannelsInner escalationsItem) { + if (this.escalations == null) { + this.escalations = new ArrayList<>(); + } + this.escalations.add(escalationsItem); + return this; + } + + /** + * Get escalations + * @return escalations + */ + @javax.annotation.Nullable + public List getEscalations() { + return escalations; + } + + public void setEscalations(@javax.annotation.Nullable List escalations) { + this.escalations = escalations; + } + + + public CreateJsmopsAlertTaskParams priority(@javax.annotation.Nullable PriorityEnum priority) { + this.priority = priority; + return this; + } + + /** + * Get priority + * @return priority + */ + @javax.annotation.Nullable + public PriorityEnum getPriority() { + return priority; + } + + public void setPriority(@javax.annotation.Nullable PriorityEnum priority) { + this.priority = priority; + } + + + public CreateJsmopsAlertTaskParams details(@javax.annotation.Nullable String details) { + this.details = details; + return this; + } + + /** + * Details payload. Can contain liquid markup and need to be valid JSON + * @return details + */ + @javax.annotation.Nullable + public String getDetails() { + return details; + } + + public void setDetails(@javax.annotation.Nullable String details) { + this.details = details; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJsmopsAlertTaskParams createJsmopsAlertTaskParams = (CreateJsmopsAlertTaskParams) o; + return Objects.equals(this.taskType, createJsmopsAlertTaskParams.taskType) && + Objects.equals(this.message, createJsmopsAlertTaskParams.message) && + Objects.equals(this.description, createJsmopsAlertTaskParams.description) && + Objects.equals(this.teams, createJsmopsAlertTaskParams.teams) && + Objects.equals(this.users, createJsmopsAlertTaskParams.users) && + Objects.equals(this.schedules, createJsmopsAlertTaskParams.schedules) && + Objects.equals(this.escalations, createJsmopsAlertTaskParams.escalations) && + Objects.equals(this.priority, createJsmopsAlertTaskParams.priority) && + Objects.equals(this.details, createJsmopsAlertTaskParams.details); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(taskType, message, description, teams, users, schedules, escalations, priority, details); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJsmopsAlertTaskParams {\n"); + sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); + sb.append(" escalations: ").append(toIndentedString(escalations)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("task_type"); + openapiFields.add("message"); + openapiFields.add("description"); + openapiFields.add("teams"); + openapiFields.add("users"); + openapiFields.add("schedules"); + openapiFields.add("escalations"); + openapiFields.add("priority"); + openapiFields.add("details"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to CreateJsmopsAlertTaskParams + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateJsmopsAlertTaskParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateJsmopsAlertTaskParams is not found in the empty JSON string", CreateJsmopsAlertTaskParams.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CreateJsmopsAlertTaskParams.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateJsmopsAlertTaskParams` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateJsmopsAlertTaskParams.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) && !jsonObj.get("task_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_type").toString())); + } + // validate the optional field `task_type` + if (jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) { + TaskTypeEnum.validateJsonElement(jsonObj.get("task_type")); + } + if (!jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (jsonObj.get("teams") != null && !jsonObj.get("teams").isJsonNull()) { + JsonArray jsonArrayteams = jsonObj.getAsJsonArray("teams"); + if (jsonArrayteams != null) { + // ensure the json data is an array + if (!jsonObj.get("teams").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `teams` to be an array in the JSON string but got `%s`", jsonObj.get("teams").toString())); + } + + // validate the optional field `teams` (array) + for (int i = 0; i < jsonArrayteams.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArrayteams.get(i)); + }; + } + } + if (jsonObj.get("users") != null && !jsonObj.get("users").isJsonNull()) { + JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); + if (jsonArrayusers != null) { + // ensure the json data is an array + if (!jsonObj.get("users").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + } + + // validate the optional field `users` (array) + for (int i = 0; i < jsonArrayusers.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArrayusers.get(i)); + }; + } + } + if (jsonObj.get("schedules") != null && !jsonObj.get("schedules").isJsonNull()) { + JsonArray jsonArrayschedules = jsonObj.getAsJsonArray("schedules"); + if (jsonArrayschedules != null) { + // ensure the json data is an array + if (!jsonObj.get("schedules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `schedules` to be an array in the JSON string but got `%s`", jsonObj.get("schedules").toString())); + } + + // validate the optional field `schedules` (array) + for (int i = 0; i < jsonArrayschedules.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArrayschedules.get(i)); + }; + } + } + if (jsonObj.get("escalations") != null && !jsonObj.get("escalations").isJsonNull()) { + JsonArray jsonArrayescalations = jsonObj.getAsJsonArray("escalations"); + if (jsonArrayescalations != null) { + // ensure the json data is an array + if (!jsonObj.get("escalations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `escalations` to be an array in the JSON string but got `%s`", jsonObj.get("escalations").toString())); + } + + // validate the optional field `escalations` (array) + for (int i = 0; i < jsonArrayescalations.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArrayescalations.get(i)); + }; + } + } + if ((jsonObj.get("priority") != null && !jsonObj.get("priority").isJsonNull()) && !jsonObj.get("priority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `priority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priority").toString())); + } + // validate the optional field `priority` + if (jsonObj.get("priority") != null && !jsonObj.get("priority").isJsonNull()) { + PriorityEnum.validateJsonElement(jsonObj.get("priority")); + } + if ((jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) && !jsonObj.get("details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("details").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CreateJsmopsAlertTaskParams.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJsmopsAlertTaskParams' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateJsmopsAlertTaskParams.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CreateJsmopsAlertTaskParams value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CreateJsmopsAlertTaskParams read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJsmopsAlertTaskParams given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJsmopsAlertTaskParams + * @throws IOException if the JSON string is invalid with respect to CreateJsmopsAlertTaskParams + */ + public static CreateJsmopsAlertTaskParams fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJsmopsAlertTaskParams.class); + } + + /** + * Convert an instance of CreateJsmopsAlertTaskParams to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/EscalateAlert.java b/src/main/java/com/rootly/client/model/EscalateAlert.java new file mode 100644 index 00000000..f7c4dd81 --- /dev/null +++ b/src/main/java/com/rootly/client/model/EscalateAlert.java @@ -0,0 +1,208 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.EscalateAlertData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * EscalateAlert + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class EscalateAlert { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private EscalateAlertData data; + + public EscalateAlert() { + } + + public EscalateAlert data(@javax.annotation.Nullable EscalateAlertData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public EscalateAlertData getData() { + return data; + } + + public void setData(@javax.annotation.Nullable EscalateAlertData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalateAlert escalateAlert = (EscalateAlert) o; + return Objects.equals(this.data, escalateAlert.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalateAlert {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EscalateAlert + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EscalateAlert.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EscalateAlert is not found in the empty JSON string", EscalateAlert.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EscalateAlert.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EscalateAlert` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + EscalateAlertData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EscalateAlert.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EscalateAlert' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EscalateAlert.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EscalateAlert value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EscalateAlert read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EscalateAlert given an JSON string + * + * @param jsonString JSON string + * @return An instance of EscalateAlert + * @throws IOException if the JSON string is invalid with respect to EscalateAlert + */ + public static EscalateAlert fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EscalateAlert.class); + } + + /** + * Convert an instance of EscalateAlert to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/EscalateAlertData.java b/src/main/java/com/rootly/client/model/EscalateAlertData.java new file mode 100644 index 00000000..37a209d1 --- /dev/null +++ b/src/main/java/com/rootly/client/model/EscalateAlertData.java @@ -0,0 +1,292 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.EscalateAlertDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * EscalateAlertData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class EscalateAlertData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ALERTS("alerts"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private EscalateAlertDataAttributes attributes; + + public EscalateAlertData() { + } + + public EscalateAlertData type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public EscalateAlertData attributes(@javax.annotation.Nullable EscalateAlertDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public EscalateAlertDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable EscalateAlertDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalateAlertData escalateAlertData = (EscalateAlertData) o; + return Objects.equals(this.type, escalateAlertData.type) && + Objects.equals(this.attributes, escalateAlertData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalateAlertData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EscalateAlertData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EscalateAlertData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EscalateAlertData is not found in the empty JSON string", EscalateAlertData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EscalateAlertData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EscalateAlertData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + // validate the optional field `attributes` + if (jsonObj.get("attributes") != null && !jsonObj.get("attributes").isJsonNull()) { + EscalateAlertDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EscalateAlertData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EscalateAlertData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EscalateAlertData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EscalateAlertData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EscalateAlertData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EscalateAlertData given an JSON string + * + * @param jsonString JSON string + * @return An instance of EscalateAlertData + * @throws IOException if the JSON string is invalid with respect to EscalateAlertData + */ + public static EscalateAlertData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EscalateAlertData.class); + } + + /** + * Convert an instance of EscalateAlertData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/EscalateAlertDataAttributes.java b/src/main/java/com/rootly/client/model/EscalateAlertDataAttributes.java new file mode 100644 index 00000000..1f34371b --- /dev/null +++ b/src/main/java/com/rootly/client/model/EscalateAlertDataAttributes.java @@ -0,0 +1,234 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * EscalateAlertDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class EscalateAlertDataAttributes { + public static final String SERIALIZED_NAME_ESCALATION_POLICY_ID = "escalation_policy_id"; + @SerializedName(SERIALIZED_NAME_ESCALATION_POLICY_ID) + @javax.annotation.Nullable + private String escalationPolicyId; + + public static final String SERIALIZED_NAME_ESCALATION_POLICY_LEVEL = "escalation_policy_level"; + @SerializedName(SERIALIZED_NAME_ESCALATION_POLICY_LEVEL) + @javax.annotation.Nullable + private Integer escalationPolicyLevel; + + public EscalateAlertDataAttributes() { + } + + public EscalateAlertDataAttributes escalationPolicyId(@javax.annotation.Nullable String escalationPolicyId) { + this.escalationPolicyId = escalationPolicyId; + return this; + } + + /** + * The ID of the escalation policy to escalate to. If omitted, uses the alert's current escalation policy from metadata. Required for resolved alerts whose metadata may have been cleared. + * @return escalationPolicyId + */ + @javax.annotation.Nullable + public String getEscalationPolicyId() { + return escalationPolicyId; + } + + public void setEscalationPolicyId(@javax.annotation.Nullable String escalationPolicyId) { + this.escalationPolicyId = escalationPolicyId; + } + + + public EscalateAlertDataAttributes escalationPolicyLevel(@javax.annotation.Nullable Integer escalationPolicyLevel) { + this.escalationPolicyLevel = escalationPolicyLevel; + return this; + } + + /** + * The escalation policy level to escalate to. If omitted, defaults to the next level (same EP) or level 1 (different EP). + * minimum: 1 + * @return escalationPolicyLevel + */ + @javax.annotation.Nullable + public Integer getEscalationPolicyLevel() { + return escalationPolicyLevel; + } + + public void setEscalationPolicyLevel(@javax.annotation.Nullable Integer escalationPolicyLevel) { + this.escalationPolicyLevel = escalationPolicyLevel; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EscalateAlertDataAttributes escalateAlertDataAttributes = (EscalateAlertDataAttributes) o; + return Objects.equals(this.escalationPolicyId, escalateAlertDataAttributes.escalationPolicyId) && + Objects.equals(this.escalationPolicyLevel, escalateAlertDataAttributes.escalationPolicyLevel); + } + + @Override + public int hashCode() { + return Objects.hash(escalationPolicyId, escalationPolicyLevel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EscalateAlertDataAttributes {\n"); + sb.append(" escalationPolicyId: ").append(toIndentedString(escalationPolicyId)).append("\n"); + sb.append(" escalationPolicyLevel: ").append(toIndentedString(escalationPolicyLevel)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("escalation_policy_id"); + openapiFields.add("escalation_policy_level"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to EscalateAlertDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EscalateAlertDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EscalateAlertDataAttributes is not found in the empty JSON string", EscalateAlertDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!EscalateAlertDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EscalateAlertDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("escalation_policy_id") != null && !jsonObj.get("escalation_policy_id").isJsonNull()) && !jsonObj.get("escalation_policy_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `escalation_policy_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("escalation_policy_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EscalateAlertDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EscalateAlertDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EscalateAlertDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EscalateAlertDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EscalateAlertDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EscalateAlertDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of EscalateAlertDataAttributes + * @throws IOException if the JSON string is invalid with respect to EscalateAlertDataAttributes + */ + public static EscalateAlertDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EscalateAlertDataAttributes.class); + } + + /** + * Convert an instance of EscalateAlertDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/IncidentZoomMeetingGlobalDialInNumbersInner.java b/src/main/java/com/rootly/client/model/IncidentZoomMeetingGlobalDialInNumbersInner.java new file mode 100644 index 00000000..7cf2d6c7 --- /dev/null +++ b/src/main/java/com/rootly/client/model/IncidentZoomMeetingGlobalDialInNumbersInner.java @@ -0,0 +1,326 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * IncidentZoomMeetingGlobalDialInNumbersInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class IncidentZoomMeetingGlobalDialInNumbersInner { + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public static final String SERIALIZED_NAME_COUNTRY_NAME = "country_name"; + @SerializedName(SERIALIZED_NAME_COUNTRY_NAME) + @javax.annotation.Nullable + private String countryName; + + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public IncidentZoomMeetingGlobalDialInNumbersInner() { + } + + public IncidentZoomMeetingGlobalDialInNumbersInner country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + + public IncidentZoomMeetingGlobalDialInNumbersInner countryName(@javax.annotation.Nullable String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Get countryName + * @return countryName + */ + @javax.annotation.Nullable + public String getCountryName() { + return countryName; + } + + public void setCountryName(@javax.annotation.Nullable String countryName) { + this.countryName = countryName; + } + + + public IncidentZoomMeetingGlobalDialInNumbersInner city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public IncidentZoomMeetingGlobalDialInNumbersInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + + public IncidentZoomMeetingGlobalDialInNumbersInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentZoomMeetingGlobalDialInNumbersInner incidentZoomMeetingGlobalDialInNumbersInner = (IncidentZoomMeetingGlobalDialInNumbersInner) o; + return Objects.equals(this.country, incidentZoomMeetingGlobalDialInNumbersInner.country) && + Objects.equals(this.countryName, incidentZoomMeetingGlobalDialInNumbersInner.countryName) && + Objects.equals(this.city, incidentZoomMeetingGlobalDialInNumbersInner.city) && + Objects.equals(this.number, incidentZoomMeetingGlobalDialInNumbersInner.number) && + Objects.equals(this.type, incidentZoomMeetingGlobalDialInNumbersInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(country, countryName, city, number, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentZoomMeetingGlobalDialInNumbersInner {\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" countryName: ").append(toIndentedString(countryName)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("country"); + openapiFields.add("country_name"); + openapiFields.add("city"); + openapiFields.add("number"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to IncidentZoomMeetingGlobalDialInNumbersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IncidentZoomMeetingGlobalDialInNumbersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IncidentZoomMeetingGlobalDialInNumbersInner is not found in the empty JSON string", IncidentZoomMeetingGlobalDialInNumbersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!IncidentZoomMeetingGlobalDialInNumbersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IncidentZoomMeetingGlobalDialInNumbersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("country") != null && !jsonObj.get("country").isJsonNull()) && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + if ((jsonObj.get("country_name") != null && !jsonObj.get("country_name").isJsonNull()) && !jsonObj.get("country_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country_name").toString())); + } + if ((jsonObj.get("city") != null && !jsonObj.get("city").isJsonNull()) && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + if ((jsonObj.get("number") != null && !jsonObj.get("number").isJsonNull()) && !jsonObj.get("number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IncidentZoomMeetingGlobalDialInNumbersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IncidentZoomMeetingGlobalDialInNumbersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IncidentZoomMeetingGlobalDialInNumbersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IncidentZoomMeetingGlobalDialInNumbersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IncidentZoomMeetingGlobalDialInNumbersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IncidentZoomMeetingGlobalDialInNumbersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of IncidentZoomMeetingGlobalDialInNumbersInner + * @throws IOException if the JSON string is invalid with respect to IncidentZoomMeetingGlobalDialInNumbersInner + */ + public static IncidentZoomMeetingGlobalDialInNumbersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IncidentZoomMeetingGlobalDialInNumbersInner.class); + } + + /** + * Convert an instance of IncidentZoomMeetingGlobalDialInNumbersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/MeetingRecording.java b/src/main/java/com/rootly/client/model/MeetingRecording.java new file mode 100644 index 00000000..3598655f --- /dev/null +++ b/src/main/java/com/rootly/client/model/MeetingRecording.java @@ -0,0 +1,657 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * MeetingRecording + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class MeetingRecording { + /** + * Meeting platform + */ + @JsonAdapter(PlatformEnum.Adapter.class) + public enum PlatformEnum { + ZOOM("zoom"), + + GOOGLE_MEET("google_meet"), + + MICROSOFT_TEAMS("microsoft_teams"), + + WEBEX("webex"); + + private String value; + + PlatformEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlatformEnum fromValue(String value) { + for (PlatformEnum b : PlatformEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PlatformEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlatformEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlatformEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PlatformEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PLATFORM = "platform"; + @SerializedName(SERIALIZED_NAME_PLATFORM) + @javax.annotation.Nonnull + private PlatformEnum platform; + + public static final String SERIALIZED_NAME_SESSION_NUMBER = "session_number"; + @SerializedName(SERIALIZED_NAME_SESSION_NUMBER) + @javax.annotation.Nonnull + private Integer sessionNumber; + + /** + * Current recording lifecycle status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PENDING("pending"), + + RECORDING("recording"), + + PAUSED("paused"), + + CALL_ENDED("call_ended"), + + ANALYZING("analyzing"), + + COMPLETED("completed"), + + FAILED("failed"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public static final String SERIALIZED_NAME_STARTED_AT = "started_at"; + @SerializedName(SERIALIZED_NAME_STARTED_AT) + @javax.annotation.Nullable + private OffsetDateTime startedAt; + + public static final String SERIALIZED_NAME_ENDED_AT = "ended_at"; + @SerializedName(SERIALIZED_NAME_ENDED_AT) + @javax.annotation.Nullable + private OffsetDateTime endedAt; + + public static final String SERIALIZED_NAME_DURATION_MINUTES = "duration_minutes"; + @SerializedName(SERIALIZED_NAME_DURATION_MINUTES) + @javax.annotation.Nullable + private BigDecimal durationMinutes; + + public static final String SERIALIZED_NAME_SPEAKER_COUNT = "speaker_count"; + @SerializedName(SERIALIZED_NAME_SPEAKER_COUNT) + @javax.annotation.Nullable + private Integer speakerCount; + + public static final String SERIALIZED_NAME_WORD_COUNT = "word_count"; + @SerializedName(SERIALIZED_NAME_WORD_COUNT) + @javax.annotation.Nullable + private Integer wordCount; + + public static final String SERIALIZED_NAME_TRANSCRIPT_SUMMARY = "transcript_summary"; + @SerializedName(SERIALIZED_NAME_TRANSCRIPT_SUMMARY) + @javax.annotation.Nullable + private String transcriptSummary; + + public static final String SERIALIZED_NAME_HAS_VIDEO = "has_video"; + @SerializedName(SERIALIZED_NAME_HAS_VIDEO) + @javax.annotation.Nullable + private Boolean hasVideo; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public MeetingRecording() { + } + + public MeetingRecording platform(@javax.annotation.Nonnull PlatformEnum platform) { + this.platform = platform; + return this; + } + + /** + * Meeting platform + * @return platform + */ + @javax.annotation.Nonnull + public PlatformEnum getPlatform() { + return platform; + } + + public void setPlatform(@javax.annotation.Nonnull PlatformEnum platform) { + this.platform = platform; + } + + + public MeetingRecording sessionNumber(@javax.annotation.Nonnull Integer sessionNumber) { + this.sessionNumber = sessionNumber; + return this; + } + + /** + * Session number within the incident for this platform (starts at 1, increments on re-invite) + * @return sessionNumber + */ + @javax.annotation.Nonnull + public Integer getSessionNumber() { + return sessionNumber; + } + + public void setSessionNumber(@javax.annotation.Nonnull Integer sessionNumber) { + this.sessionNumber = sessionNumber; + } + + + public MeetingRecording status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * Current recording lifecycle status + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public MeetingRecording startedAt(@javax.annotation.Nullable OffsetDateTime startedAt) { + this.startedAt = startedAt; + return this; + } + + /** + * When the bot started recording (null if bot never joined) + * @return startedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getStartedAt() { + return startedAt; + } + + public void setStartedAt(@javax.annotation.Nullable OffsetDateTime startedAt) { + this.startedAt = startedAt; + } + + + public MeetingRecording endedAt(@javax.annotation.Nullable OffsetDateTime endedAt) { + this.endedAt = endedAt; + return this; + } + + /** + * When the recording ended + * @return endedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getEndedAt() { + return endedAt; + } + + public void setEndedAt(@javax.annotation.Nullable OffsetDateTime endedAt) { + this.endedAt = endedAt; + } + + + public MeetingRecording durationMinutes(@javax.annotation.Nullable BigDecimal durationMinutes) { + this.durationMinutes = durationMinutes; + return this; + } + + /** + * Recording duration in minutes (null if not started) + * @return durationMinutes + */ + @javax.annotation.Nullable + public BigDecimal getDurationMinutes() { + return durationMinutes; + } + + public void setDurationMinutes(@javax.annotation.Nullable BigDecimal durationMinutes) { + this.durationMinutes = durationMinutes; + } + + + public MeetingRecording speakerCount(@javax.annotation.Nullable Integer speakerCount) { + this.speakerCount = speakerCount; + return this; + } + + /** + * Number of unique speakers detected in the transcript + * @return speakerCount + */ + @javax.annotation.Nullable + public Integer getSpeakerCount() { + return speakerCount; + } + + public void setSpeakerCount(@javax.annotation.Nullable Integer speakerCount) { + this.speakerCount = speakerCount; + } + + + public MeetingRecording wordCount(@javax.annotation.Nullable Integer wordCount) { + this.wordCount = wordCount; + return this; + } + + /** + * Total word count across all transcript segments + * @return wordCount + */ + @javax.annotation.Nullable + public Integer getWordCount() { + return wordCount; + } + + public void setWordCount(@javax.annotation.Nullable Integer wordCount) { + this.wordCount = wordCount; + } + + + public MeetingRecording transcriptSummary(@javax.annotation.Nullable String transcriptSummary) { + this.transcriptSummary = transcriptSummary; + return this; + } + + /** + * AI-generated summary of the meeting transcript (null if no transcript or not yet analyzed) + * @return transcriptSummary + */ + @javax.annotation.Nullable + public String getTranscriptSummary() { + return transcriptSummary; + } + + public void setTranscriptSummary(@javax.annotation.Nullable String transcriptSummary) { + this.transcriptSummary = transcriptSummary; + } + + + public MeetingRecording hasVideo(@javax.annotation.Nullable Boolean hasVideo) { + this.hasVideo = hasVideo; + return this; + } + + /** + * Whether a video recording file is attached + * @return hasVideo + */ + @javax.annotation.Nullable + public Boolean getHasVideo() { + return hasVideo; + } + + public void setHasVideo(@javax.annotation.Nullable Boolean hasVideo) { + this.hasVideo = hasVideo; + } + + + public MeetingRecording createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * When the recording session was created + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public MeetingRecording updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * When the recording session was last updated + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MeetingRecording meetingRecording = (MeetingRecording) o; + return Objects.equals(this.platform, meetingRecording.platform) && + Objects.equals(this.sessionNumber, meetingRecording.sessionNumber) && + Objects.equals(this.status, meetingRecording.status) && + Objects.equals(this.startedAt, meetingRecording.startedAt) && + Objects.equals(this.endedAt, meetingRecording.endedAt) && + Objects.equals(this.durationMinutes, meetingRecording.durationMinutes) && + Objects.equals(this.speakerCount, meetingRecording.speakerCount) && + Objects.equals(this.wordCount, meetingRecording.wordCount) && + Objects.equals(this.transcriptSummary, meetingRecording.transcriptSummary) && + Objects.equals(this.hasVideo, meetingRecording.hasVideo) && + Objects.equals(this.createdAt, meetingRecording.createdAt) && + Objects.equals(this.updatedAt, meetingRecording.updatedAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(platform, sessionNumber, status, startedAt, endedAt, durationMinutes, speakerCount, wordCount, transcriptSummary, hasVideo, createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MeetingRecording {\n"); + sb.append(" platform: ").append(toIndentedString(platform)).append("\n"); + sb.append(" sessionNumber: ").append(toIndentedString(sessionNumber)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); + sb.append(" endedAt: ").append(toIndentedString(endedAt)).append("\n"); + sb.append(" durationMinutes: ").append(toIndentedString(durationMinutes)).append("\n"); + sb.append(" speakerCount: ").append(toIndentedString(speakerCount)).append("\n"); + sb.append(" wordCount: ").append(toIndentedString(wordCount)).append("\n"); + sb.append(" transcriptSummary: ").append(toIndentedString(transcriptSummary)).append("\n"); + sb.append(" hasVideo: ").append(toIndentedString(hasVideo)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("platform"); + openapiFields.add("session_number"); + openapiFields.add("status"); + openapiFields.add("started_at"); + openapiFields.add("ended_at"); + openapiFields.add("duration_minutes"); + openapiFields.add("speaker_count"); + openapiFields.add("word_count"); + openapiFields.add("transcript_summary"); + openapiFields.add("has_video"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("platform"); + openapiRequiredFields.add("session_number"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MeetingRecording + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MeetingRecording.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MeetingRecording is not found in the empty JSON string", MeetingRecording.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MeetingRecording.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MeetingRecording` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MeetingRecording.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("platform").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `platform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("platform").toString())); + } + // validate the required field `platform` + PlatformEnum.validateJsonElement(jsonObj.get("platform")); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("transcript_summary") != null && !jsonObj.get("transcript_summary").isJsonNull()) && !jsonObj.get("transcript_summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transcript_summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transcript_summary").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MeetingRecording.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MeetingRecording' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MeetingRecording.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MeetingRecording value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MeetingRecording read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MeetingRecording given an JSON string + * + * @param jsonString JSON string + * @return An instance of MeetingRecording + * @throws IOException if the JSON string is invalid with respect to MeetingRecording + */ + public static MeetingRecording fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MeetingRecording.class); + } + + /** + * Convert an instance of MeetingRecording to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/MeetingRecordingList.java b/src/main/java/com/rootly/client/model/MeetingRecordingList.java new file mode 100644 index 00000000..ce8ae51a --- /dev/null +++ b/src/main/java/com/rootly/client/model/MeetingRecordingList.java @@ -0,0 +1,264 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.MeetingRecordingListDataInner; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * MeetingRecordingList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class MeetingRecordingList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nullable + private Meta meta; + + public MeetingRecordingList() { + } + + public MeetingRecordingList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public MeetingRecordingList addDataItem(MeetingRecordingListDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public MeetingRecordingList meta(@javax.annotation.Nullable Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nullable + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nullable Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MeetingRecordingList meetingRecordingList = (MeetingRecordingList) o; + return Objects.equals(this.data, meetingRecordingList.data) && + Objects.equals(this.meta, meetingRecordingList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MeetingRecordingList {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MeetingRecordingList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MeetingRecordingList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MeetingRecordingList is not found in the empty JSON string", MeetingRecordingList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MeetingRecordingList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MeetingRecordingList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MeetingRecordingList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + MeetingRecordingListDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the optional field `meta` + if (jsonObj.get("meta") != null && !jsonObj.get("meta").isJsonNull()) { + Meta.validateJsonElement(jsonObj.get("meta")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MeetingRecordingList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MeetingRecordingList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MeetingRecordingList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MeetingRecordingList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MeetingRecordingList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MeetingRecordingList given an JSON string + * + * @param jsonString JSON string + * @return An instance of MeetingRecordingList + * @throws IOException if the JSON string is invalid with respect to MeetingRecordingList + */ + public static MeetingRecordingList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MeetingRecordingList.class); + } + + /** + * Convert an instance of MeetingRecordingList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/MeetingRecordingListDataInner.java b/src/main/java/com/rootly/client/model/MeetingRecordingListDataInner.java new file mode 100644 index 00000000..2e891126 --- /dev/null +++ b/src/main/java/com/rootly/client/model/MeetingRecordingListDataInner.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.MeetingRecording; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * MeetingRecordingListDataInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class MeetingRecordingListDataInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + MEETING_RECORDINGS("meeting_recordings"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private MeetingRecording attributes; + + public MeetingRecordingListDataInner() { + } + + public MeetingRecordingListDataInner id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique UUID of the meeting recording + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public MeetingRecordingListDataInner type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public MeetingRecordingListDataInner attributes(@javax.annotation.Nonnull MeetingRecording attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public MeetingRecording getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull MeetingRecording attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MeetingRecordingListDataInner meetingRecordingListDataInner = (MeetingRecordingListDataInner) o; + return Objects.equals(this.id, meetingRecordingListDataInner.id) && + Objects.equals(this.type, meetingRecordingListDataInner.type) && + Objects.equals(this.attributes, meetingRecordingListDataInner.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MeetingRecordingListDataInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to MeetingRecordingListDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MeetingRecordingListDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MeetingRecordingListDataInner is not found in the empty JSON string", MeetingRecordingListDataInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!MeetingRecordingListDataInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MeetingRecordingListDataInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MeetingRecordingListDataInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + MeetingRecording.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MeetingRecordingListDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MeetingRecordingListDataInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MeetingRecordingListDataInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MeetingRecordingListDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MeetingRecordingListDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MeetingRecordingListDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of MeetingRecordingListDataInner + * @throws IOException if the JSON string is invalid with respect to MeetingRecordingListDataInner + */ + public static MeetingRecordingListDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MeetingRecordingListDataInner.class); + } + + /** + * Convert an instance of MeetingRecordingListDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewApiKey.java b/src/main/java/com/rootly/client/model/NewApiKey.java new file mode 100644 index 00000000..d4d0ebaf --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewApiKey.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewApiKeyData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewApiKey + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewApiKey { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private NewApiKeyData data; + + public NewApiKey() { + } + + public NewApiKey data(@javax.annotation.Nonnull NewApiKeyData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public NewApiKeyData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull NewApiKeyData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewApiKey newApiKey = (NewApiKey) o; + return Objects.equals(this.data, newApiKey.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewApiKey {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewApiKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewApiKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewApiKey is not found in the empty JSON string", NewApiKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewApiKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewApiKey` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewApiKey.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + NewApiKeyData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewApiKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewApiKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewApiKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewApiKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewApiKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewApiKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewApiKey + * @throws IOException if the JSON string is invalid with respect to NewApiKey + */ + public static NewApiKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewApiKey.class); + } + + /** + * Convert an instance of NewApiKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewApiKeyData.java b/src/main/java/com/rootly/client/model/NewApiKeyData.java new file mode 100644 index 00000000..a4a8ee6d --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewApiKeyData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewApiKeyDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewApiKeyData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewApiKeyData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + API_KEYS("api_keys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private NewApiKeyDataAttributes attributes; + + public NewApiKeyData() { + } + + public NewApiKeyData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public NewApiKeyData attributes(@javax.annotation.Nonnull NewApiKeyDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public NewApiKeyDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull NewApiKeyDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewApiKeyData newApiKeyData = (NewApiKeyData) o; + return Objects.equals(this.type, newApiKeyData.type) && + Objects.equals(this.attributes, newApiKeyData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewApiKeyData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewApiKeyData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewApiKeyData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewApiKeyData is not found in the empty JSON string", NewApiKeyData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewApiKeyData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewApiKeyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewApiKeyData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + NewApiKeyDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewApiKeyData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewApiKeyData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewApiKeyData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewApiKeyData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewApiKeyData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewApiKeyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewApiKeyData + * @throws IOException if the JSON string is invalid with respect to NewApiKeyData + */ + public static NewApiKeyData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewApiKeyData.class); + } + + /** + * Convert an instance of NewApiKeyData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewApiKeyDataAttributes.java b/src/main/java/com/rootly/client/model/NewApiKeyDataAttributes.java new file mode 100644 index 00000000..d4cdba00 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewApiKeyDataAttributes.java @@ -0,0 +1,462 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewApiKeyDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewApiKeyDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * The kind of the API key + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + PERSONAL("personal"), + + TEAM("team"), + + ORGANIZATION("organization"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nonnull + private OffsetDateTime expiresAt; + + public static final String SERIALIZED_NAME_GROUP_ID = "group_id"; + @SerializedName(SERIALIZED_NAME_GROUP_ID) + @javax.annotation.Nullable + private String groupId; + + public static final String SERIALIZED_NAME_ROLE_ID = "role_id"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nullable + private String roleId; + + public static final String SERIALIZED_NAME_ON_CALL_ROLE_ID = "on_call_role_id"; + @SerializedName(SERIALIZED_NAME_ON_CALL_ROLE_ID) + @javax.annotation.Nullable + private String onCallRoleId; + + public NewApiKeyDataAttributes() { + } + + public NewApiKeyDataAttributes name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the API key + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public NewApiKeyDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the API key + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public NewApiKeyDataAttributes kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * The kind of the API key + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public NewApiKeyDataAttributes expiresAt(@javax.annotation.Nonnull OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The expiration date of the API key (ISO 8601) + * @return expiresAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nonnull OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + + public NewApiKeyDataAttributes groupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + return this; + } + + /** + * The group (team) ID. Required when kind is 'team'. + * @return groupId + */ + @javax.annotation.Nullable + public String getGroupId() { + return groupId; + } + + public void setGroupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + } + + + public NewApiKeyDataAttributes roleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + return this; + } + + /** + * The role ID for organization API keys + * @return roleId + */ + @javax.annotation.Nullable + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + } + + + public NewApiKeyDataAttributes onCallRoleId(@javax.annotation.Nullable String onCallRoleId) { + this.onCallRoleId = onCallRoleId; + return this; + } + + /** + * The on-call role ID for organization API keys + * @return onCallRoleId + */ + @javax.annotation.Nullable + public String getOnCallRoleId() { + return onCallRoleId; + } + + public void setOnCallRoleId(@javax.annotation.Nullable String onCallRoleId) { + this.onCallRoleId = onCallRoleId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewApiKeyDataAttributes newApiKeyDataAttributes = (NewApiKeyDataAttributes) o; + return Objects.equals(this.name, newApiKeyDataAttributes.name) && + Objects.equals(this.description, newApiKeyDataAttributes.description) && + Objects.equals(this.kind, newApiKeyDataAttributes.kind) && + Objects.equals(this.expiresAt, newApiKeyDataAttributes.expiresAt) && + Objects.equals(this.groupId, newApiKeyDataAttributes.groupId) && + Objects.equals(this.roleId, newApiKeyDataAttributes.roleId) && + Objects.equals(this.onCallRoleId, newApiKeyDataAttributes.onCallRoleId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, kind, expiresAt, groupId, roleId, onCallRoleId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewApiKeyDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" onCallRoleId: ").append(toIndentedString(onCallRoleId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("kind"); + openapiFields.add("expires_at"); + openapiFields.add("group_id"); + openapiFields.add("role_id"); + openapiFields.add("on_call_role_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("kind"); + openapiRequiredFields.add("expires_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewApiKeyDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewApiKeyDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewApiKeyDataAttributes is not found in the empty JSON string", NewApiKeyDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewApiKeyDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewApiKeyDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewApiKeyDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if ((jsonObj.get("group_id") != null && !jsonObj.get("group_id").isJsonNull()) && !jsonObj.get("group_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `group_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("group_id").toString())); + } + if ((jsonObj.get("role_id") != null && !jsonObj.get("role_id").isJsonNull()) && !jsonObj.get("role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("role_id").toString())); + } + if ((jsonObj.get("on_call_role_id") != null && !jsonObj.get("on_call_role_id").isJsonNull()) && !jsonObj.get("on_call_role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `on_call_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("on_call_role_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewApiKeyDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewApiKeyDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewApiKeyDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewApiKeyDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewApiKeyDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewApiKeyDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewApiKeyDataAttributes + * @throws IOException if the JSON string is invalid with respect to NewApiKeyDataAttributes + */ + public static NewApiKeyDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewApiKeyDataAttributes.class); + } + + /** + * Convert an instance of NewApiKeyDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplate.java b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplate.java new file mode 100644 index 00000000..a7190ce9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplate.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogChecklistTemplate + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogChecklistTemplate { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private NewCatalogChecklistTemplateData data; + + public NewCatalogChecklistTemplate() { + } + + public NewCatalogChecklistTemplate data(@javax.annotation.Nonnull NewCatalogChecklistTemplateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public NewCatalogChecklistTemplateData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull NewCatalogChecklistTemplateData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogChecklistTemplate newCatalogChecklistTemplate = (NewCatalogChecklistTemplate) o; + return Objects.equals(this.data, newCatalogChecklistTemplate.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogChecklistTemplate {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogChecklistTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogChecklistTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogChecklistTemplate is not found in the empty JSON string", NewCatalogChecklistTemplate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogChecklistTemplate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogChecklistTemplate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogChecklistTemplate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + NewCatalogChecklistTemplateData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogChecklistTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogChecklistTemplate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogChecklistTemplate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogChecklistTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogChecklistTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogChecklistTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogChecklistTemplate + * @throws IOException if the JSON string is invalid with respect to NewCatalogChecklistTemplate + */ + public static NewCatalogChecklistTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogChecklistTemplate.class); + } + + /** + * Convert an instance of NewCatalogChecklistTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateData.java b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateData.java new file mode 100644 index 00000000..08445cd6 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogChecklistTemplateData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogChecklistTemplateData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_CHECKLIST_TEMPLATES("catalog_checklist_templates"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private NewCatalogChecklistTemplateDataAttributes attributes; + + public NewCatalogChecklistTemplateData() { + } + + public NewCatalogChecklistTemplateData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public NewCatalogChecklistTemplateData attributes(@javax.annotation.Nonnull NewCatalogChecklistTemplateDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public NewCatalogChecklistTemplateDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull NewCatalogChecklistTemplateDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogChecklistTemplateData newCatalogChecklistTemplateData = (NewCatalogChecklistTemplateData) o; + return Objects.equals(this.type, newCatalogChecklistTemplateData.type) && + Objects.equals(this.attributes, newCatalogChecklistTemplateData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogChecklistTemplateData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogChecklistTemplateData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogChecklistTemplateData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogChecklistTemplateData is not found in the empty JSON string", NewCatalogChecklistTemplateData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogChecklistTemplateData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogChecklistTemplateData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogChecklistTemplateData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + NewCatalogChecklistTemplateDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogChecklistTemplateData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogChecklistTemplateData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogChecklistTemplateData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogChecklistTemplateData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogChecklistTemplateData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogChecklistTemplateData given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogChecklistTemplateData + * @throws IOException if the JSON string is invalid with respect to NewCatalogChecklistTemplateData + */ + public static NewCatalogChecklistTemplateData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogChecklistTemplateData.class); + } + + /** + * Convert an instance of NewCatalogChecklistTemplateData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributes.java b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributes.java new file mode 100644 index 00000000..d5e8deaa --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributes.java @@ -0,0 +1,568 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesFieldsInner; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogChecklistTemplateDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogChecklistTemplateDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * The catalog type + */ + @JsonAdapter(CatalogTypeEnum.Adapter.class) + public enum CatalogTypeEnum { + SERVICE("Service"), + + FUNCTIONALITY("Functionality"), + + ENVIRONMENT("Environment"), + + GROUP("Group"), + + CAUSE("Cause"), + + INCIDENT_TYPE("IncidentType"), + + CATALOG("Catalog"); + + private String value; + + CatalogTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CatalogTypeEnum fromValue(String value) { + for (CatalogTypeEnum b : CatalogTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CatalogTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CatalogTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CatalogTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CatalogTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CATALOG_TYPE = "catalog_type"; + @SerializedName(SERIALIZED_NAME_CATALOG_TYPE) + @javax.annotation.Nonnull + private CatalogTypeEnum catalogType; + + /** + * The scope type + */ + @JsonAdapter(ScopeTypeEnum.Adapter.class) + public enum ScopeTypeEnum { + TEAM("Team"), + + CATALOG("Catalog"); + + private String value; + + ScopeTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ScopeTypeEnum fromValue(String value) { + for (ScopeTypeEnum b : ScopeTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ScopeTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ScopeTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ScopeTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ScopeTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SCOPE_TYPE = "scope_type"; + @SerializedName(SERIALIZED_NAME_SCOPE_TYPE) + @javax.annotation.Nonnull + private ScopeTypeEnum scopeType; + + public static final String SERIALIZED_NAME_SCOPE_ID = "scope_id"; + @SerializedName(SERIALIZED_NAME_SCOPE_ID) + @javax.annotation.Nullable + private String scopeId; + + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + @javax.annotation.Nullable + private List fields; + + public static final String SERIALIZED_NAME_OWNERS = "owners"; + @SerializedName(SERIALIZED_NAME_OWNERS) + @javax.annotation.Nullable + private List owners; + + public NewCatalogChecklistTemplateDataAttributes() { + } + + public NewCatalogChecklistTemplateDataAttributes name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the checklist template + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public NewCatalogChecklistTemplateDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the checklist template + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public NewCatalogChecklistTemplateDataAttributes catalogType(@javax.annotation.Nonnull CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + return this; + } + + /** + * The catalog type + * @return catalogType + */ + @javax.annotation.Nonnull + public CatalogTypeEnum getCatalogType() { + return catalogType; + } + + public void setCatalogType(@javax.annotation.Nonnull CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + } + + + public NewCatalogChecklistTemplateDataAttributes scopeType(@javax.annotation.Nonnull ScopeTypeEnum scopeType) { + this.scopeType = scopeType; + return this; + } + + /** + * The scope type + * @return scopeType + */ + @javax.annotation.Nonnull + public ScopeTypeEnum getScopeType() { + return scopeType; + } + + public void setScopeType(@javax.annotation.Nonnull ScopeTypeEnum scopeType) { + this.scopeType = scopeType; + } + + + public NewCatalogChecklistTemplateDataAttributes scopeId(@javax.annotation.Nullable String scopeId) { + this.scopeId = scopeId; + return this; + } + + /** + * The scope ID (team or catalog UUID) + * @return scopeId + */ + @javax.annotation.Nullable + public String getScopeId() { + return scopeId; + } + + public void setScopeId(@javax.annotation.Nullable String scopeId) { + this.scopeId = scopeId; + } + + + public NewCatalogChecklistTemplateDataAttributes fields(@javax.annotation.Nullable List fields) { + this.fields = fields; + return this; + } + + public NewCatalogChecklistTemplateDataAttributes addFieldsItem(NewCatalogChecklistTemplateDataAttributesFieldsInner fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Template fields. Position is determined by array order. + * @return fields + */ + @javax.annotation.Nullable + public List getFields() { + return fields; + } + + public void setFields(@javax.annotation.Nullable List fields) { + this.fields = fields; + } + + + public NewCatalogChecklistTemplateDataAttributes owners(@javax.annotation.Nullable List owners) { + this.owners = owners; + return this; + } + + public NewCatalogChecklistTemplateDataAttributes addOwnersItem(NewCatalogChecklistTemplateDataAttributesOwnersInner ownersItem) { + if (this.owners == null) { + this.owners = new ArrayList<>(); + } + this.owners.add(ownersItem); + return this; + } + + /** + * Template owners + * @return owners + */ + @javax.annotation.Nullable + public List getOwners() { + return owners; + } + + public void setOwners(@javax.annotation.Nullable List owners) { + this.owners = owners; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogChecklistTemplateDataAttributes newCatalogChecklistTemplateDataAttributes = (NewCatalogChecklistTemplateDataAttributes) o; + return Objects.equals(this.name, newCatalogChecklistTemplateDataAttributes.name) && + Objects.equals(this.description, newCatalogChecklistTemplateDataAttributes.description) && + Objects.equals(this.catalogType, newCatalogChecklistTemplateDataAttributes.catalogType) && + Objects.equals(this.scopeType, newCatalogChecklistTemplateDataAttributes.scopeType) && + Objects.equals(this.scopeId, newCatalogChecklistTemplateDataAttributes.scopeId) && + Objects.equals(this.fields, newCatalogChecklistTemplateDataAttributes.fields) && + Objects.equals(this.owners, newCatalogChecklistTemplateDataAttributes.owners); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, catalogType, scopeType, scopeId, fields, owners); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogChecklistTemplateDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" catalogType: ").append(toIndentedString(catalogType)).append("\n"); + sb.append(" scopeType: ").append(toIndentedString(scopeType)).append("\n"); + sb.append(" scopeId: ").append(toIndentedString(scopeId)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" owners: ").append(toIndentedString(owners)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("catalog_type"); + openapiFields.add("scope_type"); + openapiFields.add("scope_id"); + openapiFields.add("fields"); + openapiFields.add("owners"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("catalog_type"); + openapiRequiredFields.add("scope_type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogChecklistTemplateDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogChecklistTemplateDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogChecklistTemplateDataAttributes is not found in the empty JSON string", NewCatalogChecklistTemplateDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogChecklistTemplateDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogChecklistTemplateDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogChecklistTemplateDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (!jsonObj.get("catalog_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_type").toString())); + } + // validate the required field `catalog_type` + CatalogTypeEnum.validateJsonElement(jsonObj.get("catalog_type")); + if (!jsonObj.get("scope_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope_type").toString())); + } + // validate the required field `scope_type` + ScopeTypeEnum.validateJsonElement(jsonObj.get("scope_type")); + if ((jsonObj.get("scope_id") != null && !jsonObj.get("scope_id").isJsonNull()) && !jsonObj.get("scope_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope_id").toString())); + } + if (jsonObj.get("fields") != null && !jsonObj.get("fields").isJsonNull()) { + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + if (jsonArrayfields != null) { + // ensure the json data is an array + if (!jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); + } + + // validate the optional field `fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + NewCatalogChecklistTemplateDataAttributesFieldsInner.validateJsonElement(jsonArrayfields.get(i)); + }; + } + } + if (jsonObj.get("owners") != null && !jsonObj.get("owners").isJsonNull()) { + JsonArray jsonArrayowners = jsonObj.getAsJsonArray("owners"); + if (jsonArrayowners != null) { + // ensure the json data is an array + if (!jsonObj.get("owners").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `owners` to be an array in the JSON string but got `%s`", jsonObj.get("owners").toString())); + } + + // validate the optional field `owners` (array) + for (int i = 0; i < jsonArrayowners.size(); i++) { + NewCatalogChecklistTemplateDataAttributesOwnersInner.validateJsonElement(jsonArrayowners.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogChecklistTemplateDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogChecklistTemplateDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogChecklistTemplateDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogChecklistTemplateDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogChecklistTemplateDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogChecklistTemplateDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogChecklistTemplateDataAttributes + * @throws IOException if the JSON string is invalid with respect to NewCatalogChecklistTemplateDataAttributes + */ + public static NewCatalogChecklistTemplateDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogChecklistTemplateDataAttributes.class); + } + + /** + * Convert an instance of NewCatalogChecklistTemplateDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesFieldsInner.java b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesFieldsInner.java new file mode 100644 index 00000000..21153807 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesFieldsInner.java @@ -0,0 +1,275 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.BuiltinField; +import com.rootly.client.model.CustomField; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.rootly.client.JSON; + +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogChecklistTemplateDataAttributesFieldsInner extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NewCatalogChecklistTemplateDataAttributesFieldsInner.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogChecklistTemplateDataAttributesFieldsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogChecklistTemplateDataAttributesFieldsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterBuiltinField = gson.getDelegateAdapter(this, TypeToken.get(BuiltinField.class)); + final TypeAdapter adapterCustomField = gson.getDelegateAdapter(this, TypeToken.get(CustomField.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogChecklistTemplateDataAttributesFieldsInner value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BuiltinField` + if (value.getActualInstance() instanceof BuiltinField) { + JsonElement element = adapterBuiltinField.toJsonTree((BuiltinField)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `CustomField` + if (value.getActualInstance() instanceof CustomField) { + JsonElement element = adapterCustomField.toJsonTree((CustomField)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BuiltinField, CustomField"); + } + + @Override + public NewCatalogChecklistTemplateDataAttributesFieldsInner read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BuiltinField + try { + // validate the JSON object to see if any exception is thrown + BuiltinField.validateJsonElement(jsonElement); + actualAdapter = adapterBuiltinField; + match++; + log.log(Level.FINER, "Input data matches schema 'BuiltinField'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BuiltinField failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BuiltinField'", e); + } + // deserialize CustomField + try { + // validate the JSON object to see if any exception is thrown + CustomField.validateJsonElement(jsonElement); + actualAdapter = adapterCustomField; + match++; + log.log(Level.FINER, "Input data matches schema 'CustomField'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CustomField failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CustomField'", e); + } + + if (match == 1) { + NewCatalogChecklistTemplateDataAttributesFieldsInner ret = new NewCatalogChecklistTemplateDataAttributesFieldsInner(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for NewCatalogChecklistTemplateDataAttributesFieldsInner: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap>(); + + public NewCatalogChecklistTemplateDataAttributesFieldsInner() { + super("oneOf", Boolean.FALSE); + } + + public NewCatalogChecklistTemplateDataAttributesFieldsInner(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BuiltinField", BuiltinField.class); + schemas.put("CustomField", CustomField.class); + } + + @Override + public Map> getSchemas() { + return NewCatalogChecklistTemplateDataAttributesFieldsInner.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BuiltinField, CustomField + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BuiltinField) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CustomField) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BuiltinField, CustomField"); + } + + /** + * Get the actual instance, which can be the following: + * BuiltinField, CustomField + * + * @return The actual instance (BuiltinField, CustomField) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BuiltinField`. If the actual instance is not `BuiltinField`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BuiltinField` + * @throws ClassCastException if the instance is not `BuiltinField` + */ + public BuiltinField getBuiltinField() throws ClassCastException { + return (BuiltinField)super.getActualInstance(); + } + + /** + * Get the actual instance of `CustomField`. If the actual instance is not `CustomField`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CustomField` + * @throws ClassCastException if the instance is not `CustomField` + */ + public CustomField getCustomField() throws ClassCastException { + return (CustomField)super.getActualInstance(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogChecklistTemplateDataAttributesFieldsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with BuiltinField + try { + BuiltinField.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BuiltinField failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CustomField + try { + CustomField.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CustomField failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NewCatalogChecklistTemplateDataAttributesFieldsInner with oneOf schemas: BuiltinField, CustomField. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of NewCatalogChecklistTemplateDataAttributesFieldsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogChecklistTemplateDataAttributesFieldsInner + * @throws IOException if the JSON string is invalid with respect to NewCatalogChecklistTemplateDataAttributesFieldsInner + */ + public static NewCatalogChecklistTemplateDataAttributesFieldsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogChecklistTemplateDataAttributesFieldsInner.class); + } + + /** + * Convert an instance of NewCatalogChecklistTemplateDataAttributesFieldsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesOwnersInner.java b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesOwnersInner.java new file mode 100644 index 00000000..3441dc7a --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesOwnersInner.java @@ -0,0 +1,299 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogChecklistTemplateDataAttributesOwnersInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogChecklistTemplateDataAttributesOwnersInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Type of owner + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + FIELD("field"), + + USER("user"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public NewCatalogChecklistTemplateDataAttributesOwnersInner() { + } + + public NewCatalogChecklistTemplateDataAttributesOwnersInner id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * User ID for user owners, or field key for field owners + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public NewCatalogChecklistTemplateDataAttributesOwnersInner type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Type of owner + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogChecklistTemplateDataAttributesOwnersInner newCatalogChecklistTemplateDataAttributesOwnersInner = (NewCatalogChecklistTemplateDataAttributesOwnersInner) o; + return Objects.equals(this.id, newCatalogChecklistTemplateDataAttributesOwnersInner.id) && + Objects.equals(this.type, newCatalogChecklistTemplateDataAttributesOwnersInner.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogChecklistTemplateDataAttributesOwnersInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogChecklistTemplateDataAttributesOwnersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogChecklistTemplateDataAttributesOwnersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogChecklistTemplateDataAttributesOwnersInner is not found in the empty JSON string", NewCatalogChecklistTemplateDataAttributesOwnersInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogChecklistTemplateDataAttributesOwnersInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogChecklistTemplateDataAttributesOwnersInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogChecklistTemplateDataAttributesOwnersInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogChecklistTemplateDataAttributesOwnersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogChecklistTemplateDataAttributesOwnersInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogChecklistTemplateDataAttributesOwnersInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogChecklistTemplateDataAttributesOwnersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogChecklistTemplateDataAttributesOwnersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogChecklistTemplateDataAttributesOwnersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogChecklistTemplateDataAttributesOwnersInner + * @throws IOException if the JSON string is invalid with respect to NewCatalogChecklistTemplateDataAttributesOwnersInner + */ + public static NewCatalogChecklistTemplateDataAttributesOwnersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogChecklistTemplateDataAttributesOwnersInner.class); + } + + /** + * Convert an instance of NewCatalogChecklistTemplateDataAttributesOwnersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogEntityDataAttributesPropertiesInner.java b/src/main/java/com/rootly/client/model/NewCatalogEntityDataAttributesPropertiesInner.java new file mode 100644 index 00000000..dcd43cf1 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogEntityDataAttributesPropertiesInner.java @@ -0,0 +1,245 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogEntityDataAttributesPropertiesInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogEntityDataAttributesPropertiesInner { + public static final String SERIALIZED_NAME_CATALOG_PROPERTY_ID = "catalog_property_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_PROPERTY_ID) + @javax.annotation.Nonnull + private String catalogPropertyId; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public NewCatalogEntityDataAttributesPropertiesInner() { + } + + public NewCatalogEntityDataAttributesPropertiesInner catalogPropertyId(@javax.annotation.Nonnull String catalogPropertyId) { + this.catalogPropertyId = catalogPropertyId; + return this; + } + + /** + * Unique ID of the catalog property + * @return catalogPropertyId + */ + @javax.annotation.Nonnull + public String getCatalogPropertyId() { + return catalogPropertyId; + } + + public void setCatalogPropertyId(@javax.annotation.Nonnull String catalogPropertyId) { + this.catalogPropertyId = catalogPropertyId; + } + + + public NewCatalogEntityDataAttributesPropertiesInner value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The value for this property + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogEntityDataAttributesPropertiesInner newCatalogEntityDataAttributesPropertiesInner = (NewCatalogEntityDataAttributesPropertiesInner) o; + return Objects.equals(this.catalogPropertyId, newCatalogEntityDataAttributesPropertiesInner.catalogPropertyId) && + Objects.equals(this.value, newCatalogEntityDataAttributesPropertiesInner.value); + } + + @Override + public int hashCode() { + return Objects.hash(catalogPropertyId, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogEntityDataAttributesPropertiesInner {\n"); + sb.append(" catalogPropertyId: ").append(toIndentedString(catalogPropertyId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("catalog_property_id"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("catalog_property_id"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogEntityDataAttributesPropertiesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogEntityDataAttributesPropertiesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogEntityDataAttributesPropertiesInner is not found in the empty JSON string", NewCatalogEntityDataAttributesPropertiesInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogEntityDataAttributesPropertiesInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogEntityDataAttributesPropertiesInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogEntityDataAttributesPropertiesInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("catalog_property_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_property_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_property_id").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogEntityDataAttributesPropertiesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogEntityDataAttributesPropertiesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogEntityDataAttributesPropertiesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogEntityDataAttributesPropertiesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogEntityDataAttributesPropertiesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogEntityDataAttributesPropertiesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogEntityDataAttributesPropertiesInner + * @throws IOException if the JSON string is invalid with respect to NewCatalogEntityDataAttributesPropertiesInner + */ + public static NewCatalogEntityDataAttributesPropertiesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogEntityDataAttributesPropertiesInner.class); + } + + /** + * Convert an instance of NewCatalogEntityDataAttributesPropertiesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogProperty.java b/src/main/java/com/rootly/client/model/NewCatalogProperty.java new file mode 100644 index 00000000..b27e7db9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogProperty.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogPropertyData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * A catalog can have a maximum of 50 properties. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogProperty { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private NewCatalogPropertyData data; + + public NewCatalogProperty() { + } + + public NewCatalogProperty data(@javax.annotation.Nonnull NewCatalogPropertyData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public NewCatalogPropertyData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull NewCatalogPropertyData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogProperty newCatalogProperty = (NewCatalogProperty) o; + return Objects.equals(this.data, newCatalogProperty.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogProperty {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogProperty + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogProperty.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogProperty is not found in the empty JSON string", NewCatalogProperty.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogProperty.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogProperty` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogProperty.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + NewCatalogPropertyData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogProperty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogProperty' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogProperty.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogProperty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogProperty read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogProperty given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogProperty + * @throws IOException if the JSON string is invalid with respect to NewCatalogProperty + */ + public static NewCatalogProperty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogProperty.class); + } + + /** + * Convert an instance of NewCatalogProperty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogPropertyData.java b/src/main/java/com/rootly/client/model/NewCatalogPropertyData.java new file mode 100644 index 00000000..8114971a --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogPropertyData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogPropertyDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogPropertyData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogPropertyData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_PROPERTIES("catalog_properties"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private NewCatalogPropertyDataAttributes attributes; + + public NewCatalogPropertyData() { + } + + public NewCatalogPropertyData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public NewCatalogPropertyData attributes(@javax.annotation.Nonnull NewCatalogPropertyDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public NewCatalogPropertyDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull NewCatalogPropertyDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogPropertyData newCatalogPropertyData = (NewCatalogPropertyData) o; + return Objects.equals(this.type, newCatalogPropertyData.type) && + Objects.equals(this.attributes, newCatalogPropertyData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogPropertyData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogPropertyData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogPropertyData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogPropertyData is not found in the empty JSON string", NewCatalogPropertyData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogPropertyData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogPropertyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogPropertyData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + NewCatalogPropertyDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogPropertyData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogPropertyData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogPropertyData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogPropertyData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogPropertyData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogPropertyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogPropertyData + * @throws IOException if the JSON string is invalid with respect to NewCatalogPropertyData + */ + public static NewCatalogPropertyData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogPropertyData.class); + } + + /** + * Convert an instance of NewCatalogPropertyData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCatalogPropertyDataAttributes.java b/src/main/java/com/rootly/client/model/NewCatalogPropertyDataAttributes.java new file mode 100644 index 00000000..aca9dfbb --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCatalogPropertyDataAttributes.java @@ -0,0 +1,536 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewCatalogPropertyDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCatalogPropertyDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + TEXT("text"), + + REFERENCE("reference"), + + BOOLEAN("boolean"), + + REFERENCE2("reference"), + + SERVICE("service"), + + FUNCTIONALITY("functionality"), + + ENVIRONMENT("environment"), + + GROUP("group"), + + CAUSE("cause"), + + INCIDENT_TYPE("incident_type"), + + USER("user"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nonnull + private KindEnum kind; + + public static final String SERIALIZED_NAME_KIND_CATALOG_ID = "kind_catalog_id"; + @SerializedName(SERIALIZED_NAME_KIND_CATALOG_ID) + @javax.annotation.Nullable + private String kindCatalogId; + + public static final String SERIALIZED_NAME_MULTIPLE = "multiple"; + @SerializedName(SERIALIZED_NAME_MULTIPLE) + @javax.annotation.Nullable + private Boolean multiple; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public static final String SERIALIZED_NAME_REQUIRED = "required"; + @SerializedName(SERIALIZED_NAME_REQUIRED) + @javax.annotation.Nullable + private Boolean required; + + /** + * The type of catalog the property belongs to. + */ + @JsonAdapter(CatalogTypeEnum.Adapter.class) + public enum CatalogTypeEnum { + CATALOG("catalog"), + + CAUSE("cause"), + + ENVIRONMENT("environment"), + + FUNCTIONALITY("functionality"), + + INCIDENT_TYPE("incident_type"), + + SERVICE("service"), + + TEAM("team"); + + private String value; + + CatalogTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CatalogTypeEnum fromValue(String value) { + for (CatalogTypeEnum b : CatalogTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CatalogTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CatalogTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CatalogTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CatalogTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CATALOG_TYPE = "catalog_type"; + @SerializedName(SERIALIZED_NAME_CATALOG_TYPE) + @javax.annotation.Nullable + private CatalogTypeEnum catalogType; + + public NewCatalogPropertyDataAttributes() { + } + + public NewCatalogPropertyDataAttributes name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public NewCatalogPropertyDataAttributes kind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + @javax.annotation.Nonnull + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nonnull KindEnum kind) { + this.kind = kind; + } + + + public NewCatalogPropertyDataAttributes kindCatalogId(@javax.annotation.Nullable String kindCatalogId) { + this.kindCatalogId = kindCatalogId; + return this; + } + + /** + * Restricts values to items of specified catalog. + * @return kindCatalogId + */ + @javax.annotation.Nullable + public String getKindCatalogId() { + return kindCatalogId; + } + + public void setKindCatalogId(@javax.annotation.Nullable String kindCatalogId) { + this.kindCatalogId = kindCatalogId; + } + + + public NewCatalogPropertyDataAttributes multiple(@javax.annotation.Nullable Boolean multiple) { + this.multiple = multiple; + return this; + } + + /** + * Whether the attribute accepts multiple values. + * @return multiple + */ + @javax.annotation.Nullable + public Boolean getMultiple() { + return multiple; + } + + public void setMultiple(@javax.annotation.Nullable Boolean multiple) { + this.multiple = multiple; + } + + + public NewCatalogPropertyDataAttributes position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Default position of the item when displayed in a list. + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public NewCatalogPropertyDataAttributes required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Whether the property is required. + * @return required + */ + @javax.annotation.Nullable + public Boolean getRequired() { + return required; + } + + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public NewCatalogPropertyDataAttributes catalogType(@javax.annotation.Nullable CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + return this; + } + + /** + * The type of catalog the property belongs to. + * @return catalogType + */ + @javax.annotation.Nullable + public CatalogTypeEnum getCatalogType() { + return catalogType; + } + + public void setCatalogType(@javax.annotation.Nullable CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCatalogPropertyDataAttributes newCatalogPropertyDataAttributes = (NewCatalogPropertyDataAttributes) o; + return Objects.equals(this.name, newCatalogPropertyDataAttributes.name) && + Objects.equals(this.kind, newCatalogPropertyDataAttributes.kind) && + Objects.equals(this.kindCatalogId, newCatalogPropertyDataAttributes.kindCatalogId) && + Objects.equals(this.multiple, newCatalogPropertyDataAttributes.multiple) && + Objects.equals(this.position, newCatalogPropertyDataAttributes.position) && + Objects.equals(this.required, newCatalogPropertyDataAttributes.required) && + Objects.equals(this.catalogType, newCatalogPropertyDataAttributes.catalogType); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, kind, kindCatalogId, multiple, position, required, catalogType); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCatalogPropertyDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" kindCatalogId: ").append(toIndentedString(kindCatalogId)).append("\n"); + sb.append(" multiple: ").append(toIndentedString(multiple)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" catalogType: ").append(toIndentedString(catalogType)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("kind"); + openapiFields.add("kind_catalog_id"); + openapiFields.add("multiple"); + openapiFields.add("position"); + openapiFields.add("required"); + openapiFields.add("catalog_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("kind"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCatalogPropertyDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCatalogPropertyDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCatalogPropertyDataAttributes is not found in the empty JSON string", NewCatalogPropertyDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCatalogPropertyDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCatalogPropertyDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCatalogPropertyDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (!jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the required field `kind` + KindEnum.validateJsonElement(jsonObj.get("kind")); + if ((jsonObj.get("kind_catalog_id") != null && !jsonObj.get("kind_catalog_id").isJsonNull()) && !jsonObj.get("kind_catalog_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind_catalog_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind_catalog_id").toString())); + } + if ((jsonObj.get("catalog_type") != null && !jsonObj.get("catalog_type").isJsonNull()) && !jsonObj.get("catalog_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_type").toString())); + } + // validate the optional field `catalog_type` + if (jsonObj.get("catalog_type") != null && !jsonObj.get("catalog_type").isJsonNull()) { + CatalogTypeEnum.validateJsonElement(jsonObj.get("catalog_type")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCatalogPropertyDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCatalogPropertyDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCatalogPropertyDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCatalogPropertyDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCatalogPropertyDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCatalogPropertyDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCatalogPropertyDataAttributes + * @throws IOException if the JSON string is invalid with respect to NewCatalogPropertyDataAttributes + */ + public static NewCatalogPropertyDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCatalogPropertyDataAttributes.class); + } + + /** + * Convert an instance of NewCatalogPropertyDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewCauseDataAttributesPropertiesInner.java b/src/main/java/com/rootly/client/model/NewCauseDataAttributesPropertiesInner.java new file mode 100644 index 00000000..19914bec --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewCauseDataAttributesPropertiesInner.java @@ -0,0 +1,245 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * Set a value for a catalog property + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewCauseDataAttributesPropertiesInner { + public static final String SERIALIZED_NAME_CATALOG_PROPERTY_ID = "catalog_property_id"; + @SerializedName(SERIALIZED_NAME_CATALOG_PROPERTY_ID) + @javax.annotation.Nonnull + private String catalogPropertyId; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public NewCauseDataAttributesPropertiesInner() { + } + + public NewCauseDataAttributesPropertiesInner catalogPropertyId(@javax.annotation.Nonnull String catalogPropertyId) { + this.catalogPropertyId = catalogPropertyId; + return this; + } + + /** + * Catalog property ID + * @return catalogPropertyId + */ + @javax.annotation.Nonnull + public String getCatalogPropertyId() { + return catalogPropertyId; + } + + public void setCatalogPropertyId(@javax.annotation.Nonnull String catalogPropertyId) { + this.catalogPropertyId = catalogPropertyId; + } + + + public NewCauseDataAttributesPropertiesInner value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The property value + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewCauseDataAttributesPropertiesInner newCauseDataAttributesPropertiesInner = (NewCauseDataAttributesPropertiesInner) o; + return Objects.equals(this.catalogPropertyId, newCauseDataAttributesPropertiesInner.catalogPropertyId) && + Objects.equals(this.value, newCauseDataAttributesPropertiesInner.value); + } + + @Override + public int hashCode() { + return Objects.hash(catalogPropertyId, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewCauseDataAttributesPropertiesInner {\n"); + sb.append(" catalogPropertyId: ").append(toIndentedString(catalogPropertyId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("catalog_property_id"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("catalog_property_id"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewCauseDataAttributesPropertiesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewCauseDataAttributesPropertiesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewCauseDataAttributesPropertiesInner is not found in the empty JSON string", NewCauseDataAttributesPropertiesInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewCauseDataAttributesPropertiesInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewCauseDataAttributesPropertiesInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewCauseDataAttributesPropertiesInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("catalog_property_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_property_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_property_id").toString())); + } + if (!jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewCauseDataAttributesPropertiesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewCauseDataAttributesPropertiesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewCauseDataAttributesPropertiesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewCauseDataAttributesPropertiesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewCauseDataAttributesPropertiesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewCauseDataAttributesPropertiesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewCauseDataAttributesPropertiesInner + * @throws IOException if the JSON string is invalid with respect to NewCauseDataAttributesPropertiesInner + */ + public static NewCauseDataAttributesPropertiesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewCauseDataAttributesPropertiesInner.class); + } + + /** + * Convert an instance of NewCauseDataAttributesPropertiesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf.java new file mode 100644 index 00000000..3b88c578 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf.java @@ -0,0 +1,310 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf { + /** + * The type of the escalation path rule + */ + @JsonAdapter(RuleTypeEnum.Adapter.class) + public enum RuleTypeEnum { + ALERT_URGENCY("alert_urgency"); + + private String value; + + RuleTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RuleTypeEnum fromValue(String value) { + for (RuleTypeEnum b : RuleTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RuleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RuleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RuleTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RuleTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RULE_TYPE = "rule_type"; + @SerializedName(SERIALIZED_NAME_RULE_TYPE) + @javax.annotation.Nonnull + private RuleTypeEnum ruleType; + + public static final String SERIALIZED_NAME_URGENCY_IDS = "urgency_ids"; + @SerializedName(SERIALIZED_NAME_URGENCY_IDS) + @javax.annotation.Nonnull + private List urgencyIds = new ArrayList<>(); + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf ruleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * The type of the escalation path rule + * @return ruleType + */ + @javax.annotation.Nonnull + public RuleTypeEnum getRuleType() { + return ruleType; + } + + public void setRuleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf urgencyIds(@javax.annotation.Nonnull List urgencyIds) { + this.urgencyIds = urgencyIds; + return this; + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf addUrgencyIdsItem(String urgencyIdsItem) { + if (this.urgencyIds == null) { + this.urgencyIds = new ArrayList<>(); + } + this.urgencyIds.add(urgencyIdsItem); + return this; + } + + /** + * Alert urgency ids for which this escalation path should be used + * @return urgencyIds + */ + @javax.annotation.Nonnull + public List getUrgencyIds() { + return urgencyIds; + } + + public void setUrgencyIds(@javax.annotation.Nonnull List urgencyIds) { + this.urgencyIds = urgencyIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf newEscalationPolicyPathDataAttributesRulesInnerOneOf = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf) o; + return Objects.equals(this.ruleType, newEscalationPolicyPathDataAttributesRulesInnerOneOf.ruleType) && + Objects.equals(this.urgencyIds, newEscalationPolicyPathDataAttributesRulesInnerOneOf.urgencyIds); + } + + @Override + public int hashCode() { + return Objects.hash(ruleType, urgencyIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf {\n"); + sb.append(" ruleType: ").append(toIndentedString(ruleType)).append("\n"); + sb.append(" urgencyIds: ").append(toIndentedString(urgencyIds)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rule_type"); + openapiFields.add("urgency_ids"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rule_type"); + openapiRequiredFields.add("urgency_ids"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEscalationPolicyPathDataAttributesRulesInnerOneOf.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("rule_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rule_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_type").toString())); + } + // validate the required field `rule_type` + RuleTypeEnum.validateJsonElement(jsonObj.get("rule_type")); + // ensure the required json array is present + if (jsonObj.get("urgency_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("urgency_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `urgency_ids` to be an array in the JSON string but got `%s`", jsonObj.get("urgency_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.java new file mode 100644 index 00000000..9bfc4146 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.java @@ -0,0 +1,294 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 { + /** + * The type of the escalation path rule + */ + @JsonAdapter(RuleTypeEnum.Adapter.class) + public enum RuleTypeEnum { + WORKING_HOUR("working_hour"); + + private String value; + + RuleTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RuleTypeEnum fromValue(String value) { + for (RuleTypeEnum b : RuleTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RuleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RuleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RuleTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RuleTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RULE_TYPE = "rule_type"; + @SerializedName(SERIALIZED_NAME_RULE_TYPE) + @javax.annotation.Nonnull + private RuleTypeEnum ruleType; + + public static final String SERIALIZED_NAME_WITHIN_WORKING_HOUR = "within_working_hour"; + @SerializedName(SERIALIZED_NAME_WITHIN_WORKING_HOUR) + @javax.annotation.Nonnull + private Boolean withinWorkingHour; + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf1() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 ruleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * The type of the escalation path rule + * @return ruleType + */ + @javax.annotation.Nonnull + public RuleTypeEnum getRuleType() { + return ruleType; + } + + public void setRuleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 withinWorkingHour(@javax.annotation.Nonnull Boolean withinWorkingHour) { + this.withinWorkingHour = withinWorkingHour; + return this; + } + + /** + * Whether the escalation path should be used within working hours + * @return withinWorkingHour + */ + @javax.annotation.Nonnull + public Boolean getWithinWorkingHour() { + return withinWorkingHour; + } + + public void setWithinWorkingHour(@javax.annotation.Nonnull Boolean withinWorkingHour) { + this.withinWorkingHour = withinWorkingHour; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 newEscalationPolicyPathDataAttributesRulesInnerOneOf1 = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf1) o; + return Objects.equals(this.ruleType, newEscalationPolicyPathDataAttributesRulesInnerOneOf1.ruleType) && + Objects.equals(this.withinWorkingHour, newEscalationPolicyPathDataAttributesRulesInnerOneOf1.withinWorkingHour); + } + + @Override + public int hashCode() { + return Objects.hash(ruleType, withinWorkingHour); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 {\n"); + sb.append(" ruleType: ").append(toIndentedString(ruleType)).append("\n"); + sb.append(" withinWorkingHour: ").append(toIndentedString(withinWorkingHour)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rule_type"); + openapiFields.add("within_working_hour"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rule_type"); + openapiRequiredFields.add("within_working_hour"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf1` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("rule_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rule_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_type").toString())); + } + // validate the required field `rule_type` + RuleTypeEnum.validateJsonElement(jsonObj.get("rule_type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf1' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf1.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.java new file mode 100644 index 00000000..b7176dcd --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.java @@ -0,0 +1,477 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 { + /** + * The type of the escalation path rule + */ + @JsonAdapter(RuleTypeEnum.Adapter.class) + public enum RuleTypeEnum { + JSON_PATH("json_path"); + + private String value; + + RuleTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RuleTypeEnum fromValue(String value) { + for (RuleTypeEnum b : RuleTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RuleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RuleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RuleTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RuleTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RULE_TYPE = "rule_type"; + @SerializedName(SERIALIZED_NAME_RULE_TYPE) + @javax.annotation.Nonnull + private RuleTypeEnum ruleType; + + public static final String SERIALIZED_NAME_JSON_PATH = "json_path"; + @SerializedName(SERIALIZED_NAME_JSON_PATH) + @javax.annotation.Nonnull + private String jsonPath; + + /** + * How JSON path value should be matched + */ + @JsonAdapter(OperatorEnum.Adapter.class) + public enum OperatorEnum { + IS("is"), + + IS_NOT("is_not"), + + CONTAINS("contains"), + + DOES_NOT_CONTAIN("does_not_contain"), + + IS_ONE_OF("is_one_of"), + + IS_NOT_ONE_OF("is_not_one_of"), + + IS_SET("is_set"), + + IS_NOT_SET("is_not_set"); + + private String value; + + OperatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OperatorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperatorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperatorEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OperatorEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nonnull + private OperatorEnum operator; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public static final String SERIALIZED_NAME_VALUES = "values"; + @SerializedName(SERIALIZED_NAME_VALUES) + @javax.annotation.Nullable + private List values = new ArrayList<>(); + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 ruleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * The type of the escalation path rule + * @return ruleType + */ + @javax.annotation.Nonnull + public RuleTypeEnum getRuleType() { + return ruleType; + } + + public void setRuleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 jsonPath(@javax.annotation.Nonnull String jsonPath) { + this.jsonPath = jsonPath; + return this; + } + + /** + * JSON path to extract value from payload + * @return jsonPath + */ + @javax.annotation.Nonnull + public String getJsonPath() { + return jsonPath; + } + + public void setJsonPath(@javax.annotation.Nonnull String jsonPath) { + this.jsonPath = jsonPath; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 operator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + return this; + } + + /** + * How JSON path value should be matched + * @return operator + */ + @javax.annotation.Nonnull + public OperatorEnum getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Value with which JSON path value should be matched + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 values(@javax.annotation.Nullable List values) { + this.values = values; + return this; + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Values to match against (for is_one_of / is_not_one_of operators) + * @return values + */ + @javax.annotation.Nullable + public List getValues() { + return values; + } + + public void setValues(@javax.annotation.Nullable List values) { + this.values = values; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 newEscalationPolicyPathDataAttributesRulesInnerOneOf2 = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf2) o; + return Objects.equals(this.ruleType, newEscalationPolicyPathDataAttributesRulesInnerOneOf2.ruleType) && + Objects.equals(this.jsonPath, newEscalationPolicyPathDataAttributesRulesInnerOneOf2.jsonPath) && + Objects.equals(this.operator, newEscalationPolicyPathDataAttributesRulesInnerOneOf2.operator) && + Objects.equals(this.value, newEscalationPolicyPathDataAttributesRulesInnerOneOf2.value) && + Objects.equals(this.values, newEscalationPolicyPathDataAttributesRulesInnerOneOf2.values); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(ruleType, jsonPath, operator, value, values); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 {\n"); + sb.append(" ruleType: ").append(toIndentedString(ruleType)).append("\n"); + sb.append(" jsonPath: ").append(toIndentedString(jsonPath)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rule_type"); + openapiFields.add("json_path"); + openapiFields.add("operator"); + openapiFields.add("value"); + openapiFields.add("values"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rule_type"); + openapiRequiredFields.add("json_path"); + openapiRequiredFields.add("operator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf2` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("rule_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rule_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_type").toString())); + } + // validate the required field `rule_type` + RuleTypeEnum.validateJsonElement(jsonObj.get("rule_type")); + if (!jsonObj.get("json_path").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `json_path` to be a primitive type in the JSON string but got `%s`", jsonObj.get("json_path").toString())); + } + if (!jsonObj.get("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + // validate the required field `operator` + OperatorEnum.validateJsonElement(jsonObj.get("operator")); + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonNull() && !jsonObj.get("values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf2.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.java new file mode 100644 index 00000000..ef52997b --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.java @@ -0,0 +1,478 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 { + /** + * The type of the escalation path rule + */ + @JsonAdapter(RuleTypeEnum.Adapter.class) + public enum RuleTypeEnum { + FIELD("field"); + + private String value; + + RuleTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RuleTypeEnum fromValue(String value) { + for (RuleTypeEnum b : RuleTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RuleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RuleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RuleTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RuleTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RULE_TYPE = "rule_type"; + @SerializedName(SERIALIZED_NAME_RULE_TYPE) + @javax.annotation.Nonnull + private RuleTypeEnum ruleType; + + public static final String SERIALIZED_NAME_FIELDABLE_TYPE = "fieldable_type"; + @SerializedName(SERIALIZED_NAME_FIELDABLE_TYPE) + @javax.annotation.Nonnull + private String fieldableType; + + public static final String SERIALIZED_NAME_FIELDABLE_ID = "fieldable_id"; + @SerializedName(SERIALIZED_NAME_FIELDABLE_ID) + @javax.annotation.Nonnull + private String fieldableId; + + /** + * How the alert field value should be matched + */ + @JsonAdapter(OperatorEnum.Adapter.class) + public enum OperatorEnum { + IS("is"), + + IS_NOT("is_not"), + + IS_ONE_OF("is_one_of"), + + IS_NOT_ONE_OF("is_not_one_of"), + + CONTAINS("contains"), + + DOES_NOT_CONTAIN("does_not_contain"), + + IS_EMPTY("is_empty"), + + IS_NOT_EMPTY("is_not_empty"), + + CONTAINS_KEY("contains_key"), + + DOES_NOT_CONTAIN_KEY("does_not_contain_key"), + + STARTS_WITH("starts_with"), + + DOES_NOT_START_WITH("does_not_start_with"), + + MATCHES("matches"), + + DOES_NOT_MATCH("does_not_match"); + + private String value; + + OperatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OperatorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperatorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperatorEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OperatorEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nonnull + private OperatorEnum operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + @SerializedName(SERIALIZED_NAME_VALUES) + @javax.annotation.Nullable + private List values = new ArrayList<>(); + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 ruleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * The type of the escalation path rule + * @return ruleType + */ + @javax.annotation.Nonnull + public RuleTypeEnum getRuleType() { + return ruleType; + } + + public void setRuleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 fieldableType(@javax.annotation.Nonnull String fieldableType) { + this.fieldableType = fieldableType; + return this; + } + + /** + * The type of the fieldable (e.g., AlertField) + * @return fieldableType + */ + @javax.annotation.Nonnull + public String getFieldableType() { + return fieldableType; + } + + public void setFieldableType(@javax.annotation.Nonnull String fieldableType) { + this.fieldableType = fieldableType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 fieldableId(@javax.annotation.Nonnull String fieldableId) { + this.fieldableId = fieldableId; + return this; + } + + /** + * The ID of the alert field + * @return fieldableId + */ + @javax.annotation.Nonnull + public String getFieldableId() { + return fieldableId; + } + + public void setFieldableId(@javax.annotation.Nonnull String fieldableId) { + this.fieldableId = fieldableId; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 operator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + return this; + } + + /** + * How the alert field value should be matched + * @return operator + */ + @javax.annotation.Nonnull + public OperatorEnum getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 values(@javax.annotation.Nullable List values) { + this.values = values; + return this; + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * Values to match against + * @return values + */ + @javax.annotation.Nullable + public List getValues() { + return values; + } + + public void setValues(@javax.annotation.Nullable List values) { + this.values = values; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 newEscalationPolicyPathDataAttributesRulesInnerOneOf3 = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf3) o; + return Objects.equals(this.ruleType, newEscalationPolicyPathDataAttributesRulesInnerOneOf3.ruleType) && + Objects.equals(this.fieldableType, newEscalationPolicyPathDataAttributesRulesInnerOneOf3.fieldableType) && + Objects.equals(this.fieldableId, newEscalationPolicyPathDataAttributesRulesInnerOneOf3.fieldableId) && + Objects.equals(this.operator, newEscalationPolicyPathDataAttributesRulesInnerOneOf3.operator) && + Objects.equals(this.values, newEscalationPolicyPathDataAttributesRulesInnerOneOf3.values); + } + + @Override + public int hashCode() { + return Objects.hash(ruleType, fieldableType, fieldableId, operator, values); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 {\n"); + sb.append(" ruleType: ").append(toIndentedString(ruleType)).append("\n"); + sb.append(" fieldableType: ").append(toIndentedString(fieldableType)).append("\n"); + sb.append(" fieldableId: ").append(toIndentedString(fieldableId)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rule_type"); + openapiFields.add("fieldable_type"); + openapiFields.add("fieldable_id"); + openapiFields.add("operator"); + openapiFields.add("values"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rule_type"); + openapiRequiredFields.add("fieldable_type"); + openapiRequiredFields.add("fieldable_id"); + openapiRequiredFields.add("operator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf3` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("rule_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rule_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_type").toString())); + } + // validate the required field `rule_type` + RuleTypeEnum.validateJsonElement(jsonObj.get("rule_type")); + if (!jsonObj.get("fieldable_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fieldable_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldable_type").toString())); + } + if (!jsonObj.get("fieldable_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fieldable_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fieldable_id").toString())); + } + if (!jsonObj.get("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + // validate the required field `operator` + OperatorEnum.validateJsonElement(jsonObj.get("operator")); + // ensure the optional json data is an array if present + if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonNull() && !jsonObj.get("values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf3.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.java new file mode 100644 index 00000000..6fb4a06c --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.java @@ -0,0 +1,310 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 { + /** + * The type of the escalation path rule + */ + @JsonAdapter(RuleTypeEnum.Adapter.class) + public enum RuleTypeEnum { + SERVICE("service"); + + private String value; + + RuleTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RuleTypeEnum fromValue(String value) { + for (RuleTypeEnum b : RuleTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RuleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RuleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RuleTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RuleTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RULE_TYPE = "rule_type"; + @SerializedName(SERIALIZED_NAME_RULE_TYPE) + @javax.annotation.Nonnull + private RuleTypeEnum ruleType; + + public static final String SERIALIZED_NAME_SERVICE_IDS = "service_ids"; + @SerializedName(SERIALIZED_NAME_SERVICE_IDS) + @javax.annotation.Nonnull + private List serviceIds = new ArrayList<>(); + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf4() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 ruleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * The type of the escalation path rule + * @return ruleType + */ + @javax.annotation.Nonnull + public RuleTypeEnum getRuleType() { + return ruleType; + } + + public void setRuleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 serviceIds(@javax.annotation.Nonnull List serviceIds) { + this.serviceIds = serviceIds; + return this; + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 addServiceIdsItem(String serviceIdsItem) { + if (this.serviceIds == null) { + this.serviceIds = new ArrayList<>(); + } + this.serviceIds.add(serviceIdsItem); + return this; + } + + /** + * Service ids for which this escalation path should be used + * @return serviceIds + */ + @javax.annotation.Nonnull + public List getServiceIds() { + return serviceIds; + } + + public void setServiceIds(@javax.annotation.Nonnull List serviceIds) { + this.serviceIds = serviceIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 newEscalationPolicyPathDataAttributesRulesInnerOneOf4 = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf4) o; + return Objects.equals(this.ruleType, newEscalationPolicyPathDataAttributesRulesInnerOneOf4.ruleType) && + Objects.equals(this.serviceIds, newEscalationPolicyPathDataAttributesRulesInnerOneOf4.serviceIds); + } + + @Override + public int hashCode() { + return Objects.hash(ruleType, serviceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 {\n"); + sb.append(" ruleType: ").append(toIndentedString(ruleType)).append("\n"); + sb.append(" serviceIds: ").append(toIndentedString(serviceIds)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rule_type"); + openapiFields.add("service_ids"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rule_type"); + openapiRequiredFields.add("service_ids"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf4` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("rule_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rule_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_type").toString())); + } + // validate the required field `rule_type` + RuleTypeEnum.validateJsonElement(jsonObj.get("rule_type")); + // ensure the required json array is present + if (jsonObj.get("service_ids") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("service_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `service_ids` to be an array in the JSON string but got `%s`", jsonObj.get("service_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf4' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf4.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.java new file mode 100644 index 00000000..985d734b --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.java @@ -0,0 +1,1004 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 { + /** + * The type of the escalation path rule + */ + @JsonAdapter(RuleTypeEnum.Adapter.class) + public enum RuleTypeEnum { + DEFERRAL_WINDOW("deferral_window"); + + private String value; + + RuleTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RuleTypeEnum fromValue(String value) { + for (RuleTypeEnum b : RuleTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RuleTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RuleTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RuleTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RuleTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RULE_TYPE = "rule_type"; + @SerializedName(SERIALIZED_NAME_RULE_TYPE) + @javax.annotation.Nonnull + private RuleTypeEnum ruleType; + + /** + * Time zone for the deferral window + */ + @JsonAdapter(TimeZoneEnum.Adapter.class) + public enum TimeZoneEnum { + INTERNATIONAL_DATE_LINE_WEST("International Date Line West"), + + ETC_GMT_12("Etc/GMT+12"), + + AMERICAN_SAMOA("American Samoa"), + + PACIFIC_PAGO_PAGO("Pacific/Pago_Pago"), + + MIDWAY_ISLAND("Midway Island"), + + PACIFIC_MIDWAY("Pacific/Midway"), + + HAWAII("Hawaii"), + + PACIFIC_HONOLULU("Pacific/Honolulu"), + + ALASKA("Alaska"), + + AMERICA_JUNEAU("America/Juneau"), + + PACIFIC_TIME_US_CANADA_("Pacific Time (US & Canada)"), + + AMERICA_LOS_ANGELES("America/Los_Angeles"), + + TIJUANA("Tijuana"), + + AMERICA_TIJUANA("America/Tijuana"), + + ARIZONA("Arizona"), + + AMERICA_PHOENIX("America/Phoenix"), + + MAZATLAN("Mazatlan"), + + AMERICA_MAZATLAN("America/Mazatlan"), + + MOUNTAIN_TIME_US_CANADA_("Mountain Time (US & Canada)"), + + AMERICA_DENVER("America/Denver"), + + CENTRAL_AMERICA("Central America"), + + AMERICA_GUATEMALA("America/Guatemala"), + + CENTRAL_TIME_US_CANADA_("Central Time (US & Canada)"), + + AMERICA_CHICAGO("America/Chicago"), + + CHIHUAHUA("Chihuahua"), + + AMERICA_CHIHUAHUA("America/Chihuahua"), + + GUADALAJARA("Guadalajara"), + + AMERICA_MEXICO_CITY("America/Mexico_City"), + + MEXICO_CITY("Mexico City"), + + AMERICA_MEXICO_CITY2("America/Mexico_City"), + + MONTERREY("Monterrey"), + + AMERICA_MONTERREY("America/Monterrey"), + + SASKATCHEWAN("Saskatchewan"), + + AMERICA_REGINA("America/Regina"), + + BOGOTA("Bogota"), + + AMERICA_BOGOTA("America/Bogota"), + + EASTERN_TIME_US_CANADA_("Eastern Time (US & Canada)"), + + AMERICA_NEW_YORK("America/New_York"), + + INDIANA_EAST_("Indiana (East)"), + + AMERICA_INDIANA_INDIANAPOLIS("America/Indiana/Indianapolis"), + + LIMA("Lima"), + + AMERICA_LIMA("America/Lima"), + + QUITO("Quito"), + + AMERICA_LIMA2("America/Lima"), + + ATLANTIC_TIME_CANADA_("Atlantic Time (Canada)"), + + AMERICA_HALIFAX("America/Halifax"), + + CARACAS("Caracas"), + + AMERICA_CARACAS("America/Caracas"), + + GEORGETOWN("Georgetown"), + + AMERICA_GUYANA("America/Guyana"), + + LA_PAZ("La Paz"), + + AMERICA_LA_PAZ("America/La_Paz"), + + PUERTO_RICO("Puerto Rico"), + + AMERICA_PUERTO_RICO("America/Puerto_Rico"), + + SANTIAGO("Santiago"), + + AMERICA_SANTIAGO("America/Santiago"), + + NEWFOUNDLAND("Newfoundland"), + + AMERICA_ST_JOHNS("America/St_Johns"), + + ASUNCION("Asuncion"), + + AMERICA_ASUNCION("America/Asuncion"), + + BRASILIA("Brasilia"), + + AMERICA_SAO_PAULO("America/Sao_Paulo"), + + BUENOS_AIRES("Buenos Aires"), + + AMERICA_ARGENTINA_BUENOS_AIRES("America/Argentina/Buenos_Aires"), + + MONTEVIDEO("Montevideo"), + + AMERICA_MONTEVIDEO("America/Montevideo"), + + GREENLAND("Greenland"), + + AMERICA_NUUK("America/Nuuk"), + + MID_ATLANTIC("Mid-Atlantic"), + + ATLANTIC_SOUTH_GEORGIA("Atlantic/South_Georgia"), + + AZORES("Azores"), + + ATLANTIC_AZORES("Atlantic/Azores"), + + CAPE_VERDE_IS_("Cape Verde Is."), + + ATLANTIC_CAPE_VERDE("Atlantic/Cape_Verde"), + + EDINBURGH("Edinburgh"), + + EUROPE_LONDON("Europe/London"), + + LISBON("Lisbon"), + + EUROPE_LISBON("Europe/Lisbon"), + + LONDON("London"), + + EUROPE_LONDON2("Europe/London"), + + MONROVIA("Monrovia"), + + AFRICA_MONROVIA("Africa/Monrovia"), + + UTC("UTC"), + + ETC_UTC("Etc/UTC"), + + AMSTERDAM("Amsterdam"), + + EUROPE_AMSTERDAM("Europe/Amsterdam"), + + BELGRADE("Belgrade"), + + EUROPE_BELGRADE("Europe/Belgrade"), + + BERLIN("Berlin"), + + EUROPE_BERLIN("Europe/Berlin"), + + BERN("Bern"), + + EUROPE_ZURICH("Europe/Zurich"), + + BRATISLAVA("Bratislava"), + + EUROPE_BRATISLAVA("Europe/Bratislava"), + + BRUSSELS("Brussels"), + + EUROPE_BRUSSELS("Europe/Brussels"), + + BUDAPEST("Budapest"), + + EUROPE_BUDAPEST("Europe/Budapest"), + + CASABLANCA("Casablanca"), + + AFRICA_CASABLANCA("Africa/Casablanca"), + + COPENHAGEN("Copenhagen"), + + EUROPE_COPENHAGEN("Europe/Copenhagen"), + + DUBLIN("Dublin"), + + EUROPE_DUBLIN("Europe/Dublin"), + + LJUBLJANA("Ljubljana"), + + EUROPE_LJUBLJANA("Europe/Ljubljana"), + + MADRID("Madrid"), + + EUROPE_MADRID("Europe/Madrid"), + + PARIS("Paris"), + + EUROPE_PARIS("Europe/Paris"), + + PRAGUE("Prague"), + + EUROPE_PRAGUE("Europe/Prague"), + + ROME("Rome"), + + EUROPE_ROME("Europe/Rome"), + + SARAJEVO("Sarajevo"), + + EUROPE_SARAJEVO("Europe/Sarajevo"), + + SKOPJE("Skopje"), + + EUROPE_SKOPJE("Europe/Skopje"), + + STOCKHOLM("Stockholm"), + + EUROPE_STOCKHOLM("Europe/Stockholm"), + + VIENNA("Vienna"), + + EUROPE_VIENNA("Europe/Vienna"), + + WARSAW("Warsaw"), + + EUROPE_WARSAW("Europe/Warsaw"), + + WEST_CENTRAL_AFRICA("West Central Africa"), + + AFRICA_ALGIERS("Africa/Algiers"), + + ZAGREB("Zagreb"), + + EUROPE_ZAGREB("Europe/Zagreb"), + + ZURICH("Zurich"), + + EUROPE_ZURICH2("Europe/Zurich"), + + ATHENS("Athens"), + + EUROPE_ATHENS("Europe/Athens"), + + BUCHAREST("Bucharest"), + + EUROPE_BUCHAREST("Europe/Bucharest"), + + CAIRO("Cairo"), + + AFRICA_CAIRO("Africa/Cairo"), + + HARARE("Harare"), + + AFRICA_HARARE("Africa/Harare"), + + HELSINKI("Helsinki"), + + EUROPE_HELSINKI("Europe/Helsinki"), + + JERUSALEM("Jerusalem"), + + ASIA_JERUSALEM("Asia/Jerusalem"), + + KALININGRAD("Kaliningrad"), + + EUROPE_KALININGRAD("Europe/Kaliningrad"), + + KYIV("Kyiv"), + + EUROPE_KIEV("Europe/Kiev"), + + PRETORIA("Pretoria"), + + AFRICA_JOHANNESBURG("Africa/Johannesburg"), + + RIGA("Riga"), + + EUROPE_RIGA("Europe/Riga"), + + SOFIA("Sofia"), + + EUROPE_SOFIA("Europe/Sofia"), + + TALLINN("Tallinn"), + + EUROPE_TALLINN("Europe/Tallinn"), + + VILNIUS("Vilnius"), + + EUROPE_VILNIUS("Europe/Vilnius"), + + BAGHDAD("Baghdad"), + + ASIA_BAGHDAD("Asia/Baghdad"), + + ISTANBUL("Istanbul"), + + EUROPE_ISTANBUL("Europe/Istanbul"), + + KUWAIT("Kuwait"), + + ASIA_KUWAIT("Asia/Kuwait"), + + MINSK("Minsk"), + + EUROPE_MINSK("Europe/Minsk"), + + MOSCOW("Moscow"), + + EUROPE_MOSCOW("Europe/Moscow"), + + NAIROBI("Nairobi"), + + AFRICA_NAIROBI("Africa/Nairobi"), + + RIYADH("Riyadh"), + + ASIA_RIYADH("Asia/Riyadh"), + + ST_PETERSBURG("St. Petersburg"), + + EUROPE_MOSCOW2("Europe/Moscow"), + + VOLGOGRAD("Volgograd"), + + EUROPE_VOLGOGRAD("Europe/Volgograd"), + + TEHRAN("Tehran"), + + ASIA_TEHRAN("Asia/Tehran"), + + ABU_DHABI("Abu Dhabi"), + + ASIA_MUSCAT("Asia/Muscat"), + + BAKU("Baku"), + + ASIA_BAKU("Asia/Baku"), + + MUSCAT("Muscat"), + + ASIA_MUSCAT2("Asia/Muscat"), + + SAMARA("Samara"), + + EUROPE_SAMARA("Europe/Samara"), + + TBILISI("Tbilisi"), + + ASIA_TBILISI("Asia/Tbilisi"), + + YEREVAN("Yerevan"), + + ASIA_YEREVAN("Asia/Yerevan"), + + KABUL("Kabul"), + + ASIA_KABUL("Asia/Kabul"), + + ALMATY("Almaty"), + + ASIA_ALMATY("Asia/Almaty"), + + ASTANA("Astana"), + + ASIA_ALMATY2("Asia/Almaty"), + + EKATERINBURG("Ekaterinburg"), + + ASIA_YEKATERINBURG("Asia/Yekaterinburg"), + + ISLAMABAD("Islamabad"), + + ASIA_KARACHI("Asia/Karachi"), + + KARACHI("Karachi"), + + ASIA_KARACHI2("Asia/Karachi"), + + TASHKENT("Tashkent"), + + ASIA_TASHKENT("Asia/Tashkent"), + + CHENNAI("Chennai"), + + ASIA_KOLKATA("Asia/Kolkata"), + + KOLKATA("Kolkata"), + + ASIA_KOLKATA2("Asia/Kolkata"), + + MUMBAI("Mumbai"), + + ASIA_KOLKATA3("Asia/Kolkata"), + + NEW_DELHI("New Delhi"), + + ASIA_KOLKATA4("Asia/Kolkata"), + + SRI_JAYAWARDENEPURA("Sri Jayawardenepura"), + + ASIA_COLOMBO("Asia/Colombo"), + + KATHMANDU("Kathmandu"), + + ASIA_KATHMANDU("Asia/Kathmandu"), + + DHAKA("Dhaka"), + + ASIA_DHAKA("Asia/Dhaka"), + + URUMQI("Urumqi"), + + ASIA_URUMQI("Asia/Urumqi"), + + RANGOON("Rangoon"), + + ASIA_RANGOON("Asia/Rangoon"), + + BANGKOK("Bangkok"), + + ASIA_BANGKOK("Asia/Bangkok"), + + HANOI("Hanoi"), + + ASIA_BANGKOK2("Asia/Bangkok"), + + JAKARTA("Jakarta"), + + ASIA_JAKARTA("Asia/Jakarta"), + + KRASNOYARSK("Krasnoyarsk"), + + ASIA_KRASNOYARSK("Asia/Krasnoyarsk"), + + NOVOSIBIRSK("Novosibirsk"), + + ASIA_NOVOSIBIRSK("Asia/Novosibirsk"), + + BEIJING("Beijing"), + + ASIA_SHANGHAI("Asia/Shanghai"), + + CHONGQING("Chongqing"), + + ASIA_CHONGQING("Asia/Chongqing"), + + HONG_KONG("Hong Kong"), + + ASIA_HONG_KONG("Asia/Hong_Kong"), + + IRKUTSK("Irkutsk"), + + ASIA_IRKUTSK("Asia/Irkutsk"), + + KUALA_LUMPUR("Kuala Lumpur"), + + ASIA_KUALA_LUMPUR("Asia/Kuala_Lumpur"), + + PERTH("Perth"), + + AUSTRALIA_PERTH("Australia/Perth"), + + SINGAPORE("Singapore"), + + ASIA_SINGAPORE("Asia/Singapore"), + + TAIPEI("Taipei"), + + ASIA_TAIPEI("Asia/Taipei"), + + ULAANBAATAR("Ulaanbaatar"), + + ASIA_ULAANBAATAR("Asia/Ulaanbaatar"), + + OSAKA("Osaka"), + + ASIA_TOKYO("Asia/Tokyo"), + + SAPPORO("Sapporo"), + + ASIA_TOKYO2("Asia/Tokyo"), + + SEOUL("Seoul"), + + ASIA_SEOUL("Asia/Seoul"), + + TOKYO("Tokyo"), + + ASIA_TOKYO3("Asia/Tokyo"), + + YAKUTSK("Yakutsk"), + + ASIA_YAKUTSK("Asia/Yakutsk"), + + ADELAIDE("Adelaide"), + + AUSTRALIA_ADELAIDE("Australia/Adelaide"), + + DARWIN("Darwin"), + + AUSTRALIA_DARWIN("Australia/Darwin"), + + BRISBANE("Brisbane"), + + AUSTRALIA_BRISBANE("Australia/Brisbane"), + + CANBERRA("Canberra"), + + AUSTRALIA_CANBERRA("Australia/Canberra"), + + GUAM("Guam"), + + PACIFIC_GUAM("Pacific/Guam"), + + HOBART("Hobart"), + + AUSTRALIA_HOBART("Australia/Hobart"), + + MELBOURNE("Melbourne"), + + AUSTRALIA_MELBOURNE("Australia/Melbourne"), + + PORT_MORESBY("Port Moresby"), + + PACIFIC_PORT_MORESBY("Pacific/Port_Moresby"), + + SYDNEY("Sydney"), + + AUSTRALIA_SYDNEY("Australia/Sydney"), + + VLADIVOSTOK("Vladivostok"), + + ASIA_VLADIVOSTOK("Asia/Vladivostok"), + + MAGADAN("Magadan"), + + ASIA_MAGADAN("Asia/Magadan"), + + NEW_CALEDONIA("New Caledonia"), + + PACIFIC_NOUMEA("Pacific/Noumea"), + + SOLOMON_IS_("Solomon Is."), + + PACIFIC_GUADALCANAL("Pacific/Guadalcanal"), + + SREDNEKOLYMSK("Srednekolymsk"), + + ASIA_SREDNEKOLYMSK("Asia/Srednekolymsk"), + + AUCKLAND("Auckland"), + + PACIFIC_AUCKLAND("Pacific/Auckland"), + + FIJI("Fiji"), + + PACIFIC_FIJI("Pacific/Fiji"), + + KAMCHATKA("Kamchatka"), + + ASIA_KAMCHATKA("Asia/Kamchatka"), + + MARSHALL_IS_("Marshall Is."), + + PACIFIC_MAJURO("Pacific/Majuro"), + + WELLINGTON("Wellington"), + + PACIFIC_AUCKLAND2("Pacific/Auckland"), + + CHATHAM_IS_("Chatham Is."), + + PACIFIC_CHATHAM("Pacific/Chatham"), + + NUKU_ALOFA("Nuku'alofa"), + + PACIFIC_TONGATAPU("Pacific/Tongatapu"), + + SAMOA("Samoa"), + + PACIFIC_APIA("Pacific/Apia"), + + TOKELAU_IS_("Tokelau Is."), + + PACIFIC_FAKAOFO("Pacific/Fakaofo"); + + private String value; + + TimeZoneEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeZoneEnum fromValue(String value) { + for (TimeZoneEnum b : TimeZoneEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TimeZoneEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeZoneEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeZoneEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TimeZoneEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nonnull + private TimeZoneEnum timeZone; + + public static final String SERIALIZED_NAME_TIME_BLOCKS = "time_blocks"; + @SerializedName(SERIALIZED_NAME_TIME_BLOCKS) + @javax.annotation.Nonnull + private List timeBlocks = new ArrayList<>(); + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 ruleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * The type of the escalation path rule + * @return ruleType + */ + @javax.annotation.Nonnull + public RuleTypeEnum getRuleType() { + return ruleType; + } + + public void setRuleType(@javax.annotation.Nonnull RuleTypeEnum ruleType) { + this.ruleType = ruleType; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 timeZone(@javax.annotation.Nonnull TimeZoneEnum timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Time zone for the deferral window + * @return timeZone + */ + @javax.annotation.Nonnull + public TimeZoneEnum getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nonnull TimeZoneEnum timeZone) { + this.timeZone = timeZone; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 timeBlocks(@javax.annotation.Nonnull List timeBlocks) { + this.timeBlocks = timeBlocks; + return this; + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 addTimeBlocksItem(NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner timeBlocksItem) { + if (this.timeBlocks == null) { + this.timeBlocks = new ArrayList<>(); + } + this.timeBlocks.add(timeBlocksItem); + return this; + } + + /** + * Time windows during which alerts are deferred + * @return timeBlocks + */ + @javax.annotation.Nonnull + public List getTimeBlocks() { + return timeBlocks; + } + + public void setTimeBlocks(@javax.annotation.Nonnull List timeBlocks) { + this.timeBlocks = timeBlocks; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 newEscalationPolicyPathDataAttributesRulesInnerOneOf5 = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf5) o; + return Objects.equals(this.ruleType, newEscalationPolicyPathDataAttributesRulesInnerOneOf5.ruleType) && + Objects.equals(this.timeZone, newEscalationPolicyPathDataAttributesRulesInnerOneOf5.timeZone) && + Objects.equals(this.timeBlocks, newEscalationPolicyPathDataAttributesRulesInnerOneOf5.timeBlocks); + } + + @Override + public int hashCode() { + return Objects.hash(ruleType, timeZone, timeBlocks); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 {\n"); + sb.append(" ruleType: ").append(toIndentedString(ruleType)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" timeBlocks: ").append(toIndentedString(timeBlocks)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rule_type"); + openapiFields.add("time_zone"); + openapiFields.add("time_blocks"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("rule_type"); + openapiRequiredFields.add("time_zone"); + openapiRequiredFields.add("time_blocks"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf5` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("rule_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rule_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rule_type").toString())); + } + // validate the required field `rule_type` + RuleTypeEnum.validateJsonElement(jsonObj.get("rule_type")); + if (!jsonObj.get("time_zone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); + } + // validate the required field `time_zone` + TimeZoneEnum.validateJsonElement(jsonObj.get("time_zone")); + // ensure the json data is an array + if (!jsonObj.get("time_blocks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `time_blocks` to be an array in the JSON string but got `%s`", jsonObj.get("time_blocks").toString())); + } + + JsonArray jsonArraytimeBlocks = jsonObj.getAsJsonArray("time_blocks"); + // validate the required field `time_blocks` (array) + for (int i = 0; i < jsonArraytimeBlocks.size(); i++) { + NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.validateJsonElement(jsonArraytimeBlocks.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf5' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf5.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.java b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.java new file mode 100644 index 00000000..3ab98c8a --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.java @@ -0,0 +1,491 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner { + public static final String SERIALIZED_NAME_MONDAY = "monday"; + @SerializedName(SERIALIZED_NAME_MONDAY) + @javax.annotation.Nullable + private Boolean monday = false; + + public static final String SERIALIZED_NAME_TUESDAY = "tuesday"; + @SerializedName(SERIALIZED_NAME_TUESDAY) + @javax.annotation.Nullable + private Boolean tuesday = false; + + public static final String SERIALIZED_NAME_WEDNESDAY = "wednesday"; + @SerializedName(SERIALIZED_NAME_WEDNESDAY) + @javax.annotation.Nullable + private Boolean wednesday = false; + + public static final String SERIALIZED_NAME_THURSDAY = "thursday"; + @SerializedName(SERIALIZED_NAME_THURSDAY) + @javax.annotation.Nullable + private Boolean thursday = false; + + public static final String SERIALIZED_NAME_FRIDAY = "friday"; + @SerializedName(SERIALIZED_NAME_FRIDAY) + @javax.annotation.Nullable + private Boolean friday = false; + + public static final String SERIALIZED_NAME_SATURDAY = "saturday"; + @SerializedName(SERIALIZED_NAME_SATURDAY) + @javax.annotation.Nullable + private Boolean saturday = false; + + public static final String SERIALIZED_NAME_SUNDAY = "sunday"; + @SerializedName(SERIALIZED_NAME_SUNDAY) + @javax.annotation.Nullable + private Boolean sunday = false; + + public static final String SERIALIZED_NAME_START_TIME = "start_time"; + @SerializedName(SERIALIZED_NAME_START_TIME) + @javax.annotation.Nullable + private String startTime; + + public static final String SERIALIZED_NAME_END_TIME = "end_time"; + @SerializedName(SERIALIZED_NAME_END_TIME) + @javax.annotation.Nullable + private String endTime; + + public static final String SERIALIZED_NAME_ALL_DAY = "all_day"; + @SerializedName(SERIALIZED_NAME_ALL_DAY) + @javax.annotation.Nullable + private Boolean allDay = false; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner() { + } + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner monday(@javax.annotation.Nullable Boolean monday) { + this.monday = monday; + return this; + } + + /** + * Get monday + * @return monday + */ + @javax.annotation.Nullable + public Boolean getMonday() { + return monday; + } + + public void setMonday(@javax.annotation.Nullable Boolean monday) { + this.monday = monday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner tuesday(@javax.annotation.Nullable Boolean tuesday) { + this.tuesday = tuesday; + return this; + } + + /** + * Get tuesday + * @return tuesday + */ + @javax.annotation.Nullable + public Boolean getTuesday() { + return tuesday; + } + + public void setTuesday(@javax.annotation.Nullable Boolean tuesday) { + this.tuesday = tuesday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner wednesday(@javax.annotation.Nullable Boolean wednesday) { + this.wednesday = wednesday; + return this; + } + + /** + * Get wednesday + * @return wednesday + */ + @javax.annotation.Nullable + public Boolean getWednesday() { + return wednesday; + } + + public void setWednesday(@javax.annotation.Nullable Boolean wednesday) { + this.wednesday = wednesday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner thursday(@javax.annotation.Nullable Boolean thursday) { + this.thursday = thursday; + return this; + } + + /** + * Get thursday + * @return thursday + */ + @javax.annotation.Nullable + public Boolean getThursday() { + return thursday; + } + + public void setThursday(@javax.annotation.Nullable Boolean thursday) { + this.thursday = thursday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner friday(@javax.annotation.Nullable Boolean friday) { + this.friday = friday; + return this; + } + + /** + * Get friday + * @return friday + */ + @javax.annotation.Nullable + public Boolean getFriday() { + return friday; + } + + public void setFriday(@javax.annotation.Nullable Boolean friday) { + this.friday = friday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner saturday(@javax.annotation.Nullable Boolean saturday) { + this.saturday = saturday; + return this; + } + + /** + * Get saturday + * @return saturday + */ + @javax.annotation.Nullable + public Boolean getSaturday() { + return saturday; + } + + public void setSaturday(@javax.annotation.Nullable Boolean saturday) { + this.saturday = saturday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner sunday(@javax.annotation.Nullable Boolean sunday) { + this.sunday = sunday; + return this; + } + + /** + * Get sunday + * @return sunday + */ + @javax.annotation.Nullable + public Boolean getSunday() { + return sunday; + } + + public void setSunday(@javax.annotation.Nullable Boolean sunday) { + this.sunday = sunday; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner startTime(@javax.annotation.Nullable String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Formatted as HH:MM + * @return startTime + */ + @javax.annotation.Nullable + public String getStartTime() { + return startTime; + } + + public void setStartTime(@javax.annotation.Nullable String startTime) { + this.startTime = startTime; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner endTime(@javax.annotation.Nullable String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Formatted as HH:MM + * @return endTime + */ + @javax.annotation.Nullable + public String getEndTime() { + return endTime; + } + + public void setEndTime(@javax.annotation.Nullable String endTime) { + this.endTime = endTime; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner allDay(@javax.annotation.Nullable Boolean allDay) { + this.allDay = allDay; + return this; + } + + /** + * Get allDay + * @return allDay + */ + @javax.annotation.Nullable + public Boolean getAllDay() { + return allDay; + } + + public void setAllDay(@javax.annotation.Nullable Boolean allDay) { + this.allDay = allDay; + } + + + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner = (NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner) o; + return Objects.equals(this.monday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.monday) && + Objects.equals(this.tuesday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.tuesday) && + Objects.equals(this.wednesday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.wednesday) && + Objects.equals(this.thursday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.thursday) && + Objects.equals(this.friday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.friday) && + Objects.equals(this.saturday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.saturday) && + Objects.equals(this.sunday, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.sunday) && + Objects.equals(this.startTime, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.startTime) && + Objects.equals(this.endTime, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.endTime) && + Objects.equals(this.allDay, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.allDay) && + Objects.equals(this.position, newEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.position); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(monday, tuesday, wednesday, thursday, friday, saturday, sunday, startTime, endTime, allDay, position); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner {\n"); + sb.append(" monday: ").append(toIndentedString(monday)).append("\n"); + sb.append(" tuesday: ").append(toIndentedString(tuesday)).append("\n"); + sb.append(" wednesday: ").append(toIndentedString(wednesday)).append("\n"); + sb.append(" thursday: ").append(toIndentedString(thursday)).append("\n"); + sb.append(" friday: ").append(toIndentedString(friday)).append("\n"); + sb.append(" saturday: ").append(toIndentedString(saturday)).append("\n"); + sb.append(" sunday: ").append(toIndentedString(sunday)).append("\n"); + sb.append(" startTime: ").append(toIndentedString(startTime)).append("\n"); + sb.append(" endTime: ").append(toIndentedString(endTime)).append("\n"); + sb.append(" allDay: ").append(toIndentedString(allDay)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("monday"); + openapiFields.add("tuesday"); + openapiFields.add("wednesday"); + openapiFields.add("thursday"); + openapiFields.add("friday"); + openapiFields.add("saturday"); + openapiFields.add("sunday"); + openapiFields.add("start_time"); + openapiFields.add("end_time"); + openapiFields.add("all_day"); + openapiFields.add("position"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner is not found in the empty JSON string", NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("start_time") != null && !jsonObj.get("start_time").isJsonNull()) && !jsonObj.get("start_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `start_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("start_time").toString())); + } + if ((jsonObj.get("end_time") != null && !jsonObj.get("end_time").isJsonNull()) && !jsonObj.get("end_time").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `end_time` to be a primitive type in the JSON string but got `%s`", jsonObj.get("end_time").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + * @throws IOException if the JSON string is invalid with respect to NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + */ + public static NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner.class); + } + + /** + * Convert an instance of NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewOnCallPayReport.java b/src/main/java/com/rootly/client/model/NewOnCallPayReport.java new file mode 100644 index 00000000..8fb4dd0a --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewOnCallPayReport.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewOnCallPayReportData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewOnCallPayReport + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewOnCallPayReport { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private NewOnCallPayReportData data; + + public NewOnCallPayReport() { + } + + public NewOnCallPayReport data(@javax.annotation.Nonnull NewOnCallPayReportData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public NewOnCallPayReportData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull NewOnCallPayReportData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewOnCallPayReport newOnCallPayReport = (NewOnCallPayReport) o; + return Objects.equals(this.data, newOnCallPayReport.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewOnCallPayReport {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewOnCallPayReport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewOnCallPayReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewOnCallPayReport is not found in the empty JSON string", NewOnCallPayReport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewOnCallPayReport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewOnCallPayReport` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewOnCallPayReport.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + NewOnCallPayReportData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewOnCallPayReport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewOnCallPayReport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewOnCallPayReport.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewOnCallPayReport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewOnCallPayReport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewOnCallPayReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewOnCallPayReport + * @throws IOException if the JSON string is invalid with respect to NewOnCallPayReport + */ + public static NewOnCallPayReport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewOnCallPayReport.class); + } + + /** + * Convert an instance of NewOnCallPayReport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewOnCallPayReportData.java b/src/main/java/com/rootly/client/model/NewOnCallPayReportData.java new file mode 100644 index 00000000..58bd8164 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewOnCallPayReportData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewOnCallPayReportDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewOnCallPayReportData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewOnCallPayReportData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ON_CALL_PAY_REPORTS("on_call_pay_reports"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private NewOnCallPayReportDataAttributes attributes; + + public NewOnCallPayReportData() { + } + + public NewOnCallPayReportData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public NewOnCallPayReportData attributes(@javax.annotation.Nonnull NewOnCallPayReportDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public NewOnCallPayReportDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull NewOnCallPayReportDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewOnCallPayReportData newOnCallPayReportData = (NewOnCallPayReportData) o; + return Objects.equals(this.type, newOnCallPayReportData.type) && + Objects.equals(this.attributes, newOnCallPayReportData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewOnCallPayReportData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewOnCallPayReportData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewOnCallPayReportData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewOnCallPayReportData is not found in the empty JSON string", NewOnCallPayReportData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewOnCallPayReportData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewOnCallPayReportData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewOnCallPayReportData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + NewOnCallPayReportDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewOnCallPayReportData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewOnCallPayReportData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewOnCallPayReportData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewOnCallPayReportData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewOnCallPayReportData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewOnCallPayReportData given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewOnCallPayReportData + * @throws IOException if the JSON string is invalid with respect to NewOnCallPayReportData + */ + public static NewOnCallPayReportData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewOnCallPayReportData.class); + } + + /** + * Convert an instance of NewOnCallPayReportData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewOnCallPayReportDataAttributes.java b/src/main/java/com/rootly/client/model/NewOnCallPayReportDataAttributes.java new file mode 100644 index 00000000..4f617ad3 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewOnCallPayReportDataAttributes.java @@ -0,0 +1,281 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewOnCallPayReportDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewOnCallPayReportDataAttributes { + public static final String SERIALIZED_NAME_START_DATE = "start_date"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nonnull + private LocalDate startDate; + + public static final String SERIALIZED_NAME_END_DATE = "end_date"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nonnull + private LocalDate endDate; + + public static final String SERIALIZED_NAME_SCHEDULE_IDS = "schedule_ids"; + @SerializedName(SERIALIZED_NAME_SCHEDULE_IDS) + @javax.annotation.Nullable + private List scheduleIds = new ArrayList<>(); + + public NewOnCallPayReportDataAttributes() { + } + + public NewOnCallPayReportDataAttributes startDate(@javax.annotation.Nonnull LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date for the report period. + * @return startDate + */ + @javax.annotation.Nonnull + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nonnull LocalDate startDate) { + this.startDate = startDate; + } + + + public NewOnCallPayReportDataAttributes endDate(@javax.annotation.Nonnull LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date for the report period. + * @return endDate + */ + @javax.annotation.Nonnull + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nonnull LocalDate endDate) { + this.endDate = endDate; + } + + + public NewOnCallPayReportDataAttributes scheduleIds(@javax.annotation.Nullable List scheduleIds) { + this.scheduleIds = scheduleIds; + return this; + } + + public NewOnCallPayReportDataAttributes addScheduleIdsItem(String scheduleIdsItem) { + if (this.scheduleIds == null) { + this.scheduleIds = new ArrayList<>(); + } + this.scheduleIds.add(scheduleIdsItem); + return this; + } + + /** + * List of schedule UUIDs to scope the report. + * @return scheduleIds + */ + @javax.annotation.Nullable + public List getScheduleIds() { + return scheduleIds; + } + + public void setScheduleIds(@javax.annotation.Nullable List scheduleIds) { + this.scheduleIds = scheduleIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewOnCallPayReportDataAttributes newOnCallPayReportDataAttributes = (NewOnCallPayReportDataAttributes) o; + return Objects.equals(this.startDate, newOnCallPayReportDataAttributes.startDate) && + Objects.equals(this.endDate, newOnCallPayReportDataAttributes.endDate) && + Objects.equals(this.scheduleIds, newOnCallPayReportDataAttributes.scheduleIds); + } + + @Override + public int hashCode() { + return Objects.hash(startDate, endDate, scheduleIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewOnCallPayReportDataAttributes {\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" scheduleIds: ").append(toIndentedString(scheduleIds)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("start_date"); + openapiFields.add("end_date"); + openapiFields.add("schedule_ids"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("start_date"); + openapiRequiredFields.add("end_date"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewOnCallPayReportDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewOnCallPayReportDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewOnCallPayReportDataAttributes is not found in the empty JSON string", NewOnCallPayReportDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewOnCallPayReportDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewOnCallPayReportDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewOnCallPayReportDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("schedule_ids") != null && !jsonObj.get("schedule_ids").isJsonNull() && !jsonObj.get("schedule_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `schedule_ids` to be an array in the JSON string but got `%s`", jsonObj.get("schedule_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewOnCallPayReportDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewOnCallPayReportDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewOnCallPayReportDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewOnCallPayReportDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewOnCallPayReportDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewOnCallPayReportDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewOnCallPayReportDataAttributes + * @throws IOException if the JSON string is invalid with respect to NewOnCallPayReportDataAttributes + */ + public static NewOnCallPayReportDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewOnCallPayReportDataAttributes.class); + } + + /** + * Convert an instance of NewOnCallPayReportDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewSla.java b/src/main/java/com/rootly/client/model/NewSla.java new file mode 100644 index 00000000..5ff3839e --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewSla.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewSla + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewSla { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private NewSlaData data; + + public NewSla() { + } + + public NewSla data(@javax.annotation.Nonnull NewSlaData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public NewSlaData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull NewSlaData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSla newSla = (NewSla) o; + return Objects.equals(this.data, newSla.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSla {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewSla + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewSla.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewSla is not found in the empty JSON string", NewSla.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewSla.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewSla` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewSla.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + NewSlaData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewSla.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewSla' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewSla.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewSla value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewSla read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewSla given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewSla + * @throws IOException if the JSON string is invalid with respect to NewSla + */ + public static NewSla fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewSla.class); + } + + /** + * Convert an instance of NewSla to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewSlaData.java b/src/main/java/com/rootly/client/model/NewSlaData.java new file mode 100644 index 00000000..05e84d91 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewSlaData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewSlaData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewSlaData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SLAS("slas"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private NewSlaDataAttributes attributes; + + public NewSlaData() { + } + + public NewSlaData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public NewSlaData attributes(@javax.annotation.Nonnull NewSlaDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public NewSlaDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull NewSlaDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSlaData newSlaData = (NewSlaData) o; + return Objects.equals(this.type, newSlaData.type) && + Objects.equals(this.attributes, newSlaData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSlaData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewSlaData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewSlaData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewSlaData is not found in the empty JSON string", NewSlaData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewSlaData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewSlaData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewSlaData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + NewSlaDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewSlaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewSlaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewSlaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewSlaData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewSlaData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewSlaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewSlaData + * @throws IOException if the JSON string is invalid with respect to NewSlaData + */ + public static NewSlaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewSlaData.class); + } + + /** + * Convert an instance of NewSlaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewSlaDataAttributes.java b/src/main/java/com/rootly/client/model/NewSlaDataAttributes.java new file mode 100644 index 00000000..61636a6a --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewSlaDataAttributes.java @@ -0,0 +1,1025 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaDataAttributesConditionsInner; +import com.rootly.client.model.NewSlaDataAttributesNotificationConfigurationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewSlaDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewSlaDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + /** + * Whether all or any conditions must match + */ + @JsonAdapter(ConditionMatchTypeEnum.Adapter.class) + public enum ConditionMatchTypeEnum { + ALL("ALL"), + + ANY("ANY"); + + private String value; + + ConditionMatchTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConditionMatchTypeEnum fromValue(String value) { + for (ConditionMatchTypeEnum b : ConditionMatchTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConditionMatchTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConditionMatchTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConditionMatchTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConditionMatchTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONDITION_MATCH_TYPE = "condition_match_type"; + @SerializedName(SERIALIZED_NAME_CONDITION_MATCH_TYPE) + @javax.annotation.Nullable + private ConditionMatchTypeEnum conditionMatchType; + + public static final String SERIALIZED_NAME_MANAGER_ROLE_ID = "manager_role_id"; + @SerializedName(SERIALIZED_NAME_MANAGER_ROLE_ID) + @javax.annotation.Nullable + private UUID managerRoleId; + + public static final String SERIALIZED_NAME_MANAGER_USER_ID = "manager_user_id"; + @SerializedName(SERIALIZED_NAME_MANAGER_USER_ID) + @javax.annotation.Nullable + private Integer managerUserId; + + /** + * Number of days for the assignment deadline + */ + @JsonAdapter(AssignmentDeadlineDaysEnum.Adapter.class) + public enum AssignmentDeadlineDaysEnum { + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7), + + NUMBER_14(14), + + NUMBER_21(21), + + NUMBER_30(30); + + private Integer value; + + AssignmentDeadlineDaysEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssignmentDeadlineDaysEnum fromValue(Integer value) { + for (AssignmentDeadlineDaysEnum b : AssignmentDeadlineDaysEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AssignmentDeadlineDaysEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssignmentDeadlineDaysEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return AssignmentDeadlineDaysEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + Integer value = jsonElement.getAsInt(); + AssignmentDeadlineDaysEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_DAYS = "assignment_deadline_days"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_DAYS) + @javax.annotation.Nonnull + private AssignmentDeadlineDaysEnum assignmentDeadlineDays; + + /** + * The incident parent status that triggers the assignment deadline + */ + @JsonAdapter(AssignmentDeadlineParentStatusEnum.Adapter.class) + public enum AssignmentDeadlineParentStatusEnum { + IN_TRIAGE("in_triage"), + + STARTED("started"), + + MITIGATED("mitigated"), + + RESOLVED("resolved"), + + CLOSED("closed"), + + CANCELLED("cancelled"); + + private String value; + + AssignmentDeadlineParentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssignmentDeadlineParentStatusEnum fromValue(String value) { + for (AssignmentDeadlineParentStatusEnum b : AssignmentDeadlineParentStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AssignmentDeadlineParentStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssignmentDeadlineParentStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AssignmentDeadlineParentStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssignmentDeadlineParentStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_PARENT_STATUS = "assignment_deadline_parent_status"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_PARENT_STATUS) + @javax.annotation.Nonnull + private AssignmentDeadlineParentStatusEnum assignmentDeadlineParentStatus; + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_SUB_STATUS_ID = "assignment_deadline_sub_status_id"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_SUB_STATUS_ID) + @javax.annotation.Nullable + private UUID assignmentDeadlineSubStatusId; + + public static final String SERIALIZED_NAME_ASSIGNMENT_SKIP_WEEKENDS = "assignment_skip_weekends"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_SKIP_WEEKENDS) + @javax.annotation.Nullable + private Boolean assignmentSkipWeekends; + + /** + * Number of days for the completion deadline + */ + @JsonAdapter(CompletionDeadlineDaysEnum.Adapter.class) + public enum CompletionDeadlineDaysEnum { + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7), + + NUMBER_14(14), + + NUMBER_21(21), + + NUMBER_30(30); + + private Integer value; + + CompletionDeadlineDaysEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CompletionDeadlineDaysEnum fromValue(Integer value) { + for (CompletionDeadlineDaysEnum b : CompletionDeadlineDaysEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CompletionDeadlineDaysEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CompletionDeadlineDaysEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return CompletionDeadlineDaysEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + Integer value = jsonElement.getAsInt(); + CompletionDeadlineDaysEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_DAYS = "completion_deadline_days"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_DAYS) + @javax.annotation.Nonnull + private CompletionDeadlineDaysEnum completionDeadlineDays; + + /** + * The incident parent status that triggers the completion deadline + */ + @JsonAdapter(CompletionDeadlineParentStatusEnum.Adapter.class) + public enum CompletionDeadlineParentStatusEnum { + IN_TRIAGE("in_triage"), + + STARTED("started"), + + MITIGATED("mitigated"), + + RESOLVED("resolved"), + + CLOSED("closed"), + + CANCELLED("cancelled"); + + private String value; + + CompletionDeadlineParentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CompletionDeadlineParentStatusEnum fromValue(String value) { + for (CompletionDeadlineParentStatusEnum b : CompletionDeadlineParentStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CompletionDeadlineParentStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CompletionDeadlineParentStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CompletionDeadlineParentStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CompletionDeadlineParentStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_PARENT_STATUS = "completion_deadline_parent_status"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_PARENT_STATUS) + @javax.annotation.Nonnull + private CompletionDeadlineParentStatusEnum completionDeadlineParentStatus; + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_SUB_STATUS_ID = "completion_deadline_sub_status_id"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_SUB_STATUS_ID) + @javax.annotation.Nullable + private UUID completionDeadlineSubStatusId; + + public static final String SERIALIZED_NAME_COMPLETION_SKIP_WEEKENDS = "completion_skip_weekends"; + @SerializedName(SERIALIZED_NAME_COMPLETION_SKIP_WEEKENDS) + @javax.annotation.Nullable + private Boolean completionSkipWeekends; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + @javax.annotation.Nullable + private List conditions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOTIFICATION_CONFIGURATIONS = "notification_configurations"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_CONFIGURATIONS) + @javax.annotation.Nullable + private List notificationConfigurations = new ArrayList<>(); + + public NewSlaDataAttributes() { + } + + public NewSlaDataAttributes name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the SLA + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public NewSlaDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the SLA + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public NewSlaDataAttributes position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Position of the SLA for ordering + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public NewSlaDataAttributes conditionMatchType(@javax.annotation.Nullable ConditionMatchTypeEnum conditionMatchType) { + this.conditionMatchType = conditionMatchType; + return this; + } + + /** + * Whether all or any conditions must match + * @return conditionMatchType + */ + @javax.annotation.Nullable + public ConditionMatchTypeEnum getConditionMatchType() { + return conditionMatchType; + } + + public void setConditionMatchType(@javax.annotation.Nullable ConditionMatchTypeEnum conditionMatchType) { + this.conditionMatchType = conditionMatchType; + } + + + public NewSlaDataAttributes managerRoleId(@javax.annotation.Nullable UUID managerRoleId) { + this.managerRoleId = managerRoleId; + return this; + } + + /** + * The ID of the incident role responsible for this SLA. Must provide either manager_role_id or manager_user_id. + * @return managerRoleId + */ + @javax.annotation.Nullable + public UUID getManagerRoleId() { + return managerRoleId; + } + + public void setManagerRoleId(@javax.annotation.Nullable UUID managerRoleId) { + this.managerRoleId = managerRoleId; + } + + + public NewSlaDataAttributes managerUserId(@javax.annotation.Nullable Integer managerUserId) { + this.managerUserId = managerUserId; + return this; + } + + /** + * The ID of the user responsible for this SLA. Must provide either manager_role_id or manager_user_id. + * @return managerUserId + */ + @javax.annotation.Nullable + public Integer getManagerUserId() { + return managerUserId; + } + + public void setManagerUserId(@javax.annotation.Nullable Integer managerUserId) { + this.managerUserId = managerUserId; + } + + + public NewSlaDataAttributes assignmentDeadlineDays(@javax.annotation.Nonnull AssignmentDeadlineDaysEnum assignmentDeadlineDays) { + this.assignmentDeadlineDays = assignmentDeadlineDays; + return this; + } + + /** + * Number of days for the assignment deadline + * @return assignmentDeadlineDays + */ + @javax.annotation.Nonnull + public AssignmentDeadlineDaysEnum getAssignmentDeadlineDays() { + return assignmentDeadlineDays; + } + + public void setAssignmentDeadlineDays(@javax.annotation.Nonnull AssignmentDeadlineDaysEnum assignmentDeadlineDays) { + this.assignmentDeadlineDays = assignmentDeadlineDays; + } + + + public NewSlaDataAttributes assignmentDeadlineParentStatus(@javax.annotation.Nonnull AssignmentDeadlineParentStatusEnum assignmentDeadlineParentStatus) { + this.assignmentDeadlineParentStatus = assignmentDeadlineParentStatus; + return this; + } + + /** + * The incident parent status that triggers the assignment deadline + * @return assignmentDeadlineParentStatus + */ + @javax.annotation.Nonnull + public AssignmentDeadlineParentStatusEnum getAssignmentDeadlineParentStatus() { + return assignmentDeadlineParentStatus; + } + + public void setAssignmentDeadlineParentStatus(@javax.annotation.Nonnull AssignmentDeadlineParentStatusEnum assignmentDeadlineParentStatus) { + this.assignmentDeadlineParentStatus = assignmentDeadlineParentStatus; + } + + + public NewSlaDataAttributes assignmentDeadlineSubStatusId(@javax.annotation.Nullable UUID assignmentDeadlineSubStatusId) { + this.assignmentDeadlineSubStatusId = assignmentDeadlineSubStatusId; + return this; + } + + /** + * Sub-status for the assignment deadline. Required when custom lifecycle statuses are enabled on the team. + * @return assignmentDeadlineSubStatusId + */ + @javax.annotation.Nullable + public UUID getAssignmentDeadlineSubStatusId() { + return assignmentDeadlineSubStatusId; + } + + public void setAssignmentDeadlineSubStatusId(@javax.annotation.Nullable UUID assignmentDeadlineSubStatusId) { + this.assignmentDeadlineSubStatusId = assignmentDeadlineSubStatusId; + } + + + public NewSlaDataAttributes assignmentSkipWeekends(@javax.annotation.Nullable Boolean assignmentSkipWeekends) { + this.assignmentSkipWeekends = assignmentSkipWeekends; + return this; + } + + /** + * Whether to skip weekends when calculating the assignment deadline + * @return assignmentSkipWeekends + */ + @javax.annotation.Nullable + public Boolean getAssignmentSkipWeekends() { + return assignmentSkipWeekends; + } + + public void setAssignmentSkipWeekends(@javax.annotation.Nullable Boolean assignmentSkipWeekends) { + this.assignmentSkipWeekends = assignmentSkipWeekends; + } + + + public NewSlaDataAttributes completionDeadlineDays(@javax.annotation.Nonnull CompletionDeadlineDaysEnum completionDeadlineDays) { + this.completionDeadlineDays = completionDeadlineDays; + return this; + } + + /** + * Number of days for the completion deadline + * @return completionDeadlineDays + */ + @javax.annotation.Nonnull + public CompletionDeadlineDaysEnum getCompletionDeadlineDays() { + return completionDeadlineDays; + } + + public void setCompletionDeadlineDays(@javax.annotation.Nonnull CompletionDeadlineDaysEnum completionDeadlineDays) { + this.completionDeadlineDays = completionDeadlineDays; + } + + + public NewSlaDataAttributes completionDeadlineParentStatus(@javax.annotation.Nonnull CompletionDeadlineParentStatusEnum completionDeadlineParentStatus) { + this.completionDeadlineParentStatus = completionDeadlineParentStatus; + return this; + } + + /** + * The incident parent status that triggers the completion deadline + * @return completionDeadlineParentStatus + */ + @javax.annotation.Nonnull + public CompletionDeadlineParentStatusEnum getCompletionDeadlineParentStatus() { + return completionDeadlineParentStatus; + } + + public void setCompletionDeadlineParentStatus(@javax.annotation.Nonnull CompletionDeadlineParentStatusEnum completionDeadlineParentStatus) { + this.completionDeadlineParentStatus = completionDeadlineParentStatus; + } + + + public NewSlaDataAttributes completionDeadlineSubStatusId(@javax.annotation.Nullable UUID completionDeadlineSubStatusId) { + this.completionDeadlineSubStatusId = completionDeadlineSubStatusId; + return this; + } + + /** + * Sub-status for the completion deadline. Required when custom lifecycle statuses are enabled on the team. + * @return completionDeadlineSubStatusId + */ + @javax.annotation.Nullable + public UUID getCompletionDeadlineSubStatusId() { + return completionDeadlineSubStatusId; + } + + public void setCompletionDeadlineSubStatusId(@javax.annotation.Nullable UUID completionDeadlineSubStatusId) { + this.completionDeadlineSubStatusId = completionDeadlineSubStatusId; + } + + + public NewSlaDataAttributes completionSkipWeekends(@javax.annotation.Nullable Boolean completionSkipWeekends) { + this.completionSkipWeekends = completionSkipWeekends; + return this; + } + + /** + * Whether to skip weekends when calculating the completion deadline + * @return completionSkipWeekends + */ + @javax.annotation.Nullable + public Boolean getCompletionSkipWeekends() { + return completionSkipWeekends; + } + + public void setCompletionSkipWeekends(@javax.annotation.Nullable Boolean completionSkipWeekends) { + this.completionSkipWeekends = completionSkipWeekends; + } + + + public NewSlaDataAttributes conditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + return this; + } + + public NewSlaDataAttributes addConditionsItem(NewSlaDataAttributesConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Conditions that determine which incidents this SLA applies to. Maximum 20. + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + } + + + public NewSlaDataAttributes notificationConfigurations(@javax.annotation.Nullable List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + return this; + } + + public NewSlaDataAttributes addNotificationConfigurationsItem(NewSlaDataAttributesNotificationConfigurationsInner notificationConfigurationsItem) { + if (this.notificationConfigurations == null) { + this.notificationConfigurations = new ArrayList<>(); + } + this.notificationConfigurations.add(notificationConfigurationsItem); + return this; + } + + /** + * Notification timing configurations. Maximum 20. + * @return notificationConfigurations + */ + @javax.annotation.Nullable + public List getNotificationConfigurations() { + return notificationConfigurations; + } + + public void setNotificationConfigurations(@javax.annotation.Nullable List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSlaDataAttributes newSlaDataAttributes = (NewSlaDataAttributes) o; + return Objects.equals(this.name, newSlaDataAttributes.name) && + Objects.equals(this.description, newSlaDataAttributes.description) && + Objects.equals(this.position, newSlaDataAttributes.position) && + Objects.equals(this.conditionMatchType, newSlaDataAttributes.conditionMatchType) && + Objects.equals(this.managerRoleId, newSlaDataAttributes.managerRoleId) && + Objects.equals(this.managerUserId, newSlaDataAttributes.managerUserId) && + Objects.equals(this.assignmentDeadlineDays, newSlaDataAttributes.assignmentDeadlineDays) && + Objects.equals(this.assignmentDeadlineParentStatus, newSlaDataAttributes.assignmentDeadlineParentStatus) && + Objects.equals(this.assignmentDeadlineSubStatusId, newSlaDataAttributes.assignmentDeadlineSubStatusId) && + Objects.equals(this.assignmentSkipWeekends, newSlaDataAttributes.assignmentSkipWeekends) && + Objects.equals(this.completionDeadlineDays, newSlaDataAttributes.completionDeadlineDays) && + Objects.equals(this.completionDeadlineParentStatus, newSlaDataAttributes.completionDeadlineParentStatus) && + Objects.equals(this.completionDeadlineSubStatusId, newSlaDataAttributes.completionDeadlineSubStatusId) && + Objects.equals(this.completionSkipWeekends, newSlaDataAttributes.completionSkipWeekends) && + Objects.equals(this.conditions, newSlaDataAttributes.conditions) && + Objects.equals(this.notificationConfigurations, newSlaDataAttributes.notificationConfigurations); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, position, conditionMatchType, managerRoleId, managerUserId, assignmentDeadlineDays, assignmentDeadlineParentStatus, assignmentDeadlineSubStatusId, assignmentSkipWeekends, completionDeadlineDays, completionDeadlineParentStatus, completionDeadlineSubStatusId, completionSkipWeekends, conditions, notificationConfigurations); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSlaDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" conditionMatchType: ").append(toIndentedString(conditionMatchType)).append("\n"); + sb.append(" managerRoleId: ").append(toIndentedString(managerRoleId)).append("\n"); + sb.append(" managerUserId: ").append(toIndentedString(managerUserId)).append("\n"); + sb.append(" assignmentDeadlineDays: ").append(toIndentedString(assignmentDeadlineDays)).append("\n"); + sb.append(" assignmentDeadlineParentStatus: ").append(toIndentedString(assignmentDeadlineParentStatus)).append("\n"); + sb.append(" assignmentDeadlineSubStatusId: ").append(toIndentedString(assignmentDeadlineSubStatusId)).append("\n"); + sb.append(" assignmentSkipWeekends: ").append(toIndentedString(assignmentSkipWeekends)).append("\n"); + sb.append(" completionDeadlineDays: ").append(toIndentedString(completionDeadlineDays)).append("\n"); + sb.append(" completionDeadlineParentStatus: ").append(toIndentedString(completionDeadlineParentStatus)).append("\n"); + sb.append(" completionDeadlineSubStatusId: ").append(toIndentedString(completionDeadlineSubStatusId)).append("\n"); + sb.append(" completionSkipWeekends: ").append(toIndentedString(completionSkipWeekends)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" notificationConfigurations: ").append(toIndentedString(notificationConfigurations)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("position"); + openapiFields.add("condition_match_type"); + openapiFields.add("manager_role_id"); + openapiFields.add("manager_user_id"); + openapiFields.add("assignment_deadline_days"); + openapiFields.add("assignment_deadline_parent_status"); + openapiFields.add("assignment_deadline_sub_status_id"); + openapiFields.add("assignment_skip_weekends"); + openapiFields.add("completion_deadline_days"); + openapiFields.add("completion_deadline_parent_status"); + openapiFields.add("completion_deadline_sub_status_id"); + openapiFields.add("completion_skip_weekends"); + openapiFields.add("conditions"); + openapiFields.add("notification_configurations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("assignment_deadline_days"); + openapiRequiredFields.add("assignment_deadline_parent_status"); + openapiRequiredFields.add("completion_deadline_days"); + openapiRequiredFields.add("completion_deadline_parent_status"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewSlaDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewSlaDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewSlaDataAttributes is not found in the empty JSON string", NewSlaDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewSlaDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewSlaDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewSlaDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("condition_match_type") != null && !jsonObj.get("condition_match_type").isJsonNull()) && !jsonObj.get("condition_match_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `condition_match_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("condition_match_type").toString())); + } + // validate the optional field `condition_match_type` + if (jsonObj.get("condition_match_type") != null && !jsonObj.get("condition_match_type").isJsonNull()) { + ConditionMatchTypeEnum.validateJsonElement(jsonObj.get("condition_match_type")); + } + if ((jsonObj.get("manager_role_id") != null && !jsonObj.get("manager_role_id").isJsonNull()) && !jsonObj.get("manager_role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `manager_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manager_role_id").toString())); + } + // validate the required field `assignment_deadline_days` + AssignmentDeadlineDaysEnum.validateJsonElement(jsonObj.get("assignment_deadline_days")); + if (!jsonObj.get("assignment_deadline_parent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assignment_deadline_parent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assignment_deadline_parent_status").toString())); + } + // validate the required field `assignment_deadline_parent_status` + AssignmentDeadlineParentStatusEnum.validateJsonElement(jsonObj.get("assignment_deadline_parent_status")); + if ((jsonObj.get("assignment_deadline_sub_status_id") != null && !jsonObj.get("assignment_deadline_sub_status_id").isJsonNull()) && !jsonObj.get("assignment_deadline_sub_status_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assignment_deadline_sub_status_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assignment_deadline_sub_status_id").toString())); + } + // validate the required field `completion_deadline_days` + CompletionDeadlineDaysEnum.validateJsonElement(jsonObj.get("completion_deadline_days")); + if (!jsonObj.get("completion_deadline_parent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completion_deadline_parent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completion_deadline_parent_status").toString())); + } + // validate the required field `completion_deadline_parent_status` + CompletionDeadlineParentStatusEnum.validateJsonElement(jsonObj.get("completion_deadline_parent_status")); + if ((jsonObj.get("completion_deadline_sub_status_id") != null && !jsonObj.get("completion_deadline_sub_status_id").isJsonNull()) && !jsonObj.get("completion_deadline_sub_status_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completion_deadline_sub_status_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completion_deadline_sub_status_id").toString())); + } + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + NewSlaDataAttributesConditionsInner.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + if (jsonObj.get("notification_configurations") != null && !jsonObj.get("notification_configurations").isJsonNull()) { + JsonArray jsonArraynotificationConfigurations = jsonObj.getAsJsonArray("notification_configurations"); + if (jsonArraynotificationConfigurations != null) { + // ensure the json data is an array + if (!jsonObj.get("notification_configurations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_configurations` to be an array in the JSON string but got `%s`", jsonObj.get("notification_configurations").toString())); + } + + // validate the optional field `notification_configurations` (array) + for (int i = 0; i < jsonArraynotificationConfigurations.size(); i++) { + NewSlaDataAttributesNotificationConfigurationsInner.validateJsonElement(jsonArraynotificationConfigurations.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewSlaDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewSlaDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewSlaDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewSlaDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewSlaDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewSlaDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewSlaDataAttributes + * @throws IOException if the JSON string is invalid with respect to NewSlaDataAttributes + */ + public static NewSlaDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewSlaDataAttributes.class); + } + + /** + * Convert an instance of NewSlaDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewSlaDataAttributesConditionsInner.java b/src/main/java/com/rootly/client/model/NewSlaDataAttributesConditionsInner.java new file mode 100644 index 00000000..bcec1e03 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewSlaDataAttributesConditionsInner.java @@ -0,0 +1,528 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewSlaDataAttributesConditionsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewSlaDataAttributesConditionsInner { + /** + * The type of condition + */ + @JsonAdapter(ConditionableTypeEnum.Adapter.class) + public enum ConditionableTypeEnum { + SLAS_BUILT_IN_FIELD_CONDITION("SLAs::BuiltInFieldCondition"), + + SLAS_CUSTOM_FIELD_CONDITION("SLAs::CustomFieldCondition"); + + private String value; + + ConditionableTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConditionableTypeEnum fromValue(String value) { + for (ConditionableTypeEnum b : ConditionableTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConditionableTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConditionableTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConditionableTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConditionableTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONDITIONABLE_TYPE = "conditionable_type"; + @SerializedName(SERIALIZED_NAME_CONDITIONABLE_TYPE) + @javax.annotation.Nonnull + private ConditionableTypeEnum conditionableType; + + /** + * The property to evaluate (for built-in field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. + */ + @JsonAdapter(PropertyEnum.Adapter.class) + public enum PropertyEnum { + SEVERITY("severity"), + + ENVIRONMENT("environment"), + + SERVICE("service"), + + FUNCTIONALITY("functionality"), + + INCIDENT_TYPE("incident_type"), + + GROUP("group"), + + CAUSE("cause"), + + SUB_STATUS("sub_status"), + + INCIDENT_ROLE("incident_role"), + + STATUS("status"), + + KIND("kind"), + + VISIBILITY("visibility"), + + SUMMARY("summary"), + + STARTED_AT("started_at"), + + DETECTED_AT("detected_at"), + + ACKNOWLEDGED_AT("acknowledged_at"), + + MITIGATED_AT("mitigated_at"), + + RESOLVED_AT("resolved_at"); + + private String value; + + PropertyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PropertyEnum fromValue(String value) { + for (PropertyEnum b : PropertyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PropertyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PropertyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PropertyEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PropertyEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PROPERTY = "property"; + @SerializedName(SERIALIZED_NAME_PROPERTY) + @javax.annotation.Nullable + private PropertyEnum property; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nonnull + private String operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + @SerializedName(SERIALIZED_NAME_VALUES) + @javax.annotation.Nullable + private List values; + + public static final String SERIALIZED_NAME_FORM_FIELD_ID = "form_field_id"; + @SerializedName(SERIALIZED_NAME_FORM_FIELD_ID) + @javax.annotation.Nullable + private UUID formFieldId; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public NewSlaDataAttributesConditionsInner() { + } + + public NewSlaDataAttributesConditionsInner conditionableType(@javax.annotation.Nonnull ConditionableTypeEnum conditionableType) { + this.conditionableType = conditionableType; + return this; + } + + /** + * The type of condition + * @return conditionableType + */ + @javax.annotation.Nonnull + public ConditionableTypeEnum getConditionableType() { + return conditionableType; + } + + public void setConditionableType(@javax.annotation.Nonnull ConditionableTypeEnum conditionableType) { + this.conditionableType = conditionableType; + } + + + public NewSlaDataAttributesConditionsInner property(@javax.annotation.Nullable PropertyEnum property) { + this.property = property; + return this; + } + + /** + * The property to evaluate (for built-in field conditions). When the team has custom lifecycle statuses enabled, use 'sub_status' (with sub-status IDs as values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. + * @return property + */ + @javax.annotation.Nullable + public PropertyEnum getProperty() { + return property; + } + + public void setProperty(@javax.annotation.Nullable PropertyEnum property) { + this.property = property; + } + + + public NewSlaDataAttributesConditionsInner operator(@javax.annotation.Nonnull String operator) { + this.operator = operator; + return this; + } + + /** + * The comparison operator + * @return operator + */ + @javax.annotation.Nonnull + public String getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nonnull String operator) { + this.operator = operator; + } + + + public NewSlaDataAttributesConditionsInner values(@javax.annotation.Nullable List values) { + this.values = values; + return this; + } + + public NewSlaDataAttributesConditionsInner addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * The values to compare against + * @return values + */ + @javax.annotation.Nullable + public List getValues() { + return values; + } + + public void setValues(@javax.annotation.Nullable List values) { + this.values = values; + } + + + public NewSlaDataAttributesConditionsInner formFieldId(@javax.annotation.Nullable UUID formFieldId) { + this.formFieldId = formFieldId; + return this; + } + + /** + * The ID of the form field (for custom field conditions) + * @return formFieldId + */ + @javax.annotation.Nullable + public UUID getFormFieldId() { + return formFieldId; + } + + public void setFormFieldId(@javax.annotation.Nullable UUID formFieldId) { + this.formFieldId = formFieldId; + } + + + public NewSlaDataAttributesConditionsInner position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * The position of the condition for ordering + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSlaDataAttributesConditionsInner newSlaDataAttributesConditionsInner = (NewSlaDataAttributesConditionsInner) o; + return Objects.equals(this.conditionableType, newSlaDataAttributesConditionsInner.conditionableType) && + Objects.equals(this.property, newSlaDataAttributesConditionsInner.property) && + Objects.equals(this.operator, newSlaDataAttributesConditionsInner.operator) && + Objects.equals(this.values, newSlaDataAttributesConditionsInner.values) && + Objects.equals(this.formFieldId, newSlaDataAttributesConditionsInner.formFieldId) && + Objects.equals(this.position, newSlaDataAttributesConditionsInner.position); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(conditionableType, property, operator, values, formFieldId, position); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSlaDataAttributesConditionsInner {\n"); + sb.append(" conditionableType: ").append(toIndentedString(conditionableType)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" formFieldId: ").append(toIndentedString(formFieldId)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("conditionable_type"); + openapiFields.add("property"); + openapiFields.add("operator"); + openapiFields.add("values"); + openapiFields.add("form_field_id"); + openapiFields.add("position"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("conditionable_type"); + openapiRequiredFields.add("operator"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewSlaDataAttributesConditionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewSlaDataAttributesConditionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewSlaDataAttributesConditionsInner is not found in the empty JSON string", NewSlaDataAttributesConditionsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewSlaDataAttributesConditionsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewSlaDataAttributesConditionsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewSlaDataAttributesConditionsInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("conditionable_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `conditionable_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conditionable_type").toString())); + } + // validate the required field `conditionable_type` + ConditionableTypeEnum.validateJsonElement(jsonObj.get("conditionable_type")); + if ((jsonObj.get("property") != null && !jsonObj.get("property").isJsonNull()) && !jsonObj.get("property").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `property` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property").toString())); + } + // validate the optional field `property` + if (jsonObj.get("property") != null && !jsonObj.get("property").isJsonNull()) { + PropertyEnum.validateJsonElement(jsonObj.get("property")); + } + if (!jsonObj.get("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonNull() && !jsonObj.get("values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + } + if ((jsonObj.get("form_field_id") != null && !jsonObj.get("form_field_id").isJsonNull()) && !jsonObj.get("form_field_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `form_field_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("form_field_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewSlaDataAttributesConditionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewSlaDataAttributesConditionsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewSlaDataAttributesConditionsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewSlaDataAttributesConditionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewSlaDataAttributesConditionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewSlaDataAttributesConditionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewSlaDataAttributesConditionsInner + * @throws IOException if the JSON string is invalid with respect to NewSlaDataAttributesConditionsInner + */ + public static NewSlaDataAttributesConditionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewSlaDataAttributesConditionsInner.class); + } + + /** + * Convert an instance of NewSlaDataAttributesConditionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/NewSlaDataAttributesNotificationConfigurationsInner.java b/src/main/java/com/rootly/client/model/NewSlaDataAttributesNotificationConfigurationsInner.java new file mode 100644 index 00000000..06955d97 --- /dev/null +++ b/src/main/java/com/rootly/client/model/NewSlaDataAttributesNotificationConfigurationsInner.java @@ -0,0 +1,298 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * NewSlaDataAttributesNotificationConfigurationsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class NewSlaDataAttributesNotificationConfigurationsInner { + /** + * When to send the notification relative to the deadline + */ + @JsonAdapter(OffsetTypeEnum.Adapter.class) + public enum OffsetTypeEnum { + BEFORE_DUE("before_due"), + + WHEN_DUE("when_due"), + + AFTER_DUE("after_due"); + + private String value; + + OffsetTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OffsetTypeEnum fromValue(String value) { + for (OffsetTypeEnum b : OffsetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OffsetTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OffsetTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OffsetTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OffsetTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OFFSET_TYPE = "offset_type"; + @SerializedName(SERIALIZED_NAME_OFFSET_TYPE) + @javax.annotation.Nonnull + private OffsetTypeEnum offsetType; + + public static final String SERIALIZED_NAME_OFFSET_DAYS = "offset_days"; + @SerializedName(SERIALIZED_NAME_OFFSET_DAYS) + @javax.annotation.Nonnull + private Integer offsetDays; + + public NewSlaDataAttributesNotificationConfigurationsInner() { + } + + public NewSlaDataAttributesNotificationConfigurationsInner offsetType(@javax.annotation.Nonnull OffsetTypeEnum offsetType) { + this.offsetType = offsetType; + return this; + } + + /** + * When to send the notification relative to the deadline + * @return offsetType + */ + @javax.annotation.Nonnull + public OffsetTypeEnum getOffsetType() { + return offsetType; + } + + public void setOffsetType(@javax.annotation.Nonnull OffsetTypeEnum offsetType) { + this.offsetType = offsetType; + } + + + public NewSlaDataAttributesNotificationConfigurationsInner offsetDays(@javax.annotation.Nonnull Integer offsetDays) { + this.offsetDays = offsetDays; + return this; + } + + /** + * Number of days before or after the deadline. Must be 0 for when_due. + * @return offsetDays + */ + @javax.annotation.Nonnull + public Integer getOffsetDays() { + return offsetDays; + } + + public void setOffsetDays(@javax.annotation.Nonnull Integer offsetDays) { + this.offsetDays = offsetDays; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NewSlaDataAttributesNotificationConfigurationsInner newSlaDataAttributesNotificationConfigurationsInner = (NewSlaDataAttributesNotificationConfigurationsInner) o; + return Objects.equals(this.offsetType, newSlaDataAttributesNotificationConfigurationsInner.offsetType) && + Objects.equals(this.offsetDays, newSlaDataAttributesNotificationConfigurationsInner.offsetDays); + } + + @Override + public int hashCode() { + return Objects.hash(offsetType, offsetDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NewSlaDataAttributesNotificationConfigurationsInner {\n"); + sb.append(" offsetType: ").append(toIndentedString(offsetType)).append("\n"); + sb.append(" offsetDays: ").append(toIndentedString(offsetDays)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("offset_type"); + openapiFields.add("offset_days"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("offset_type"); + openapiRequiredFields.add("offset_days"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to NewSlaDataAttributesNotificationConfigurationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!NewSlaDataAttributesNotificationConfigurationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in NewSlaDataAttributesNotificationConfigurationsInner is not found in the empty JSON string", NewSlaDataAttributesNotificationConfigurationsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!NewSlaDataAttributesNotificationConfigurationsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NewSlaDataAttributesNotificationConfigurationsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NewSlaDataAttributesNotificationConfigurationsInner.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("offset_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `offset_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("offset_type").toString())); + } + // validate the required field `offset_type` + OffsetTypeEnum.validateJsonElement(jsonObj.get("offset_type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NewSlaDataAttributesNotificationConfigurationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NewSlaDataAttributesNotificationConfigurationsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NewSlaDataAttributesNotificationConfigurationsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NewSlaDataAttributesNotificationConfigurationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NewSlaDataAttributesNotificationConfigurationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NewSlaDataAttributesNotificationConfigurationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of NewSlaDataAttributesNotificationConfigurationsInner + * @throws IOException if the JSON string is invalid with respect to NewSlaDataAttributesNotificationConfigurationsInner + */ + public static NewSlaDataAttributesNotificationConfigurationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NewSlaDataAttributesNotificationConfigurationsInner.class); + } + + /** + * Convert an instance of NewSlaDataAttributesNotificationConfigurationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/OnCallPayReport.java b/src/main/java/com/rootly/client/model/OnCallPayReport.java new file mode 100644 index 00000000..ba11cf11 --- /dev/null +++ b/src/main/java/com/rootly/client/model/OnCallPayReport.java @@ -0,0 +1,873 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * OnCallPayReport + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class OnCallPayReport { + /** + * The current status of the report. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PROCESSING("processing"), + + GENERATED("generated"), + + DOWNLOADED("downloaded"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nonnull + private StatusEnum status; + + public static final String SERIALIZED_NAME_START_DATE = "start_date"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nonnull + private LocalDate startDate; + + public static final String SERIALIZED_NAME_END_DATE = "end_date"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nonnull + private LocalDate endDate; + + public static final String SERIALIZED_NAME_TOTAL_DURATION = "total_duration"; + @SerializedName(SERIALIZED_NAME_TOTAL_DURATION) + @javax.annotation.Nullable + private Integer totalDuration; + + public static final String SERIALIZED_NAME_USERS_COUNT = "users_count"; + @SerializedName(SERIALIZED_NAME_USERS_COUNT) + @javax.annotation.Nullable + private Integer usersCount; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + /** + * The pay calculation type. + */ + @JsonAdapter(PayTypeEnum.Adapter.class) + public enum PayTypeEnum { + HOURLY("hourly"), + + DAILY("daily"); + + private String value; + + PayTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PayTypeEnum fromValue(String value) { + for (PayTypeEnum b : PayTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PayTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PayTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PayTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PayTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PAY_TYPE = "pay_type"; + @SerializedName(SERIALIZED_NAME_PAY_TYPE) + @javax.annotation.Nullable + private PayTypeEnum payType; + + public static final String SERIALIZED_NAME_HOURLY_RATE_CENTS = "hourly_rate_cents"; + @SerializedName(SERIALIZED_NAME_HOURLY_RATE_CENTS) + @javax.annotation.Nullable + private Integer hourlyRateCents; + + public static final String SERIALIZED_NAME_DAILY_RATE_CENTS = "daily_rate_cents"; + @SerializedName(SERIALIZED_NAME_DAILY_RATE_CENTS) + @javax.annotation.Nullable + private Integer dailyRateCents; + + public static final String SERIALIZED_NAME_TOTAL_PAY_CENTS = "total_pay_cents"; + @SerializedName(SERIALIZED_NAME_TOTAL_PAY_CENTS) + @javax.annotation.Nullable + private Integer totalPayCents; + + public static final String SERIALIZED_NAME_INCLUDE_SHADOW = "include_shadow"; + @SerializedName(SERIALIZED_NAME_INCLUDE_SHADOW) + @javax.annotation.Nullable + private Boolean includeShadow; + + public static final String SERIALIZED_NAME_SHOW_INDIVIDUAL_SHIFT_DATA = "show_individual_shift_data"; + @SerializedName(SERIALIZED_NAME_SHOW_INDIVIDUAL_SHIFT_DATA) + @javax.annotation.Nullable + private Boolean showIndividualShiftData; + + public static final String SERIALIZED_NAME_HAS_SINGLE_RATE = "has_single_rate"; + @SerializedName(SERIALIZED_NAME_HAS_SINGLE_RATE) + @javax.annotation.Nullable + private Boolean hasSingleRate; + + public static final String SERIALIZED_NAME_ENABLED_GRANULAR_TIME_BREAKDOWN = "enabled_granular_time_breakdown"; + @SerializedName(SERIALIZED_NAME_ENABLED_GRANULAR_TIME_BREAKDOWN) + @javax.annotation.Nullable + private Boolean enabledGranularTimeBreakdown; + + public static final String SERIALIZED_NAME_LAST_GENERATED_AT = "last_generated_at"; + @SerializedName(SERIALIZED_NAME_LAST_GENERATED_AT) + @javax.annotation.Nullable + private OffsetDateTime lastGeneratedAt; + + public static final String SERIALIZED_NAME_TIME_ZONE = "time_zone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_CSV_FILE_URL = "csv_file_url"; + @SerializedName(SERIALIZED_NAME_CSV_FILE_URL) + @javax.annotation.Nullable + private URI csvFileUrl; + + public static final String SERIALIZED_NAME_XLSX_FILE_URL = "xlsx_file_url"; + @SerializedName(SERIALIZED_NAME_XLSX_FILE_URL) + @javax.annotation.Nullable + private URI xlsxFileUrl; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private OffsetDateTime updatedAt; + + public OnCallPayReport() { + } + + public OnCallPayReport status(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + return this; + } + + /** + * The current status of the report. + * @return status + */ + @javax.annotation.Nonnull + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nonnull StatusEnum status) { + this.status = status; + } + + + public OnCallPayReport startDate(@javax.annotation.Nonnull LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the report period. + * @return startDate + */ + @javax.annotation.Nonnull + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nonnull LocalDate startDate) { + this.startDate = startDate; + } + + + public OnCallPayReport endDate(@javax.annotation.Nonnull LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the report period. + * @return endDate + */ + @javax.annotation.Nonnull + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nonnull LocalDate endDate) { + this.endDate = endDate; + } + + + public OnCallPayReport totalDuration(@javax.annotation.Nullable Integer totalDuration) { + this.totalDuration = totalDuration; + return this; + } + + /** + * Total on-call duration in seconds. + * @return totalDuration + */ + @javax.annotation.Nullable + public Integer getTotalDuration() { + return totalDuration; + } + + public void setTotalDuration(@javax.annotation.Nullable Integer totalDuration) { + this.totalDuration = totalDuration; + } + + + public OnCallPayReport usersCount(@javax.annotation.Nullable Integer usersCount) { + this.usersCount = usersCount; + return this; + } + + /** + * Number of users included in the report. + * @return usersCount + */ + @javax.annotation.Nullable + public Integer getUsersCount() { + return usersCount; + } + + public void setUsersCount(@javax.annotation.Nullable Integer usersCount) { + this.usersCount = usersCount; + } + + + public OnCallPayReport currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * The currency code for monetary values. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public OnCallPayReport payType(@javax.annotation.Nullable PayTypeEnum payType) { + this.payType = payType; + return this; + } + + /** + * The pay calculation type. + * @return payType + */ + @javax.annotation.Nullable + public PayTypeEnum getPayType() { + return payType; + } + + public void setPayType(@javax.annotation.Nullable PayTypeEnum payType) { + this.payType = payType; + } + + + public OnCallPayReport hourlyRateCents(@javax.annotation.Nullable Integer hourlyRateCents) { + this.hourlyRateCents = hourlyRateCents; + return this; + } + + /** + * Hourly pay rate in cents. + * @return hourlyRateCents + */ + @javax.annotation.Nullable + public Integer getHourlyRateCents() { + return hourlyRateCents; + } + + public void setHourlyRateCents(@javax.annotation.Nullable Integer hourlyRateCents) { + this.hourlyRateCents = hourlyRateCents; + } + + + public OnCallPayReport dailyRateCents(@javax.annotation.Nullable Integer dailyRateCents) { + this.dailyRateCents = dailyRateCents; + return this; + } + + /** + * Daily pay rate in cents. + * @return dailyRateCents + */ + @javax.annotation.Nullable + public Integer getDailyRateCents() { + return dailyRateCents; + } + + public void setDailyRateCents(@javax.annotation.Nullable Integer dailyRateCents) { + this.dailyRateCents = dailyRateCents; + } + + + public OnCallPayReport totalPayCents(@javax.annotation.Nullable Integer totalPayCents) { + this.totalPayCents = totalPayCents; + return this; + } + + /** + * Total pay amount in cents. + * @return totalPayCents + */ + @javax.annotation.Nullable + public Integer getTotalPayCents() { + return totalPayCents; + } + + public void setTotalPayCents(@javax.annotation.Nullable Integer totalPayCents) { + this.totalPayCents = totalPayCents; + } + + + public OnCallPayReport includeShadow(@javax.annotation.Nullable Boolean includeShadow) { + this.includeShadow = includeShadow; + return this; + } + + /** + * Whether shadow shifts are included. + * @return includeShadow + */ + @javax.annotation.Nullable + public Boolean getIncludeShadow() { + return includeShadow; + } + + public void setIncludeShadow(@javax.annotation.Nullable Boolean includeShadow) { + this.includeShadow = includeShadow; + } + + + public OnCallPayReport showIndividualShiftData(@javax.annotation.Nullable Boolean showIndividualShiftData) { + this.showIndividualShiftData = showIndividualShiftData; + return this; + } + + /** + * Whether individual shift data is shown. + * @return showIndividualShiftData + */ + @javax.annotation.Nullable + public Boolean getShowIndividualShiftData() { + return showIndividualShiftData; + } + + public void setShowIndividualShiftData(@javax.annotation.Nullable Boolean showIndividualShiftData) { + this.showIndividualShiftData = showIndividualShiftData; + } + + + public OnCallPayReport hasSingleRate(@javax.annotation.Nullable Boolean hasSingleRate) { + this.hasSingleRate = hasSingleRate; + return this; + } + + /** + * Whether a single rate is applied to all users. + * @return hasSingleRate + */ + @javax.annotation.Nullable + public Boolean getHasSingleRate() { + return hasSingleRate; + } + + public void setHasSingleRate(@javax.annotation.Nullable Boolean hasSingleRate) { + this.hasSingleRate = hasSingleRate; + } + + + public OnCallPayReport enabledGranularTimeBreakdown(@javax.annotation.Nullable Boolean enabledGranularTimeBreakdown) { + this.enabledGranularTimeBreakdown = enabledGranularTimeBreakdown; + return this; + } + + /** + * Whether granular time breakdown is enabled. + * @return enabledGranularTimeBreakdown + */ + @javax.annotation.Nullable + public Boolean getEnabledGranularTimeBreakdown() { + return enabledGranularTimeBreakdown; + } + + public void setEnabledGranularTimeBreakdown(@javax.annotation.Nullable Boolean enabledGranularTimeBreakdown) { + this.enabledGranularTimeBreakdown = enabledGranularTimeBreakdown; + } + + + public OnCallPayReport lastGeneratedAt(@javax.annotation.Nullable OffsetDateTime lastGeneratedAt) { + this.lastGeneratedAt = lastGeneratedAt; + return this; + } + + /** + * When the report was last generated. + * @return lastGeneratedAt + */ + @javax.annotation.Nullable + public OffsetDateTime getLastGeneratedAt() { + return lastGeneratedAt; + } + + public void setLastGeneratedAt(@javax.annotation.Nullable OffsetDateTime lastGeneratedAt) { + this.lastGeneratedAt = lastGeneratedAt; + } + + + public OnCallPayReport timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * The team's IANA timezone used to interpret start_date and end_date. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public OnCallPayReport csvFileUrl(@javax.annotation.Nullable URI csvFileUrl) { + this.csvFileUrl = csvFileUrl; + return this; + } + + /** + * Download URL for the generated CSV report. Null until the report is generated. + * @return csvFileUrl + */ + @javax.annotation.Nullable + public URI getCsvFileUrl() { + return csvFileUrl; + } + + public void setCsvFileUrl(@javax.annotation.Nullable URI csvFileUrl) { + this.csvFileUrl = csvFileUrl; + } + + + public OnCallPayReport xlsxFileUrl(@javax.annotation.Nullable URI xlsxFileUrl) { + this.xlsxFileUrl = xlsxFileUrl; + return this; + } + + /** + * Download URL for the generated XLSX report. Null until the report is generated. + * @return xlsxFileUrl + */ + @javax.annotation.Nullable + public URI getXlsxFileUrl() { + return xlsxFileUrl; + } + + public void setXlsxFileUrl(@javax.annotation.Nullable URI xlsxFileUrl) { + this.xlsxFileUrl = xlsxFileUrl; + } + + + public OnCallPayReport createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public OnCallPayReport updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + */ + @javax.annotation.Nonnull + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPayReport onCallPayReport = (OnCallPayReport) o; + return Objects.equals(this.status, onCallPayReport.status) && + Objects.equals(this.startDate, onCallPayReport.startDate) && + Objects.equals(this.endDate, onCallPayReport.endDate) && + Objects.equals(this.totalDuration, onCallPayReport.totalDuration) && + Objects.equals(this.usersCount, onCallPayReport.usersCount) && + Objects.equals(this.currency, onCallPayReport.currency) && + Objects.equals(this.payType, onCallPayReport.payType) && + Objects.equals(this.hourlyRateCents, onCallPayReport.hourlyRateCents) && + Objects.equals(this.dailyRateCents, onCallPayReport.dailyRateCents) && + Objects.equals(this.totalPayCents, onCallPayReport.totalPayCents) && + Objects.equals(this.includeShadow, onCallPayReport.includeShadow) && + Objects.equals(this.showIndividualShiftData, onCallPayReport.showIndividualShiftData) && + Objects.equals(this.hasSingleRate, onCallPayReport.hasSingleRate) && + Objects.equals(this.enabledGranularTimeBreakdown, onCallPayReport.enabledGranularTimeBreakdown) && + Objects.equals(this.lastGeneratedAt, onCallPayReport.lastGeneratedAt) && + Objects.equals(this.timeZone, onCallPayReport.timeZone) && + Objects.equals(this.csvFileUrl, onCallPayReport.csvFileUrl) && + Objects.equals(this.xlsxFileUrl, onCallPayReport.xlsxFileUrl) && + Objects.equals(this.createdAt, onCallPayReport.createdAt) && + Objects.equals(this.updatedAt, onCallPayReport.updatedAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(status, startDate, endDate, totalDuration, usersCount, currency, payType, hourlyRateCents, dailyRateCents, totalPayCents, includeShadow, showIndividualShiftData, hasSingleRate, enabledGranularTimeBreakdown, lastGeneratedAt, timeZone, csvFileUrl, xlsxFileUrl, createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPayReport {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" totalDuration: ").append(toIndentedString(totalDuration)).append("\n"); + sb.append(" usersCount: ").append(toIndentedString(usersCount)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" payType: ").append(toIndentedString(payType)).append("\n"); + sb.append(" hourlyRateCents: ").append(toIndentedString(hourlyRateCents)).append("\n"); + sb.append(" dailyRateCents: ").append(toIndentedString(dailyRateCents)).append("\n"); + sb.append(" totalPayCents: ").append(toIndentedString(totalPayCents)).append("\n"); + sb.append(" includeShadow: ").append(toIndentedString(includeShadow)).append("\n"); + sb.append(" showIndividualShiftData: ").append(toIndentedString(showIndividualShiftData)).append("\n"); + sb.append(" hasSingleRate: ").append(toIndentedString(hasSingleRate)).append("\n"); + sb.append(" enabledGranularTimeBreakdown: ").append(toIndentedString(enabledGranularTimeBreakdown)).append("\n"); + sb.append(" lastGeneratedAt: ").append(toIndentedString(lastGeneratedAt)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" csvFileUrl: ").append(toIndentedString(csvFileUrl)).append("\n"); + sb.append(" xlsxFileUrl: ").append(toIndentedString(xlsxFileUrl)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("status"); + openapiFields.add("start_date"); + openapiFields.add("end_date"); + openapiFields.add("total_duration"); + openapiFields.add("users_count"); + openapiFields.add("currency"); + openapiFields.add("pay_type"); + openapiFields.add("hourly_rate_cents"); + openapiFields.add("daily_rate_cents"); + openapiFields.add("total_pay_cents"); + openapiFields.add("include_shadow"); + openapiFields.add("show_individual_shift_data"); + openapiFields.add("has_single_rate"); + openapiFields.add("enabled_granular_time_breakdown"); + openapiFields.add("last_generated_at"); + openapiFields.add("time_zone"); + openapiFields.add("csv_file_url"); + openapiFields.add("xlsx_file_url"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("start_date"); + openapiRequiredFields.add("end_date"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnCallPayReport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnCallPayReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnCallPayReport is not found in the empty JSON string", OnCallPayReport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnCallPayReport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnCallPayReport` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnCallPayReport.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the required field `status` + StatusEnum.validateJsonElement(jsonObj.get("status")); + if ((jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonNull()) && !jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + if ((jsonObj.get("pay_type") != null && !jsonObj.get("pay_type").isJsonNull()) && !jsonObj.get("pay_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pay_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pay_type").toString())); + } + // validate the optional field `pay_type` + if (jsonObj.get("pay_type") != null && !jsonObj.get("pay_type").isJsonNull()) { + PayTypeEnum.validateJsonElement(jsonObj.get("pay_type")); + } + if ((jsonObj.get("time_zone") != null && !jsonObj.get("time_zone").isJsonNull()) && !jsonObj.get("time_zone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `time_zone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("time_zone").toString())); + } + if ((jsonObj.get("csv_file_url") != null && !jsonObj.get("csv_file_url").isJsonNull()) && !jsonObj.get("csv_file_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `csv_file_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("csv_file_url").toString())); + } + if ((jsonObj.get("xlsx_file_url") != null && !jsonObj.get("xlsx_file_url").isJsonNull()) && !jsonObj.get("xlsx_file_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `xlsx_file_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xlsx_file_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnCallPayReport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnCallPayReport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnCallPayReport.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnCallPayReport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnCallPayReport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnCallPayReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnCallPayReport + * @throws IOException if the JSON string is invalid with respect to OnCallPayReport + */ + public static OnCallPayReport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnCallPayReport.class); + } + + /** + * Convert an instance of OnCallPayReport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/OnCallPayReportList.java b/src/main/java/com/rootly/client/model/OnCallPayReportList.java new file mode 100644 index 00000000..09cf78c2 --- /dev/null +++ b/src/main/java/com/rootly/client/model/OnCallPayReportList.java @@ -0,0 +1,294 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import com.rootly.client.model.OnCallPayReportResponseData; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * OnCallPayReportList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class OnCallPayReportList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private Links links; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public OnCallPayReportList() { + } + + public OnCallPayReportList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public OnCallPayReportList addDataItem(OnCallPayReportResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public OnCallPayReportList links(@javax.annotation.Nonnull Links links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public Links getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull Links links) { + this.links = links; + } + + + public OnCallPayReportList meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPayReportList onCallPayReportList = (OnCallPayReportList) o; + return Objects.equals(this.data, onCallPayReportList.data) && + Objects.equals(this.links, onCallPayReportList.links) && + Objects.equals(this.meta, onCallPayReportList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPayReportList {\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("}"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("links"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("links"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnCallPayReportList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnCallPayReportList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnCallPayReportList is not found in the empty JSON string", OnCallPayReportList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnCallPayReportList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnCallPayReportList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnCallPayReportList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + OnCallPayReportResponseData.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `links` + Links.validateJsonElement(jsonObj.get("links")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnCallPayReportList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnCallPayReportList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnCallPayReportList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnCallPayReportList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnCallPayReportList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnCallPayReportList given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnCallPayReportList + * @throws IOException if the JSON string is invalid with respect to OnCallPayReportList + */ + public static OnCallPayReportList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnCallPayReportList.class); + } + + /** + * Convert an instance of OnCallPayReportList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/OnCallPayReportResponse.java b/src/main/java/com/rootly/client/model/OnCallPayReportResponse.java new file mode 100644 index 00000000..2b4974c2 --- /dev/null +++ b/src/main/java/com/rootly/client/model/OnCallPayReportResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.OnCallPayReportResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * OnCallPayReportResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class OnCallPayReportResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private OnCallPayReportResponseData data; + + public OnCallPayReportResponse() { + } + + public OnCallPayReportResponse data(@javax.annotation.Nonnull OnCallPayReportResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public OnCallPayReportResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull OnCallPayReportResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPayReportResponse onCallPayReportResponse = (OnCallPayReportResponse) o; + return Objects.equals(this.data, onCallPayReportResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPayReportResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnCallPayReportResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnCallPayReportResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnCallPayReportResponse is not found in the empty JSON string", OnCallPayReportResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnCallPayReportResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnCallPayReportResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnCallPayReportResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + OnCallPayReportResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnCallPayReportResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnCallPayReportResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnCallPayReportResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnCallPayReportResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnCallPayReportResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnCallPayReportResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnCallPayReportResponse + * @throws IOException if the JSON string is invalid with respect to OnCallPayReportResponse + */ + public static OnCallPayReportResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnCallPayReportResponse.class); + } + + /** + * Convert an instance of OnCallPayReportResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/OnCallPayReportResponseData.java b/src/main/java/com/rootly/client/model/OnCallPayReportResponseData.java new file mode 100644 index 00000000..960a3b58 --- /dev/null +++ b/src/main/java/com/rootly/client/model/OnCallPayReportResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.OnCallPayReport; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * OnCallPayReportResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class OnCallPayReportResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ON_CALL_PAY_REPORTS("on_call_pay_reports"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private OnCallPayReport attributes; + + public OnCallPayReportResponseData() { + } + + public OnCallPayReportResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the on_call_pay_report + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public OnCallPayReportResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public OnCallPayReportResponseData attributes(@javax.annotation.Nonnull OnCallPayReport attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public OnCallPayReport getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull OnCallPayReport attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPayReportResponseData onCallPayReportResponseData = (OnCallPayReportResponseData) o; + return Objects.equals(this.id, onCallPayReportResponseData.id) && + Objects.equals(this.type, onCallPayReportResponseData.type) && + Objects.equals(this.attributes, onCallPayReportResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPayReportResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to OnCallPayReportResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OnCallPayReportResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OnCallPayReportResponseData is not found in the empty JSON string", OnCallPayReportResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!OnCallPayReportResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnCallPayReportResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OnCallPayReportResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + OnCallPayReport.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OnCallPayReportResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OnCallPayReportResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OnCallPayReportResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OnCallPayReportResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OnCallPayReportResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OnCallPayReportResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of OnCallPayReportResponseData + * @throws IOException if the JSON string is invalid with respect to OnCallPayReportResponseData + */ + public static OnCallPayReportResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OnCallPayReportResponseData.class); + } + + /** + * Convert an instance of OnCallPayReportResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PageJsmopsOnCallRespondersTaskParams.java b/src/main/java/com/rootly/client/model/PageJsmopsOnCallRespondersTaskParams.java new file mode 100644 index 00000000..45f5184c --- /dev/null +++ b/src/main/java/com/rootly/client/model/PageJsmopsOnCallRespondersTaskParams.java @@ -0,0 +1,559 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PageJsmopsOnCallRespondersTaskParams + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PageJsmopsOnCallRespondersTaskParams { + /** + * Gets or Sets taskType + */ + @JsonAdapter(TaskTypeEnum.Adapter.class) + public enum TaskTypeEnum { + PAGE_JSMOPS_ON_CALL_RESPONDERS("page_jsmops_on_call_responders"); + + private String value; + + TaskTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TaskTypeEnum fromValue(String value) { + for (TaskTypeEnum b : TaskTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TaskTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TaskTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TaskTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TASK_TYPE = "task_type"; + @SerializedName(SERIALIZED_NAME_TASK_TYPE) + @javax.annotation.Nullable + private TaskTypeEnum taskType; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_TEAMS = "teams"; + @SerializedName(SERIALIZED_NAME_TEAMS) + @javax.annotation.Nullable + private List teams = new ArrayList<>(); + + public static final String SERIALIZED_NAME_USERS = "users"; + @SerializedName(SERIALIZED_NAME_USERS) + @javax.annotation.Nullable + private List users = new ArrayList<>(); + + /** + * Gets or Sets priority + */ + @JsonAdapter(PriorityEnum.Adapter.class) + public enum PriorityEnum { + P3("P3"), + + P1("P1"), + + P2("P2"), + + P32("P3"), + + P4("P4"), + + P5("P5"), + + AUTO("auto"); + + private String value; + + PriorityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PriorityEnum fromValue(String value) { + for (PriorityEnum b : PriorityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PriorityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PriorityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PriorityEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PriorityEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PRIORITY = "priority"; + @SerializedName(SERIALIZED_NAME_PRIORITY) + @javax.annotation.Nullable + private PriorityEnum priority = PriorityEnum.P3; + + public PageJsmopsOnCallRespondersTaskParams() { + } + + public PageJsmopsOnCallRespondersTaskParams taskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get taskType + * @return taskType + */ + @javax.annotation.Nullable + public TaskTypeEnum getTaskType() { + return taskType; + } + + public void setTaskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + } + + + public PageJsmopsOnCallRespondersTaskParams title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Incident title. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public PageJsmopsOnCallRespondersTaskParams message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Message of the incident + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public PageJsmopsOnCallRespondersTaskParams description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description field of the incident that is generally used to provide a detailed information about the incident + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public PageJsmopsOnCallRespondersTaskParams teams(@javax.annotation.Nullable List teams) { + this.teams = teams; + return this; + } + + public PageJsmopsOnCallRespondersTaskParams addTeamsItem(AddActionItemTaskParamsPostToSlackChannelsInner teamsItem) { + if (this.teams == null) { + this.teams = new ArrayList<>(); + } + this.teams.add(teamsItem); + return this; + } + + /** + * Get teams + * @return teams + */ + @javax.annotation.Nullable + public List getTeams() { + return teams; + } + + public void setTeams(@javax.annotation.Nullable List teams) { + this.teams = teams; + } + + + public PageJsmopsOnCallRespondersTaskParams users(@javax.annotation.Nullable List users) { + this.users = users; + return this; + } + + public PageJsmopsOnCallRespondersTaskParams addUsersItem(AddActionItemTaskParamsPostToSlackChannelsInner usersItem) { + if (this.users == null) { + this.users = new ArrayList<>(); + } + this.users.add(usersItem); + return this; + } + + /** + * Get users + * @return users + */ + @javax.annotation.Nullable + public List getUsers() { + return users; + } + + public void setUsers(@javax.annotation.Nullable List users) { + this.users = users; + } + + + public PageJsmopsOnCallRespondersTaskParams priority(@javax.annotation.Nullable PriorityEnum priority) { + this.priority = priority; + return this; + } + + /** + * Get priority + * @return priority + */ + @javax.annotation.Nullable + public PriorityEnum getPriority() { + return priority; + } + + public void setPriority(@javax.annotation.Nullable PriorityEnum priority) { + this.priority = priority; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PageJsmopsOnCallRespondersTaskParams pageJsmopsOnCallRespondersTaskParams = (PageJsmopsOnCallRespondersTaskParams) o; + return Objects.equals(this.taskType, pageJsmopsOnCallRespondersTaskParams.taskType) && + Objects.equals(this.title, pageJsmopsOnCallRespondersTaskParams.title) && + Objects.equals(this.message, pageJsmopsOnCallRespondersTaskParams.message) && + Objects.equals(this.description, pageJsmopsOnCallRespondersTaskParams.description) && + Objects.equals(this.teams, pageJsmopsOnCallRespondersTaskParams.teams) && + Objects.equals(this.users, pageJsmopsOnCallRespondersTaskParams.users) && + Objects.equals(this.priority, pageJsmopsOnCallRespondersTaskParams.priority); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(taskType, title, message, description, teams, users, priority); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PageJsmopsOnCallRespondersTaskParams {\n"); + sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("task_type"); + openapiFields.add("title"); + openapiFields.add("message"); + openapiFields.add("description"); + openapiFields.add("teams"); + openapiFields.add("users"); + openapiFields.add("priority"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PageJsmopsOnCallRespondersTaskParams + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PageJsmopsOnCallRespondersTaskParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PageJsmopsOnCallRespondersTaskParams is not found in the empty JSON string", PageJsmopsOnCallRespondersTaskParams.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PageJsmopsOnCallRespondersTaskParams.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PageJsmopsOnCallRespondersTaskParams` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) && !jsonObj.get("task_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_type").toString())); + } + // validate the optional field `task_type` + if (jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) { + TaskTypeEnum.validateJsonElement(jsonObj.get("task_type")); + } + if ((jsonObj.get("title") != null && !jsonObj.get("title").isJsonNull()) && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (jsonObj.get("teams") != null && !jsonObj.get("teams").isJsonNull()) { + JsonArray jsonArrayteams = jsonObj.getAsJsonArray("teams"); + if (jsonArrayteams != null) { + // ensure the json data is an array + if (!jsonObj.get("teams").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `teams` to be an array in the JSON string but got `%s`", jsonObj.get("teams").toString())); + } + + // validate the optional field `teams` (array) + for (int i = 0; i < jsonArrayteams.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArrayteams.get(i)); + }; + } + } + if (jsonObj.get("users") != null && !jsonObj.get("users").isJsonNull()) { + JsonArray jsonArrayusers = jsonObj.getAsJsonArray("users"); + if (jsonArrayusers != null) { + // ensure the json data is an array + if (!jsonObj.get("users").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString())); + } + + // validate the optional field `users` (array) + for (int i = 0; i < jsonArrayusers.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArrayusers.get(i)); + }; + } + } + if ((jsonObj.get("priority") != null && !jsonObj.get("priority").isJsonNull()) && !jsonObj.get("priority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `priority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priority").toString())); + } + // validate the optional field `priority` + if (jsonObj.get("priority") != null && !jsonObj.get("priority").isJsonNull()) { + PriorityEnum.validateJsonElement(jsonObj.get("priority")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PageJsmopsOnCallRespondersTaskParams.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PageJsmopsOnCallRespondersTaskParams' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PageJsmopsOnCallRespondersTaskParams.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PageJsmopsOnCallRespondersTaskParams value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PageJsmopsOnCallRespondersTaskParams read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PageJsmopsOnCallRespondersTaskParams given an JSON string + * + * @param jsonString JSON string + * @return An instance of PageJsmopsOnCallRespondersTaskParams + * @throws IOException if the JSON string is invalid with respect to PageJsmopsOnCallRespondersTaskParams + */ + public static PageJsmopsOnCallRespondersTaskParams fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PageJsmopsOnCallRespondersTaskParams.class); + } + + /** + * Convert an instance of PageJsmopsOnCallRespondersTaskParams to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRoute.java b/src/main/java/com/rootly/client/model/PatchAlertRoute.java new file mode 100644 index 00000000..d16a9eb9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRoute.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRoute + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRoute { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private PatchAlertRouteData data; + + public PatchAlertRoute() { + } + + public PatchAlertRoute data(@javax.annotation.Nonnull PatchAlertRouteData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public PatchAlertRouteData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull PatchAlertRouteData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRoute patchAlertRoute = (PatchAlertRoute) o; + return Objects.equals(this.data, patchAlertRoute.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRoute {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRoute + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRoute.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRoute is not found in the empty JSON string", PatchAlertRoute.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRoute.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRoute` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PatchAlertRoute.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + PatchAlertRouteData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRoute.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRoute' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRoute.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRoute value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRoute read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRoute given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRoute + * @throws IOException if the JSON string is invalid with respect to PatchAlertRoute + */ + public static PatchAlertRoute fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRoute.class); + } + + /** + * Convert an instance of PatchAlertRoute to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRouteData.java b/src/main/java/com/rootly/client/model/PatchAlertRouteData.java new file mode 100644 index 00000000..3e7fb935 --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRouteData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRouteData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRouteData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ALERT_ROUTES("alert_routes"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private PatchAlertRouteDataAttributes attributes; + + public PatchAlertRouteData() { + } + + public PatchAlertRouteData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public PatchAlertRouteData attributes(@javax.annotation.Nonnull PatchAlertRouteDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public PatchAlertRouteDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull PatchAlertRouteDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRouteData patchAlertRouteData = (PatchAlertRouteData) o; + return Objects.equals(this.type, patchAlertRouteData.type) && + Objects.equals(this.attributes, patchAlertRouteData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRouteData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRouteData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRouteData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRouteData is not found in the empty JSON string", PatchAlertRouteData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRouteData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRouteData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PatchAlertRouteData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + PatchAlertRouteDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRouteData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRouteData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRouteData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRouteData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRouteData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRouteData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRouteData + * @throws IOException if the JSON string is invalid with respect to PatchAlertRouteData + */ + public static PatchAlertRouteData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRouteData.class); + } + + /** + * Convert an instance of PatchAlertRouteData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributes.java b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributes.java new file mode 100644 index 00000000..6abae3c4 --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributes.java @@ -0,0 +1,364 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRouteDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRouteDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_ALERTS_SOURCE_IDS = "alerts_source_ids"; + @SerializedName(SERIALIZED_NAME_ALERTS_SOURCE_IDS) + @javax.annotation.Nullable + private List alertsSourceIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_OWNING_TEAM_IDS = "owning_team_ids"; + @SerializedName(SERIALIZED_NAME_OWNING_TEAM_IDS) + @javax.annotation.Nullable + private List owningTeamIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RULES = "rules"; + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nullable + private List rules = new ArrayList<>(); + + public PatchAlertRouteDataAttributes() { + } + + public PatchAlertRouteDataAttributes name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the alert route + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public PatchAlertRouteDataAttributes enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the alert route is enabled + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public PatchAlertRouteDataAttributes alertsSourceIds(@javax.annotation.Nullable List alertsSourceIds) { + this.alertsSourceIds = alertsSourceIds; + return this; + } + + public PatchAlertRouteDataAttributes addAlertsSourceIdsItem(UUID alertsSourceIdsItem) { + if (this.alertsSourceIds == null) { + this.alertsSourceIds = new ArrayList<>(); + } + this.alertsSourceIds.add(alertsSourceIdsItem); + return this; + } + + /** + * Get alertsSourceIds + * @return alertsSourceIds + */ + @javax.annotation.Nullable + public List getAlertsSourceIds() { + return alertsSourceIds; + } + + public void setAlertsSourceIds(@javax.annotation.Nullable List alertsSourceIds) { + this.alertsSourceIds = alertsSourceIds; + } + + + public PatchAlertRouteDataAttributes owningTeamIds(@javax.annotation.Nullable List owningTeamIds) { + this.owningTeamIds = owningTeamIds; + return this; + } + + public PatchAlertRouteDataAttributes addOwningTeamIdsItem(UUID owningTeamIdsItem) { + if (this.owningTeamIds == null) { + this.owningTeamIds = new ArrayList<>(); + } + this.owningTeamIds.add(owningTeamIdsItem); + return this; + } + + /** + * Get owningTeamIds + * @return owningTeamIds + */ + @javax.annotation.Nullable + public List getOwningTeamIds() { + return owningTeamIds; + } + + public void setOwningTeamIds(@javax.annotation.Nullable List owningTeamIds) { + this.owningTeamIds = owningTeamIds; + } + + + public PatchAlertRouteDataAttributes rules(@javax.annotation.Nullable List rules) { + this.rules = rules; + return this; + } + + public PatchAlertRouteDataAttributes addRulesItem(PatchAlertRouteDataAttributesRulesInner rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); + } + this.rules.add(rulesItem); + return this; + } + + /** + * Get rules + * @return rules + */ + @javax.annotation.Nullable + public List getRules() { + return rules; + } + + public void setRules(@javax.annotation.Nullable List rules) { + this.rules = rules; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRouteDataAttributes patchAlertRouteDataAttributes = (PatchAlertRouteDataAttributes) o; + return Objects.equals(this.name, patchAlertRouteDataAttributes.name) && + Objects.equals(this.enabled, patchAlertRouteDataAttributes.enabled) && + Objects.equals(this.alertsSourceIds, patchAlertRouteDataAttributes.alertsSourceIds) && + Objects.equals(this.owningTeamIds, patchAlertRouteDataAttributes.owningTeamIds) && + Objects.equals(this.rules, patchAlertRouteDataAttributes.rules); + } + + @Override + public int hashCode() { + return Objects.hash(name, enabled, alertsSourceIds, owningTeamIds, rules); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRouteDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" alertsSourceIds: ").append(toIndentedString(alertsSourceIds)).append("\n"); + sb.append(" owningTeamIds: ").append(toIndentedString(owningTeamIds)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("enabled"); + openapiFields.add("alerts_source_ids"); + openapiFields.add("owning_team_ids"); + openapiFields.add("rules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRouteDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRouteDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRouteDataAttributes is not found in the empty JSON string", PatchAlertRouteDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRouteDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRouteDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("alerts_source_ids") != null && !jsonObj.get("alerts_source_ids").isJsonNull() && !jsonObj.get("alerts_source_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `alerts_source_ids` to be an array in the JSON string but got `%s`", jsonObj.get("alerts_source_ids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("owning_team_ids") != null && !jsonObj.get("owning_team_ids").isJsonNull() && !jsonObj.get("owning_team_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `owning_team_ids` to be an array in the JSON string but got `%s`", jsonObj.get("owning_team_ids").toString())); + } + if (jsonObj.get("rules") != null && !jsonObj.get("rules").isJsonNull()) { + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); + if (jsonArrayrules != null) { + // ensure the json data is an array + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); + } + + // validate the optional field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + PatchAlertRouteDataAttributesRulesInner.validateJsonElement(jsonArrayrules.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRouteDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRouteDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRouteDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRouteDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRouteDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRouteDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRouteDataAttributes + * @throws IOException if the JSON string is invalid with respect to PatchAlertRouteDataAttributes + */ + public static PatchAlertRouteDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRouteDataAttributes.class); + } + + /** + * Convert an instance of PatchAlertRouteDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInner.java b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInner.java new file mode 100644 index 00000000..9259029d --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInner.java @@ -0,0 +1,420 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInnerDestinationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRouteDataAttributesRulesInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRouteDataAttributesRulesInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private UUID id; + + public static final String SERIALIZED_NAME_DESTROY = "_destroy"; + @SerializedName(SERIALIZED_NAME_DESTROY) + @javax.annotation.Nullable + private Boolean destroy; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public static final String SERIALIZED_NAME_FALLBACK_RULE = "fallback_rule"; + @SerializedName(SERIALIZED_NAME_FALLBACK_RULE) + @javax.annotation.Nullable + private Boolean fallbackRule = false; + + public static final String SERIALIZED_NAME_DESTINATIONS = "destinations"; + @SerializedName(SERIALIZED_NAME_DESTINATIONS) + @javax.annotation.Nullable + private List destinations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONDITION_GROUPS = "condition_groups"; + @SerializedName(SERIALIZED_NAME_CONDITION_GROUPS) + @javax.annotation.Nullable + private List conditionGroups = new ArrayList<>(); + + public PatchAlertRouteDataAttributesRulesInner() { + } + + public PatchAlertRouteDataAttributesRulesInner id(@javax.annotation.Nullable UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the alert routing rule. Required for updating or deleting existing rules. + * @return id + */ + @javax.annotation.Nullable + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nullable UUID id) { + this.id = id; + } + + + public PatchAlertRouteDataAttributesRulesInner destroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + return this; + } + + /** + * Set to true to delete this rule. When true, only the id field is required. + * @return destroy + */ + @javax.annotation.Nullable + public Boolean getDestroy() { + return destroy; + } + + public void setDestroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + } + + + public PatchAlertRouteDataAttributesRulesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the alert routing rule + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public PatchAlertRouteDataAttributesRulesInner position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * The position of the alert routing rule for ordering evaluation + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public PatchAlertRouteDataAttributesRulesInner fallbackRule(@javax.annotation.Nullable Boolean fallbackRule) { + this.fallbackRule = fallbackRule; + return this; + } + + /** + * Whether this is a fallback rule + * @return fallbackRule + */ + @javax.annotation.Nullable + public Boolean getFallbackRule() { + return fallbackRule; + } + + public void setFallbackRule(@javax.annotation.Nullable Boolean fallbackRule) { + this.fallbackRule = fallbackRule; + } + + + public PatchAlertRouteDataAttributesRulesInner destinations(@javax.annotation.Nullable List destinations) { + this.destinations = destinations; + return this; + } + + public PatchAlertRouteDataAttributesRulesInner addDestinationsItem(PatchAlertRouteDataAttributesRulesInnerDestinationsInner destinationsItem) { + if (this.destinations == null) { + this.destinations = new ArrayList<>(); + } + this.destinations.add(destinationsItem); + return this; + } + + /** + * Get destinations + * @return destinations + */ + @javax.annotation.Nullable + public List getDestinations() { + return destinations; + } + + public void setDestinations(@javax.annotation.Nullable List destinations) { + this.destinations = destinations; + } + + + public PatchAlertRouteDataAttributesRulesInner conditionGroups(@javax.annotation.Nullable List conditionGroups) { + this.conditionGroups = conditionGroups; + return this; + } + + public PatchAlertRouteDataAttributesRulesInner addConditionGroupsItem(PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner conditionGroupsItem) { + if (this.conditionGroups == null) { + this.conditionGroups = new ArrayList<>(); + } + this.conditionGroups.add(conditionGroupsItem); + return this; + } + + /** + * Get conditionGroups + * @return conditionGroups + */ + @javax.annotation.Nullable + public List getConditionGroups() { + return conditionGroups; + } + + public void setConditionGroups(@javax.annotation.Nullable List conditionGroups) { + this.conditionGroups = conditionGroups; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRouteDataAttributesRulesInner patchAlertRouteDataAttributesRulesInner = (PatchAlertRouteDataAttributesRulesInner) o; + return Objects.equals(this.id, patchAlertRouteDataAttributesRulesInner.id) && + Objects.equals(this.destroy, patchAlertRouteDataAttributesRulesInner.destroy) && + Objects.equals(this.name, patchAlertRouteDataAttributesRulesInner.name) && + Objects.equals(this.position, patchAlertRouteDataAttributesRulesInner.position) && + Objects.equals(this.fallbackRule, patchAlertRouteDataAttributesRulesInner.fallbackRule) && + Objects.equals(this.destinations, patchAlertRouteDataAttributesRulesInner.destinations) && + Objects.equals(this.conditionGroups, patchAlertRouteDataAttributesRulesInner.conditionGroups); + } + + @Override + public int hashCode() { + return Objects.hash(id, destroy, name, position, fallbackRule, destinations, conditionGroups); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRouteDataAttributesRulesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" destroy: ").append(toIndentedString(destroy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" fallbackRule: ").append(toIndentedString(fallbackRule)).append("\n"); + sb.append(" destinations: ").append(toIndentedString(destinations)).append("\n"); + sb.append(" conditionGroups: ").append(toIndentedString(conditionGroups)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("_destroy"); + openapiFields.add("name"); + openapiFields.add("position"); + openapiFields.add("fallback_rule"); + openapiFields.add("destinations"); + openapiFields.add("condition_groups"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRouteDataAttributesRulesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRouteDataAttributesRulesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRouteDataAttributesRulesInner is not found in the empty JSON string", PatchAlertRouteDataAttributesRulesInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRouteDataAttributesRulesInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRouteDataAttributesRulesInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if (jsonObj.get("destinations") != null && !jsonObj.get("destinations").isJsonNull()) { + JsonArray jsonArraydestinations = jsonObj.getAsJsonArray("destinations"); + if (jsonArraydestinations != null) { + // ensure the json data is an array + if (!jsonObj.get("destinations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `destinations` to be an array in the JSON string but got `%s`", jsonObj.get("destinations").toString())); + } + + // validate the optional field `destinations` (array) + for (int i = 0; i < jsonArraydestinations.size(); i++) { + PatchAlertRouteDataAttributesRulesInnerDestinationsInner.validateJsonElement(jsonArraydestinations.get(i)); + }; + } + } + if (jsonObj.get("condition_groups") != null && !jsonObj.get("condition_groups").isJsonNull()) { + JsonArray jsonArrayconditionGroups = jsonObj.getAsJsonArray("condition_groups"); + if (jsonArrayconditionGroups != null) { + // ensure the json data is an array + if (!jsonObj.get("condition_groups").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `condition_groups` to be an array in the JSON string but got `%s`", jsonObj.get("condition_groups").toString())); + } + + // validate the optional field `condition_groups` (array) + for (int i = 0; i < jsonArrayconditionGroups.size(); i++) { + PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.validateJsonElement(jsonArrayconditionGroups.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRouteDataAttributesRulesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRouteDataAttributesRulesInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRouteDataAttributesRulesInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRouteDataAttributesRulesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRouteDataAttributesRulesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRouteDataAttributesRulesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRouteDataAttributesRulesInner + * @throws IOException if the JSON string is invalid with respect to PatchAlertRouteDataAttributesRulesInner + */ + public static PatchAlertRouteDataAttributesRulesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRouteDataAttributesRulesInner.class); + } + + /** + * Convert an instance of PatchAlertRouteDataAttributesRulesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.java b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.java new file mode 100644 index 00000000..6e4b73a2 --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.java @@ -0,0 +1,313 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private UUID id; + + public static final String SERIALIZED_NAME_DESTROY = "_destroy"; + @SerializedName(SERIALIZED_NAME_DESTROY) + @javax.annotation.Nullable + private Boolean destroy; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + @javax.annotation.Nullable + private List conditions = new ArrayList<>(); + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner() { + } + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner id(@javax.annotation.Nullable UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the condition group. Required for updating or deleting existing condition groups. + * @return id + */ + @javax.annotation.Nullable + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nullable UUID id) { + this.id = id; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner destroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + return this; + } + + /** + * Set to true to delete this condition group + * @return destroy + */ + @javax.annotation.Nullable + public Boolean getDestroy() { + return destroy; + } + + public void setDestroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * The position of the condition group + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner conditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + return this; + } + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner addConditionsItem(PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Get conditions + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner patchAlertRouteDataAttributesRulesInnerConditionGroupsInner = (PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner) o; + return Objects.equals(this.id, patchAlertRouteDataAttributesRulesInnerConditionGroupsInner.id) && + Objects.equals(this.destroy, patchAlertRouteDataAttributesRulesInnerConditionGroupsInner.destroy) && + Objects.equals(this.position, patchAlertRouteDataAttributesRulesInnerConditionGroupsInner.position) && + Objects.equals(this.conditions, patchAlertRouteDataAttributesRulesInnerConditionGroupsInner.conditions); + } + + @Override + public int hashCode() { + return Objects.hash(id, destroy, position, conditions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" destroy: ").append(toIndentedString(destroy)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("_destroy"); + openapiFields.add("position"); + openapiFields.add("conditions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner is not found in the empty JSON string", PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + * @throws IOException if the JSON string is invalid with respect to PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + */ + public static PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner.class); + } + + /** + * Convert an instance of PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.java b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.java new file mode 100644 index 00000000..53e3fc85 --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.java @@ -0,0 +1,686 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private UUID id; + + public static final String SERIALIZED_NAME_DESTROY = "_destroy"; + @SerializedName(SERIALIZED_NAME_DESTROY) + @javax.annotation.Nullable + private Boolean destroy; + + /** + * Gets or Sets propertyFieldConditionType + */ + @JsonAdapter(PropertyFieldConditionTypeEnum.Adapter.class) + public enum PropertyFieldConditionTypeEnum { + IS_ONE_OF("is_one_of"), + + IS_NOT_ONE_OF("is_not_one_of"), + + CONTAINS("contains"), + + DOES_NOT_CONTAIN("does_not_contain"), + + STARTS_WITH("starts_with"), + + ENDS_WITH("ends_with"), + + MATCHES_REGEX("matches_regex"), + + IS_EMPTY("is_empty"); + + private String value; + + PropertyFieldConditionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PropertyFieldConditionTypeEnum fromValue(String value) { + for (PropertyFieldConditionTypeEnum b : PropertyFieldConditionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PropertyFieldConditionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PropertyFieldConditionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PropertyFieldConditionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PropertyFieldConditionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PROPERTY_FIELD_CONDITION_TYPE = "property_field_condition_type"; + @SerializedName(SERIALIZED_NAME_PROPERTY_FIELD_CONDITION_TYPE) + @javax.annotation.Nullable + private PropertyFieldConditionTypeEnum propertyFieldConditionType; + + public static final String SERIALIZED_NAME_PROPERTY_FIELD_NAME = "property_field_name"; + @SerializedName(SERIALIZED_NAME_PROPERTY_FIELD_NAME) + @javax.annotation.Nullable + private String propertyFieldName; + + /** + * Gets or Sets propertyFieldType + */ + @JsonAdapter(PropertyFieldTypeEnum.Adapter.class) + public enum PropertyFieldTypeEnum { + ATTRIBUTE("attribute"), + + PAYLOAD("payload"), + + ALERT_FIELD("alert_field"); + + private String value; + + PropertyFieldTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PropertyFieldTypeEnum fromValue(String value) { + for (PropertyFieldTypeEnum b : PropertyFieldTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PropertyFieldTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PropertyFieldTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PropertyFieldTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PropertyFieldTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PROPERTY_FIELD_TYPE = "property_field_type"; + @SerializedName(SERIALIZED_NAME_PROPERTY_FIELD_TYPE) + @javax.annotation.Nullable + private PropertyFieldTypeEnum propertyFieldType; + + public static final String SERIALIZED_NAME_PROPERTY_FIELD_VALUE = "property_field_value"; + @SerializedName(SERIALIZED_NAME_PROPERTY_FIELD_VALUE) + @javax.annotation.Nullable + private String propertyFieldValue; + + public static final String SERIALIZED_NAME_PROPERTY_FIELD_VALUES = "property_field_values"; + @SerializedName(SERIALIZED_NAME_PROPERTY_FIELD_VALUES) + @javax.annotation.Nullable + private List propertyFieldValues; + + public static final String SERIALIZED_NAME_ALERT_URGENCY_IDS = "alert_urgency_ids"; + @SerializedName(SERIALIZED_NAME_ALERT_URGENCY_IDS) + @javax.annotation.Nullable + private List alertUrgencyIds; + + /** + * The type of the conditionable + */ + @JsonAdapter(ConditionableTypeEnum.Adapter.class) + public enum ConditionableTypeEnum { + ALERT_FIELD("AlertField"); + + private String value; + + ConditionableTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConditionableTypeEnum fromValue(String value) { + for (ConditionableTypeEnum b : ConditionableTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConditionableTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConditionableTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConditionableTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConditionableTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONDITIONABLE_TYPE = "conditionable_type"; + @SerializedName(SERIALIZED_NAME_CONDITIONABLE_TYPE) + @javax.annotation.Nullable + private ConditionableTypeEnum conditionableType; + + public static final String SERIALIZED_NAME_CONDITIONABLE_ID = "conditionable_id"; + @SerializedName(SERIALIZED_NAME_CONDITIONABLE_ID) + @javax.annotation.Nullable + private UUID conditionableId; + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner() { + } + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner id(@javax.annotation.Nullable UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the condition. Required for updating or deleting existing conditions. + * @return id + */ + @javax.annotation.Nullable + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nullable UUID id) { + this.id = id; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner destroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + return this; + } + + /** + * Set to true to delete this condition + * @return destroy + */ + @javax.annotation.Nullable + public Boolean getDestroy() { + return destroy; + } + + public void setDestroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner propertyFieldConditionType(@javax.annotation.Nullable PropertyFieldConditionTypeEnum propertyFieldConditionType) { + this.propertyFieldConditionType = propertyFieldConditionType; + return this; + } + + /** + * Get propertyFieldConditionType + * @return propertyFieldConditionType + */ + @javax.annotation.Nullable + public PropertyFieldConditionTypeEnum getPropertyFieldConditionType() { + return propertyFieldConditionType; + } + + public void setPropertyFieldConditionType(@javax.annotation.Nullable PropertyFieldConditionTypeEnum propertyFieldConditionType) { + this.propertyFieldConditionType = propertyFieldConditionType; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner propertyFieldName(@javax.annotation.Nullable String propertyFieldName) { + this.propertyFieldName = propertyFieldName; + return this; + } + + /** + * The name of the property field + * @return propertyFieldName + */ + @javax.annotation.Nullable + public String getPropertyFieldName() { + return propertyFieldName; + } + + public void setPropertyFieldName(@javax.annotation.Nullable String propertyFieldName) { + this.propertyFieldName = propertyFieldName; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner propertyFieldType(@javax.annotation.Nullable PropertyFieldTypeEnum propertyFieldType) { + this.propertyFieldType = propertyFieldType; + return this; + } + + /** + * Get propertyFieldType + * @return propertyFieldType + */ + @javax.annotation.Nullable + public PropertyFieldTypeEnum getPropertyFieldType() { + return propertyFieldType; + } + + public void setPropertyFieldType(@javax.annotation.Nullable PropertyFieldTypeEnum propertyFieldType) { + this.propertyFieldType = propertyFieldType; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner propertyFieldValue(@javax.annotation.Nullable String propertyFieldValue) { + this.propertyFieldValue = propertyFieldValue; + return this; + } + + /** + * The value of the property field + * @return propertyFieldValue + */ + @javax.annotation.Nullable + public String getPropertyFieldValue() { + return propertyFieldValue; + } + + public void setPropertyFieldValue(@javax.annotation.Nullable String propertyFieldValue) { + this.propertyFieldValue = propertyFieldValue; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner propertyFieldValues(@javax.annotation.Nullable List propertyFieldValues) { + this.propertyFieldValues = propertyFieldValues; + return this; + } + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner addPropertyFieldValuesItem(String propertyFieldValuesItem) { + if (this.propertyFieldValues == null) { + this.propertyFieldValues = new ArrayList<>(); + } + this.propertyFieldValues.add(propertyFieldValuesItem); + return this; + } + + /** + * Get propertyFieldValues + * @return propertyFieldValues + */ + @javax.annotation.Nullable + public List getPropertyFieldValues() { + return propertyFieldValues; + } + + public void setPropertyFieldValues(@javax.annotation.Nullable List propertyFieldValues) { + this.propertyFieldValues = propertyFieldValues; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner alertUrgencyIds(@javax.annotation.Nullable List alertUrgencyIds) { + this.alertUrgencyIds = alertUrgencyIds; + return this; + } + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner addAlertUrgencyIdsItem(String alertUrgencyIdsItem) { + if (this.alertUrgencyIds == null) { + this.alertUrgencyIds = new ArrayList<>(); + } + this.alertUrgencyIds.add(alertUrgencyIdsItem); + return this; + } + + /** + * The Alert Urgency IDs to check in the condition + * @return alertUrgencyIds + */ + @javax.annotation.Nullable + public List getAlertUrgencyIds() { + return alertUrgencyIds; + } + + public void setAlertUrgencyIds(@javax.annotation.Nullable List alertUrgencyIds) { + this.alertUrgencyIds = alertUrgencyIds; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner conditionableType(@javax.annotation.Nullable ConditionableTypeEnum conditionableType) { + this.conditionableType = conditionableType; + return this; + } + + /** + * The type of the conditionable + * @return conditionableType + */ + @javax.annotation.Nullable + public ConditionableTypeEnum getConditionableType() { + return conditionableType; + } + + public void setConditionableType(@javax.annotation.Nullable ConditionableTypeEnum conditionableType) { + this.conditionableType = conditionableType; + } + + + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner conditionableId(@javax.annotation.Nullable UUID conditionableId) { + this.conditionableId = conditionableId; + return this; + } + + /** + * The ID of the conditionable + * @return conditionableId + */ + @javax.annotation.Nullable + public UUID getConditionableId() { + return conditionableId; + } + + public void setConditionableId(@javax.annotation.Nullable UUID conditionableId) { + this.conditionableId = conditionableId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner = (PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner) o; + return Objects.equals(this.id, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.id) && + Objects.equals(this.destroy, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.destroy) && + Objects.equals(this.propertyFieldConditionType, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.propertyFieldConditionType) && + Objects.equals(this.propertyFieldName, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.propertyFieldName) && + Objects.equals(this.propertyFieldType, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.propertyFieldType) && + Objects.equals(this.propertyFieldValue, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.propertyFieldValue) && + Objects.equals(this.propertyFieldValues, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.propertyFieldValues) && + Objects.equals(this.alertUrgencyIds, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.alertUrgencyIds) && + Objects.equals(this.conditionableType, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.conditionableType) && + Objects.equals(this.conditionableId, patchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.conditionableId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, destroy, propertyFieldConditionType, propertyFieldName, propertyFieldType, propertyFieldValue, propertyFieldValues, alertUrgencyIds, conditionableType, conditionableId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" destroy: ").append(toIndentedString(destroy)).append("\n"); + sb.append(" propertyFieldConditionType: ").append(toIndentedString(propertyFieldConditionType)).append("\n"); + sb.append(" propertyFieldName: ").append(toIndentedString(propertyFieldName)).append("\n"); + sb.append(" propertyFieldType: ").append(toIndentedString(propertyFieldType)).append("\n"); + sb.append(" propertyFieldValue: ").append(toIndentedString(propertyFieldValue)).append("\n"); + sb.append(" propertyFieldValues: ").append(toIndentedString(propertyFieldValues)).append("\n"); + sb.append(" alertUrgencyIds: ").append(toIndentedString(alertUrgencyIds)).append("\n"); + sb.append(" conditionableType: ").append(toIndentedString(conditionableType)).append("\n"); + sb.append(" conditionableId: ").append(toIndentedString(conditionableId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("_destroy"); + openapiFields.add("property_field_condition_type"); + openapiFields.add("property_field_name"); + openapiFields.add("property_field_type"); + openapiFields.add("property_field_value"); + openapiFields.add("property_field_values"); + openapiFields.add("alert_urgency_ids"); + openapiFields.add("conditionable_type"); + openapiFields.add("conditionable_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner is not found in the empty JSON string", PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("property_field_condition_type") != null && !jsonObj.get("property_field_condition_type").isJsonNull()) && !jsonObj.get("property_field_condition_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `property_field_condition_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property_field_condition_type").toString())); + } + // validate the optional field `property_field_condition_type` + if (jsonObj.get("property_field_condition_type") != null && !jsonObj.get("property_field_condition_type").isJsonNull()) { + PropertyFieldConditionTypeEnum.validateJsonElement(jsonObj.get("property_field_condition_type")); + } + if ((jsonObj.get("property_field_name") != null && !jsonObj.get("property_field_name").isJsonNull()) && !jsonObj.get("property_field_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `property_field_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property_field_name").toString())); + } + if ((jsonObj.get("property_field_type") != null && !jsonObj.get("property_field_type").isJsonNull()) && !jsonObj.get("property_field_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `property_field_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property_field_type").toString())); + } + // validate the optional field `property_field_type` + if (jsonObj.get("property_field_type") != null && !jsonObj.get("property_field_type").isJsonNull()) { + PropertyFieldTypeEnum.validateJsonElement(jsonObj.get("property_field_type")); + } + if ((jsonObj.get("property_field_value") != null && !jsonObj.get("property_field_value").isJsonNull()) && !jsonObj.get("property_field_value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `property_field_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property_field_value").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("property_field_values") != null && !jsonObj.get("property_field_values").isJsonNull() && !jsonObj.get("property_field_values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `property_field_values` to be an array in the JSON string but got `%s`", jsonObj.get("property_field_values").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("alert_urgency_ids") != null && !jsonObj.get("alert_urgency_ids").isJsonNull() && !jsonObj.get("alert_urgency_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `alert_urgency_ids` to be an array in the JSON string but got `%s`", jsonObj.get("alert_urgency_ids").toString())); + } + if ((jsonObj.get("conditionable_type") != null && !jsonObj.get("conditionable_type").isJsonNull()) && !jsonObj.get("conditionable_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `conditionable_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conditionable_type").toString())); + } + // validate the optional field `conditionable_type` + if (jsonObj.get("conditionable_type") != null && !jsonObj.get("conditionable_type").isJsonNull()) { + ConditionableTypeEnum.validateJsonElement(jsonObj.get("conditionable_type")); + } + if ((jsonObj.get("conditionable_id") != null && !jsonObj.get("conditionable_id").isJsonNull()) && !jsonObj.get("conditionable_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `conditionable_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conditionable_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + * @throws IOException if the JSON string is invalid with respect to PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + */ + public static PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner.class); + } + + /** + * Convert an instance of PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerDestinationsInner.java b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerDestinationsInner.java new file mode 100644 index 00000000..f102c584 --- /dev/null +++ b/src/main/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerDestinationsInner.java @@ -0,0 +1,354 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * PatchAlertRouteDataAttributesRulesInnerDestinationsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class PatchAlertRouteDataAttributesRulesInnerDestinationsInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private UUID id; + + public static final String SERIALIZED_NAME_DESTROY = "_destroy"; + @SerializedName(SERIALIZED_NAME_DESTROY) + @javax.annotation.Nullable + private Boolean destroy; + + /** + * The type of the target. Please contact support if you encounter issues using `Functionality` as a target type. + */ + @JsonAdapter(TargetTypeEnum.Adapter.class) + public enum TargetTypeEnum { + SERVICE("Service"), + + GROUP("Group"), + + FUNCTIONALITY("Functionality"), + + ESCALATION_POLICY("EscalationPolicy"); + + private String value; + + TargetTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TargetTypeEnum fromValue(String value) { + for (TargetTypeEnum b : TargetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TargetTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TargetTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TargetTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TargetTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TARGET_TYPE = "target_type"; + @SerializedName(SERIALIZED_NAME_TARGET_TYPE) + @javax.annotation.Nullable + private TargetTypeEnum targetType; + + public static final String SERIALIZED_NAME_TARGET_ID = "target_id"; + @SerializedName(SERIALIZED_NAME_TARGET_ID) + @javax.annotation.Nullable + private UUID targetId; + + public PatchAlertRouteDataAttributesRulesInnerDestinationsInner() { + } + + public PatchAlertRouteDataAttributesRulesInnerDestinationsInner id(@javax.annotation.Nullable UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the destination. Required for updating or deleting existing destinations. + * @return id + */ + @javax.annotation.Nullable + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nullable UUID id) { + this.id = id; + } + + + public PatchAlertRouteDataAttributesRulesInnerDestinationsInner destroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + return this; + } + + /** + * Set to true to delete this destination + * @return destroy + */ + @javax.annotation.Nullable + public Boolean getDestroy() { + return destroy; + } + + public void setDestroy(@javax.annotation.Nullable Boolean destroy) { + this.destroy = destroy; + } + + + public PatchAlertRouteDataAttributesRulesInnerDestinationsInner targetType(@javax.annotation.Nullable TargetTypeEnum targetType) { + this.targetType = targetType; + return this; + } + + /** + * The type of the target. Please contact support if you encounter issues using `Functionality` as a target type. + * @return targetType + */ + @javax.annotation.Nullable + public TargetTypeEnum getTargetType() { + return targetType; + } + + public void setTargetType(@javax.annotation.Nullable TargetTypeEnum targetType) { + this.targetType = targetType; + } + + + public PatchAlertRouteDataAttributesRulesInnerDestinationsInner targetId(@javax.annotation.Nullable UUID targetId) { + this.targetId = targetId; + return this; + } + + /** + * The ID of the target + * @return targetId + */ + @javax.annotation.Nullable + public UUID getTargetId() { + return targetId; + } + + public void setTargetId(@javax.annotation.Nullable UUID targetId) { + this.targetId = targetId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchAlertRouteDataAttributesRulesInnerDestinationsInner patchAlertRouteDataAttributesRulesInnerDestinationsInner = (PatchAlertRouteDataAttributesRulesInnerDestinationsInner) o; + return Objects.equals(this.id, patchAlertRouteDataAttributesRulesInnerDestinationsInner.id) && + Objects.equals(this.destroy, patchAlertRouteDataAttributesRulesInnerDestinationsInner.destroy) && + Objects.equals(this.targetType, patchAlertRouteDataAttributesRulesInnerDestinationsInner.targetType) && + Objects.equals(this.targetId, patchAlertRouteDataAttributesRulesInnerDestinationsInner.targetId); + } + + @Override + public int hashCode() { + return Objects.hash(id, destroy, targetType, targetId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchAlertRouteDataAttributesRulesInnerDestinationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" destroy: ").append(toIndentedString(destroy)).append("\n"); + sb.append(" targetType: ").append(toIndentedString(targetType)).append("\n"); + sb.append(" targetId: ").append(toIndentedString(targetId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("_destroy"); + openapiFields.add("target_type"); + openapiFields.add("target_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to PatchAlertRouteDataAttributesRulesInnerDestinationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PatchAlertRouteDataAttributesRulesInnerDestinationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PatchAlertRouteDataAttributesRulesInnerDestinationsInner is not found in the empty JSON string", PatchAlertRouteDataAttributesRulesInnerDestinationsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!PatchAlertRouteDataAttributesRulesInnerDestinationsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PatchAlertRouteDataAttributesRulesInnerDestinationsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("target_type") != null && !jsonObj.get("target_type").isJsonNull()) && !jsonObj.get("target_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `target_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target_type").toString())); + } + // validate the optional field `target_type` + if (jsonObj.get("target_type") != null && !jsonObj.get("target_type").isJsonNull()) { + TargetTypeEnum.validateJsonElement(jsonObj.get("target_type")); + } + if ((jsonObj.get("target_id") != null && !jsonObj.get("target_id").isJsonNull()) && !jsonObj.get("target_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `target_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("target_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PatchAlertRouteDataAttributesRulesInnerDestinationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PatchAlertRouteDataAttributesRulesInnerDestinationsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PatchAlertRouteDataAttributesRulesInnerDestinationsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PatchAlertRouteDataAttributesRulesInnerDestinationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PatchAlertRouteDataAttributesRulesInnerDestinationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PatchAlertRouteDataAttributesRulesInnerDestinationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PatchAlertRouteDataAttributesRulesInnerDestinationsInner + * @throws IOException if the JSON string is invalid with respect to PatchAlertRouteDataAttributesRulesInnerDestinationsInner + */ + public static PatchAlertRouteDataAttributesRulesInnerDestinationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PatchAlertRouteDataAttributesRulesInnerDestinationsInner.class); + } + + /** + * Convert an instance of PatchAlertRouteDataAttributesRulesInnerDestinationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/RotateApiKey.java b/src/main/java/com/rootly/client/model/RotateApiKey.java new file mode 100644 index 00000000..dad9f059 --- /dev/null +++ b/src/main/java/com/rootly/client/model/RotateApiKey.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.RotateApiKeyData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * RotateApiKey + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class RotateApiKey { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private RotateApiKeyData data; + + public RotateApiKey() { + } + + public RotateApiKey data(@javax.annotation.Nonnull RotateApiKeyData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public RotateApiKeyData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull RotateApiKeyData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RotateApiKey rotateApiKey = (RotateApiKey) o; + return Objects.equals(this.data, rotateApiKey.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RotateApiKey {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RotateApiKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RotateApiKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RotateApiKey is not found in the empty JSON string", RotateApiKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RotateApiKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RotateApiKey` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RotateApiKey.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + RotateApiKeyData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RotateApiKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RotateApiKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RotateApiKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RotateApiKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RotateApiKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RotateApiKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of RotateApiKey + * @throws IOException if the JSON string is invalid with respect to RotateApiKey + */ + public static RotateApiKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RotateApiKey.class); + } + + /** + * Convert an instance of RotateApiKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/RotateApiKeyData.java b/src/main/java/com/rootly/client/model/RotateApiKeyData.java new file mode 100644 index 00000000..5c48edc5 --- /dev/null +++ b/src/main/java/com/rootly/client/model/RotateApiKeyData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.RotateApiKeyDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * RotateApiKeyData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class RotateApiKeyData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + API_KEYS("api_keys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private RotateApiKeyDataAttributes attributes; + + public RotateApiKeyData() { + } + + public RotateApiKeyData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public RotateApiKeyData attributes(@javax.annotation.Nonnull RotateApiKeyDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public RotateApiKeyDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull RotateApiKeyDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RotateApiKeyData rotateApiKeyData = (RotateApiKeyData) o; + return Objects.equals(this.type, rotateApiKeyData.type) && + Objects.equals(this.attributes, rotateApiKeyData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RotateApiKeyData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RotateApiKeyData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RotateApiKeyData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RotateApiKeyData is not found in the empty JSON string", RotateApiKeyData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RotateApiKeyData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RotateApiKeyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RotateApiKeyData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + RotateApiKeyDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RotateApiKeyData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RotateApiKeyData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RotateApiKeyData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RotateApiKeyData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RotateApiKeyData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RotateApiKeyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RotateApiKeyData + * @throws IOException if the JSON string is invalid with respect to RotateApiKeyData + */ + public static RotateApiKeyData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RotateApiKeyData.class); + } + + /** + * Convert an instance of RotateApiKeyData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/RotateApiKeyDataAttributes.java b/src/main/java/com/rootly/client/model/RotateApiKeyDataAttributes.java new file mode 100644 index 00000000..3de1bcf9 --- /dev/null +++ b/src/main/java/com/rootly/client/model/RotateApiKeyDataAttributes.java @@ -0,0 +1,245 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * RotateApiKeyDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class RotateApiKeyDataAttributes { + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nullable + private OffsetDateTime expiresAt; + + public static final String SERIALIZED_NAME_GRACE_PERIOD_MINUTES = "grace_period_minutes"; + @SerializedName(SERIALIZED_NAME_GRACE_PERIOD_MINUTES) + @javax.annotation.Nullable + private Integer gracePeriodMinutes = 30; + + public RotateApiKeyDataAttributes() { + } + + public RotateApiKeyDataAttributes expiresAt(@javax.annotation.Nullable OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The new expiration date after rotation (ISO 8601) + * @return expiresAt + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nullable OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + + public RotateApiKeyDataAttributes gracePeriodMinutes(@javax.annotation.Nullable Integer gracePeriodMinutes) { + this.gracePeriodMinutes = gracePeriodMinutes; + return this; + } + + /** + * How many minutes to keep the old token valid. Only applies when the grace period feature is enabled for your organization. Defaults to 30. + * minimum: 0 + * maximum: 1440 + * @return gracePeriodMinutes + */ + @javax.annotation.Nullable + public Integer getGracePeriodMinutes() { + return gracePeriodMinutes; + } + + public void setGracePeriodMinutes(@javax.annotation.Nullable Integer gracePeriodMinutes) { + this.gracePeriodMinutes = gracePeriodMinutes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RotateApiKeyDataAttributes rotateApiKeyDataAttributes = (RotateApiKeyDataAttributes) o; + return Objects.equals(this.expiresAt, rotateApiKeyDataAttributes.expiresAt) && + Objects.equals(this.gracePeriodMinutes, rotateApiKeyDataAttributes.gracePeriodMinutes); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(expiresAt, gracePeriodMinutes); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RotateApiKeyDataAttributes {\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" gracePeriodMinutes: ").append(toIndentedString(gracePeriodMinutes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("expires_at"); + openapiFields.add("grace_period_minutes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to RotateApiKeyDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RotateApiKeyDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RotateApiKeyDataAttributes is not found in the empty JSON string", RotateApiKeyDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!RotateApiKeyDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RotateApiKeyDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RotateApiKeyDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RotateApiKeyDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RotateApiKeyDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RotateApiKeyDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RotateApiKeyDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RotateApiKeyDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of RotateApiKeyDataAttributes + * @throws IOException if the JSON string is invalid with respect to RotateApiKeyDataAttributes + */ + public static RotateApiKeyDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RotateApiKeyDataAttributes.class); + } + + /** + * Convert an instance of RotateApiKeyDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SendMicrosoftTeamsChatMessageTaskParams.java b/src/main/java/com/rootly/client/model/SendMicrosoftTeamsChatMessageTaskParams.java new file mode 100644 index 00000000..9842578f --- /dev/null +++ b/src/main/java/com/rootly/client/model/SendMicrosoftTeamsChatMessageTaskParams.java @@ -0,0 +1,347 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SendMicrosoftTeamsChatMessageTaskParams + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SendMicrosoftTeamsChatMessageTaskParams { + /** + * Gets or Sets taskType + */ + @JsonAdapter(TaskTypeEnum.Adapter.class) + public enum TaskTypeEnum { + SEND_MICROSOFT_TEAMS_CHAT_MESSAGE("send_microsoft_teams_chat_message"); + + private String value; + + TaskTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TaskTypeEnum fromValue(String value) { + for (TaskTypeEnum b : TaskTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TaskTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TaskTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TaskTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TaskTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TASK_TYPE = "task_type"; + @SerializedName(SERIALIZED_NAME_TASK_TYPE) + @javax.annotation.Nullable + private TaskTypeEnum taskType; + + public static final String SERIALIZED_NAME_CHATS = "chats"; + @SerializedName(SERIALIZED_NAME_CHATS) + @javax.annotation.Nonnull + private List chats = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nonnull + private String text; + + public SendMicrosoftTeamsChatMessageTaskParams() { + } + + public SendMicrosoftTeamsChatMessageTaskParams taskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + return this; + } + + /** + * Get taskType + * @return taskType + */ + @javax.annotation.Nullable + public TaskTypeEnum getTaskType() { + return taskType; + } + + public void setTaskType(@javax.annotation.Nullable TaskTypeEnum taskType) { + this.taskType = taskType; + } + + + public SendMicrosoftTeamsChatMessageTaskParams chats(@javax.annotation.Nonnull List chats) { + this.chats = chats; + return this; + } + + public SendMicrosoftTeamsChatMessageTaskParams addChatsItem(AddActionItemTaskParamsPostToSlackChannelsInner chatsItem) { + if (this.chats == null) { + this.chats = new ArrayList<>(); + } + this.chats.add(chatsItem); + return this; + } + + /** + * Get chats + * @return chats + */ + @javax.annotation.Nonnull + public List getChats() { + return chats; + } + + public void setChats(@javax.annotation.Nonnull List chats) { + this.chats = chats; + } + + + public SendMicrosoftTeamsChatMessageTaskParams text(@javax.annotation.Nonnull String text) { + this.text = text; + return this; + } + + /** + * The message text + * @return text + */ + @javax.annotation.Nonnull + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nonnull String text) { + this.text = text; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendMicrosoftTeamsChatMessageTaskParams sendMicrosoftTeamsChatMessageTaskParams = (SendMicrosoftTeamsChatMessageTaskParams) o; + return Objects.equals(this.taskType, sendMicrosoftTeamsChatMessageTaskParams.taskType) && + Objects.equals(this.chats, sendMicrosoftTeamsChatMessageTaskParams.chats) && + Objects.equals(this.text, sendMicrosoftTeamsChatMessageTaskParams.text); + } + + @Override + public int hashCode() { + return Objects.hash(taskType, chats, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendMicrosoftTeamsChatMessageTaskParams {\n"); + sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n"); + sb.append(" chats: ").append(toIndentedString(chats)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("task_type"); + openapiFields.add("chats"); + openapiFields.add("text"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("chats"); + openapiRequiredFields.add("text"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SendMicrosoftTeamsChatMessageTaskParams + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SendMicrosoftTeamsChatMessageTaskParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SendMicrosoftTeamsChatMessageTaskParams is not found in the empty JSON string", SendMicrosoftTeamsChatMessageTaskParams.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SendMicrosoftTeamsChatMessageTaskParams.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SendMicrosoftTeamsChatMessageTaskParams` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SendMicrosoftTeamsChatMessageTaskParams.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) && !jsonObj.get("task_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `task_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_type").toString())); + } + // validate the optional field `task_type` + if (jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) { + TaskTypeEnum.validateJsonElement(jsonObj.get("task_type")); + } + // ensure the json data is an array + if (!jsonObj.get("chats").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `chats` to be an array in the JSON string but got `%s`", jsonObj.get("chats").toString())); + } + + JsonArray jsonArraychats = jsonObj.getAsJsonArray("chats"); + // validate the required field `chats` (array) + for (int i = 0; i < jsonArraychats.size(); i++) { + AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArraychats.get(i)); + }; + if (!jsonObj.get("text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SendMicrosoftTeamsChatMessageTaskParams.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SendMicrosoftTeamsChatMessageTaskParams' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SendMicrosoftTeamsChatMessageTaskParams.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SendMicrosoftTeamsChatMessageTaskParams value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SendMicrosoftTeamsChatMessageTaskParams read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SendMicrosoftTeamsChatMessageTaskParams given an JSON string + * + * @param jsonString JSON string + * @return An instance of SendMicrosoftTeamsChatMessageTaskParams + * @throws IOException if the JSON string is invalid with respect to SendMicrosoftTeamsChatMessageTaskParams + */ + public static SendMicrosoftTeamsChatMessageTaskParams fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SendMicrosoftTeamsChatMessageTaskParams.class); + } + + /** + * Convert an instance of SendMicrosoftTeamsChatMessageTaskParams to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/Sla.java b/src/main/java/com/rootly/client/model/Sla.java new file mode 100644 index 00000000..8e003290 --- /dev/null +++ b/src/main/java/com/rootly/client/model/Sla.java @@ -0,0 +1,936 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SlaConditionsInner; +import com.rootly.client.model.SlaNotificationConfigurationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * Sla + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class Sla { + public static final String SERIALIZED_NAME_SLUG = "slug"; + @SerializedName(SERIALIZED_NAME_SLUG) + @javax.annotation.Nullable + private String slug; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + /** + * The entity type this SLA applies to + */ + @JsonAdapter(EntityTypeEnum.Adapter.class) + public enum EntityTypeEnum { + FOLLOW_UP("follow_up"); + + private String value; + + EntityTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EntityTypeEnum fromValue(String value) { + for (EntityTypeEnum b : EntityTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EntityTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EntityTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EntityTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EntityTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENTITY_TYPE = "entity_type"; + @SerializedName(SERIALIZED_NAME_ENTITY_TYPE) + @javax.annotation.Nullable + private EntityTypeEnum entityType; + + /** + * Whether all or any conditions must match + */ + @JsonAdapter(ConditionMatchTypeEnum.Adapter.class) + public enum ConditionMatchTypeEnum { + ALL("ALL"), + + ANY("ANY"); + + private String value; + + ConditionMatchTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConditionMatchTypeEnum fromValue(String value) { + for (ConditionMatchTypeEnum b : ConditionMatchTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConditionMatchTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConditionMatchTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConditionMatchTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConditionMatchTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONDITION_MATCH_TYPE = "condition_match_type"; + @SerializedName(SERIALIZED_NAME_CONDITION_MATCH_TYPE) + @javax.annotation.Nonnull + private ConditionMatchTypeEnum conditionMatchType; + + public static final String SERIALIZED_NAME_MANAGER_ROLE_ID = "manager_role_id"; + @SerializedName(SERIALIZED_NAME_MANAGER_ROLE_ID) + @javax.annotation.Nullable + private UUID managerRoleId; + + public static final String SERIALIZED_NAME_MANAGER_USER_ID = "manager_user_id"; + @SerializedName(SERIALIZED_NAME_MANAGER_USER_ID) + @javax.annotation.Nullable + private Integer managerUserId; + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_DAYS = "assignment_deadline_days"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_DAYS) + @javax.annotation.Nonnull + private Integer assignmentDeadlineDays; + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_PARENT_STATUS = "assignment_deadline_parent_status"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_PARENT_STATUS) + @javax.annotation.Nonnull + private String assignmentDeadlineParentStatus; + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_SUB_STATUS_ID = "assignment_deadline_sub_status_id"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_SUB_STATUS_ID) + @javax.annotation.Nullable + private UUID assignmentDeadlineSubStatusId; + + public static final String SERIALIZED_NAME_ASSIGNMENT_SKIP_WEEKENDS = "assignment_skip_weekends"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_SKIP_WEEKENDS) + @javax.annotation.Nullable + private Boolean assignmentSkipWeekends; + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_DAYS = "completion_deadline_days"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_DAYS) + @javax.annotation.Nonnull + private Integer completionDeadlineDays; + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_PARENT_STATUS = "completion_deadline_parent_status"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_PARENT_STATUS) + @javax.annotation.Nonnull + private String completionDeadlineParentStatus; + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_SUB_STATUS_ID = "completion_deadline_sub_status_id"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_SUB_STATUS_ID) + @javax.annotation.Nullable + private UUID completionDeadlineSubStatusId; + + public static final String SERIALIZED_NAME_COMPLETION_SKIP_WEEKENDS = "completion_skip_weekends"; + @SerializedName(SERIALIZED_NAME_COMPLETION_SKIP_WEEKENDS) + @javax.annotation.Nullable + private Boolean completionSkipWeekends; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + @javax.annotation.Nullable + private List conditions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOTIFICATION_CONFIGURATIONS = "notification_configurations"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_CONFIGURATIONS) + @javax.annotation.Nullable + private List notificationConfigurations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nonnull + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nonnull + private String updatedAt; + + public Sla() { + } + + public Sla slug(@javax.annotation.Nullable String slug) { + this.slug = slug; + return this; + } + + /** + * The slug of the SLA + * @return slug + */ + @javax.annotation.Nullable + public String getSlug() { + return slug; + } + + public void setSlug(@javax.annotation.Nullable String slug) { + this.slug = slug; + } + + + public Sla name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the SLA + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Sla description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the SLA + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Sla position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Position of the SLA for ordering + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public Sla entityType(@javax.annotation.Nullable EntityTypeEnum entityType) { + this.entityType = entityType; + return this; + } + + /** + * The entity type this SLA applies to + * @return entityType + */ + @javax.annotation.Nullable + public EntityTypeEnum getEntityType() { + return entityType; + } + + public void setEntityType(@javax.annotation.Nullable EntityTypeEnum entityType) { + this.entityType = entityType; + } + + + public Sla conditionMatchType(@javax.annotation.Nonnull ConditionMatchTypeEnum conditionMatchType) { + this.conditionMatchType = conditionMatchType; + return this; + } + + /** + * Whether all or any conditions must match + * @return conditionMatchType + */ + @javax.annotation.Nonnull + public ConditionMatchTypeEnum getConditionMatchType() { + return conditionMatchType; + } + + public void setConditionMatchType(@javax.annotation.Nonnull ConditionMatchTypeEnum conditionMatchType) { + this.conditionMatchType = conditionMatchType; + } + + + public Sla managerRoleId(@javax.annotation.Nullable UUID managerRoleId) { + this.managerRoleId = managerRoleId; + return this; + } + + /** + * The ID of the manager incident role. Exactly one of `manager_role_id` or `manager_user_id` must be provided. + * @return managerRoleId + */ + @javax.annotation.Nullable + public UUID getManagerRoleId() { + return managerRoleId; + } + + public void setManagerRoleId(@javax.annotation.Nullable UUID managerRoleId) { + this.managerRoleId = managerRoleId; + } + + + public Sla managerUserId(@javax.annotation.Nullable Integer managerUserId) { + this.managerUserId = managerUserId; + return this; + } + + /** + * The ID of the manager user. Exactly one of `manager_role_id` or `manager_user_id` must be provided. + * @return managerUserId + */ + @javax.annotation.Nullable + public Integer getManagerUserId() { + return managerUserId; + } + + public void setManagerUserId(@javax.annotation.Nullable Integer managerUserId) { + this.managerUserId = managerUserId; + } + + + public Sla assignmentDeadlineDays(@javax.annotation.Nonnull Integer assignmentDeadlineDays) { + this.assignmentDeadlineDays = assignmentDeadlineDays; + return this; + } + + /** + * Number of days for the assignment deadline + * @return assignmentDeadlineDays + */ + @javax.annotation.Nonnull + public Integer getAssignmentDeadlineDays() { + return assignmentDeadlineDays; + } + + public void setAssignmentDeadlineDays(@javax.annotation.Nonnull Integer assignmentDeadlineDays) { + this.assignmentDeadlineDays = assignmentDeadlineDays; + } + + + public Sla assignmentDeadlineParentStatus(@javax.annotation.Nonnull String assignmentDeadlineParentStatus) { + this.assignmentDeadlineParentStatus = assignmentDeadlineParentStatus; + return this; + } + + /** + * The incident parent status that triggers the assignment deadline + * @return assignmentDeadlineParentStatus + */ + @javax.annotation.Nonnull + public String getAssignmentDeadlineParentStatus() { + return assignmentDeadlineParentStatus; + } + + public void setAssignmentDeadlineParentStatus(@javax.annotation.Nonnull String assignmentDeadlineParentStatus) { + this.assignmentDeadlineParentStatus = assignmentDeadlineParentStatus; + } + + + public Sla assignmentDeadlineSubStatusId(@javax.annotation.Nullable UUID assignmentDeadlineSubStatusId) { + this.assignmentDeadlineSubStatusId = assignmentDeadlineSubStatusId; + return this; + } + + /** + * Sub-status for the assignment deadline. Required when custom lifecycle statuses are enabled on the team. + * @return assignmentDeadlineSubStatusId + */ + @javax.annotation.Nullable + public UUID getAssignmentDeadlineSubStatusId() { + return assignmentDeadlineSubStatusId; + } + + public void setAssignmentDeadlineSubStatusId(@javax.annotation.Nullable UUID assignmentDeadlineSubStatusId) { + this.assignmentDeadlineSubStatusId = assignmentDeadlineSubStatusId; + } + + + public Sla assignmentSkipWeekends(@javax.annotation.Nullable Boolean assignmentSkipWeekends) { + this.assignmentSkipWeekends = assignmentSkipWeekends; + return this; + } + + /** + * Whether to skip weekends when calculating the assignment deadline + * @return assignmentSkipWeekends + */ + @javax.annotation.Nullable + public Boolean getAssignmentSkipWeekends() { + return assignmentSkipWeekends; + } + + public void setAssignmentSkipWeekends(@javax.annotation.Nullable Boolean assignmentSkipWeekends) { + this.assignmentSkipWeekends = assignmentSkipWeekends; + } + + + public Sla completionDeadlineDays(@javax.annotation.Nonnull Integer completionDeadlineDays) { + this.completionDeadlineDays = completionDeadlineDays; + return this; + } + + /** + * Number of days for the completion deadline + * @return completionDeadlineDays + */ + @javax.annotation.Nonnull + public Integer getCompletionDeadlineDays() { + return completionDeadlineDays; + } + + public void setCompletionDeadlineDays(@javax.annotation.Nonnull Integer completionDeadlineDays) { + this.completionDeadlineDays = completionDeadlineDays; + } + + + public Sla completionDeadlineParentStatus(@javax.annotation.Nonnull String completionDeadlineParentStatus) { + this.completionDeadlineParentStatus = completionDeadlineParentStatus; + return this; + } + + /** + * The incident parent status that triggers the completion deadline + * @return completionDeadlineParentStatus + */ + @javax.annotation.Nonnull + public String getCompletionDeadlineParentStatus() { + return completionDeadlineParentStatus; + } + + public void setCompletionDeadlineParentStatus(@javax.annotation.Nonnull String completionDeadlineParentStatus) { + this.completionDeadlineParentStatus = completionDeadlineParentStatus; + } + + + public Sla completionDeadlineSubStatusId(@javax.annotation.Nullable UUID completionDeadlineSubStatusId) { + this.completionDeadlineSubStatusId = completionDeadlineSubStatusId; + return this; + } + + /** + * Sub-status for the completion deadline. Required when custom lifecycle statuses are enabled on the team. + * @return completionDeadlineSubStatusId + */ + @javax.annotation.Nullable + public UUID getCompletionDeadlineSubStatusId() { + return completionDeadlineSubStatusId; + } + + public void setCompletionDeadlineSubStatusId(@javax.annotation.Nullable UUID completionDeadlineSubStatusId) { + this.completionDeadlineSubStatusId = completionDeadlineSubStatusId; + } + + + public Sla completionSkipWeekends(@javax.annotation.Nullable Boolean completionSkipWeekends) { + this.completionSkipWeekends = completionSkipWeekends; + return this; + } + + /** + * Whether to skip weekends when calculating the completion deadline + * @return completionSkipWeekends + */ + @javax.annotation.Nullable + public Boolean getCompletionSkipWeekends() { + return completionSkipWeekends; + } + + public void setCompletionSkipWeekends(@javax.annotation.Nullable Boolean completionSkipWeekends) { + this.completionSkipWeekends = completionSkipWeekends; + } + + + public Sla conditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + return this; + } + + public Sla addConditionsItem(SlaConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Conditions that determine which incidents this SLA applies to + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + } + + + public Sla notificationConfigurations(@javax.annotation.Nullable List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + return this; + } + + public Sla addNotificationConfigurationsItem(SlaNotificationConfigurationsInner notificationConfigurationsItem) { + if (this.notificationConfigurations == null) { + this.notificationConfigurations = new ArrayList<>(); + } + this.notificationConfigurations.add(notificationConfigurationsItem); + return this; + } + + /** + * Notification timing configurations + * @return notificationConfigurations + */ + @javax.annotation.Nullable + public List getNotificationConfigurations() { + return notificationConfigurations; + } + + public void setNotificationConfigurations(@javax.annotation.Nullable List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + } + + + public Sla createdAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nonnull + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nonnull String createdAt) { + this.createdAt = createdAt; + } + + + public Sla updatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nonnull + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Sla sla = (Sla) o; + return Objects.equals(this.slug, sla.slug) && + Objects.equals(this.name, sla.name) && + Objects.equals(this.description, sla.description) && + Objects.equals(this.position, sla.position) && + Objects.equals(this.entityType, sla.entityType) && + Objects.equals(this.conditionMatchType, sla.conditionMatchType) && + Objects.equals(this.managerRoleId, sla.managerRoleId) && + Objects.equals(this.managerUserId, sla.managerUserId) && + Objects.equals(this.assignmentDeadlineDays, sla.assignmentDeadlineDays) && + Objects.equals(this.assignmentDeadlineParentStatus, sla.assignmentDeadlineParentStatus) && + Objects.equals(this.assignmentDeadlineSubStatusId, sla.assignmentDeadlineSubStatusId) && + Objects.equals(this.assignmentSkipWeekends, sla.assignmentSkipWeekends) && + Objects.equals(this.completionDeadlineDays, sla.completionDeadlineDays) && + Objects.equals(this.completionDeadlineParentStatus, sla.completionDeadlineParentStatus) && + Objects.equals(this.completionDeadlineSubStatusId, sla.completionDeadlineSubStatusId) && + Objects.equals(this.completionSkipWeekends, sla.completionSkipWeekends) && + Objects.equals(this.conditions, sla.conditions) && + Objects.equals(this.notificationConfigurations, sla.notificationConfigurations) && + Objects.equals(this.createdAt, sla.createdAt) && + Objects.equals(this.updatedAt, sla.updatedAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(slug, name, description, position, entityType, conditionMatchType, managerRoleId, managerUserId, assignmentDeadlineDays, assignmentDeadlineParentStatus, assignmentDeadlineSubStatusId, assignmentSkipWeekends, completionDeadlineDays, completionDeadlineParentStatus, completionDeadlineSubStatusId, completionSkipWeekends, conditions, notificationConfigurations, createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Sla {\n"); + sb.append(" slug: ").append(toIndentedString(slug)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" entityType: ").append(toIndentedString(entityType)).append("\n"); + sb.append(" conditionMatchType: ").append(toIndentedString(conditionMatchType)).append("\n"); + sb.append(" managerRoleId: ").append(toIndentedString(managerRoleId)).append("\n"); + sb.append(" managerUserId: ").append(toIndentedString(managerUserId)).append("\n"); + sb.append(" assignmentDeadlineDays: ").append(toIndentedString(assignmentDeadlineDays)).append("\n"); + sb.append(" assignmentDeadlineParentStatus: ").append(toIndentedString(assignmentDeadlineParentStatus)).append("\n"); + sb.append(" assignmentDeadlineSubStatusId: ").append(toIndentedString(assignmentDeadlineSubStatusId)).append("\n"); + sb.append(" assignmentSkipWeekends: ").append(toIndentedString(assignmentSkipWeekends)).append("\n"); + sb.append(" completionDeadlineDays: ").append(toIndentedString(completionDeadlineDays)).append("\n"); + sb.append(" completionDeadlineParentStatus: ").append(toIndentedString(completionDeadlineParentStatus)).append("\n"); + sb.append(" completionDeadlineSubStatusId: ").append(toIndentedString(completionDeadlineSubStatusId)).append("\n"); + sb.append(" completionSkipWeekends: ").append(toIndentedString(completionSkipWeekends)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" notificationConfigurations: ").append(toIndentedString(notificationConfigurations)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("slug"); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("position"); + openapiFields.add("entity_type"); + openapiFields.add("condition_match_type"); + openapiFields.add("manager_role_id"); + openapiFields.add("manager_user_id"); + openapiFields.add("assignment_deadline_days"); + openapiFields.add("assignment_deadline_parent_status"); + openapiFields.add("assignment_deadline_sub_status_id"); + openapiFields.add("assignment_skip_weekends"); + openapiFields.add("completion_deadline_days"); + openapiFields.add("completion_deadline_parent_status"); + openapiFields.add("completion_deadline_sub_status_id"); + openapiFields.add("completion_skip_weekends"); + openapiFields.add("conditions"); + openapiFields.add("notification_configurations"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("condition_match_type"); + openapiRequiredFields.add("assignment_deadline_days"); + openapiRequiredFields.add("assignment_deadline_parent_status"); + openapiRequiredFields.add("completion_deadline_days"); + openapiRequiredFields.add("completion_deadline_parent_status"); + openapiRequiredFields.add("created_at"); + openapiRequiredFields.add("updated_at"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to Sla + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Sla.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Sla is not found in the empty JSON string", Sla.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!Sla.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Sla` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Sla.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("slug") != null && !jsonObj.get("slug").isJsonNull()) && !jsonObj.get("slug").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `slug` to be a primitive type in the JSON string but got `%s`", jsonObj.get("slug").toString())); + } + if (!jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("entity_type") != null && !jsonObj.get("entity_type").isJsonNull()) && !jsonObj.get("entity_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entity_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity_type").toString())); + } + // validate the optional field `entity_type` + if (jsonObj.get("entity_type") != null && !jsonObj.get("entity_type").isJsonNull()) { + EntityTypeEnum.validateJsonElement(jsonObj.get("entity_type")); + } + if (!jsonObj.get("condition_match_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `condition_match_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("condition_match_type").toString())); + } + // validate the required field `condition_match_type` + ConditionMatchTypeEnum.validateJsonElement(jsonObj.get("condition_match_type")); + if ((jsonObj.get("manager_role_id") != null && !jsonObj.get("manager_role_id").isJsonNull()) && !jsonObj.get("manager_role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `manager_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manager_role_id").toString())); + } + if (!jsonObj.get("assignment_deadline_parent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assignment_deadline_parent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assignment_deadline_parent_status").toString())); + } + if ((jsonObj.get("assignment_deadline_sub_status_id") != null && !jsonObj.get("assignment_deadline_sub_status_id").isJsonNull()) && !jsonObj.get("assignment_deadline_sub_status_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assignment_deadline_sub_status_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assignment_deadline_sub_status_id").toString())); + } + if (!jsonObj.get("completion_deadline_parent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completion_deadline_parent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completion_deadline_parent_status").toString())); + } + if ((jsonObj.get("completion_deadline_sub_status_id") != null && !jsonObj.get("completion_deadline_sub_status_id").isJsonNull()) && !jsonObj.get("completion_deadline_sub_status_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completion_deadline_sub_status_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completion_deadline_sub_status_id").toString())); + } + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + SlaConditionsInner.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + if (jsonObj.get("notification_configurations") != null && !jsonObj.get("notification_configurations").isJsonNull()) { + JsonArray jsonArraynotificationConfigurations = jsonObj.getAsJsonArray("notification_configurations"); + if (jsonArraynotificationConfigurations != null) { + // ensure the json data is an array + if (!jsonObj.get("notification_configurations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_configurations` to be an array in the JSON string but got `%s`", jsonObj.get("notification_configurations").toString())); + } + + // validate the optional field `notification_configurations` (array) + for (int i = 0; i < jsonArraynotificationConfigurations.size(); i++) { + SlaNotificationConfigurationsInner.validateJsonElement(jsonArraynotificationConfigurations.get(i)); + }; + } + } + if (!jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if (!jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Sla.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Sla' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Sla.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Sla value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Sla read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Sla given an JSON string + * + * @param jsonString JSON string + * @return An instance of Sla + * @throws IOException if the JSON string is invalid with respect to Sla + */ + public static Sla fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Sla.class); + } + + /** + * Convert an instance of Sla to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SlaConditionsInner.java b/src/main/java/com/rootly/client/model/SlaConditionsInner.java new file mode 100644 index 00000000..2ea01356 --- /dev/null +++ b/src/main/java/com/rootly/client/model/SlaConditionsInner.java @@ -0,0 +1,463 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SlaConditionsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SlaConditionsInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private UUID id; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + /** + * The type of condition + */ + @JsonAdapter(ConditionableTypeEnum.Adapter.class) + public enum ConditionableTypeEnum { + SLAS_BUILT_IN_FIELD_CONDITION("SLAs::BuiltInFieldCondition"), + + SLAS_CUSTOM_FIELD_CONDITION("SLAs::CustomFieldCondition"); + + private String value; + + ConditionableTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConditionableTypeEnum fromValue(String value) { + for (ConditionableTypeEnum b : ConditionableTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConditionableTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConditionableTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConditionableTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConditionableTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONDITIONABLE_TYPE = "conditionable_type"; + @SerializedName(SERIALIZED_NAME_CONDITIONABLE_TYPE) + @javax.annotation.Nullable + private ConditionableTypeEnum conditionableType; + + public static final String SERIALIZED_NAME_PROPERTY = "property"; + @SerializedName(SERIALIZED_NAME_PROPERTY) + @javax.annotation.Nullable + private String property; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nullable + private String operator; + + public static final String SERIALIZED_NAME_VALUES = "values"; + @SerializedName(SERIALIZED_NAME_VALUES) + @javax.annotation.Nullable + private List values; + + public static final String SERIALIZED_NAME_FORM_FIELD_ID = "form_field_id"; + @SerializedName(SERIALIZED_NAME_FORM_FIELD_ID) + @javax.annotation.Nullable + private UUID formFieldId; + + public SlaConditionsInner() { + } + + public SlaConditionsInner id(@javax.annotation.Nullable UUID id) { + this.id = id; + return this; + } + + /** + * Unique ID of the condition + * @return id + */ + @javax.annotation.Nullable + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nullable UUID id) { + this.id = id; + } + + + public SlaConditionsInner position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * The position of the condition + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public SlaConditionsInner conditionableType(@javax.annotation.Nullable ConditionableTypeEnum conditionableType) { + this.conditionableType = conditionableType; + return this; + } + + /** + * The type of condition + * @return conditionableType + */ + @javax.annotation.Nullable + public ConditionableTypeEnum getConditionableType() { + return conditionableType; + } + + public void setConditionableType(@javax.annotation.Nullable ConditionableTypeEnum conditionableType) { + this.conditionableType = conditionableType; + } + + + public SlaConditionsInner property(@javax.annotation.Nullable String property) { + this.property = property; + return this; + } + + /** + * The property to evaluate (for built-in field conditions) + * @return property + */ + @javax.annotation.Nullable + public String getProperty() { + return property; + } + + public void setProperty(@javax.annotation.Nullable String property) { + this.property = property; + } + + + public SlaConditionsInner operator(@javax.annotation.Nullable String operator) { + this.operator = operator; + return this; + } + + /** + * The comparison operator + * @return operator + */ + @javax.annotation.Nullable + public String getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nullable String operator) { + this.operator = operator; + } + + + public SlaConditionsInner values(@javax.annotation.Nullable List values) { + this.values = values; + return this; + } + + public SlaConditionsInner addValuesItem(String valuesItem) { + if (this.values == null) { + this.values = new ArrayList<>(); + } + this.values.add(valuesItem); + return this; + } + + /** + * The values to compare against + * @return values + */ + @javax.annotation.Nullable + public List getValues() { + return values; + } + + public void setValues(@javax.annotation.Nullable List values) { + this.values = values; + } + + + public SlaConditionsInner formFieldId(@javax.annotation.Nullable UUID formFieldId) { + this.formFieldId = formFieldId; + return this; + } + + /** + * The ID of the form field (for custom field conditions) + * @return formFieldId + */ + @javax.annotation.Nullable + public UUID getFormFieldId() { + return formFieldId; + } + + public void setFormFieldId(@javax.annotation.Nullable UUID formFieldId) { + this.formFieldId = formFieldId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlaConditionsInner slaConditionsInner = (SlaConditionsInner) o; + return Objects.equals(this.id, slaConditionsInner.id) && + Objects.equals(this.position, slaConditionsInner.position) && + Objects.equals(this.conditionableType, slaConditionsInner.conditionableType) && + Objects.equals(this.property, slaConditionsInner.property) && + Objects.equals(this.operator, slaConditionsInner.operator) && + Objects.equals(this.values, slaConditionsInner.values) && + Objects.equals(this.formFieldId, slaConditionsInner.formFieldId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, position, conditionableType, property, operator, values, formFieldId); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlaConditionsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" conditionableType: ").append(toIndentedString(conditionableType)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).append("\n"); + sb.append(" formFieldId: ").append(toIndentedString(formFieldId)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("position"); + openapiFields.add("conditionable_type"); + openapiFields.add("property"); + openapiFields.add("operator"); + openapiFields.add("values"); + openapiFields.add("form_field_id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SlaConditionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SlaConditionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SlaConditionsInner is not found in the empty JSON string", SlaConditionsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SlaConditionsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SlaConditionsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("conditionable_type") != null && !jsonObj.get("conditionable_type").isJsonNull()) && !jsonObj.get("conditionable_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `conditionable_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conditionable_type").toString())); + } + // validate the optional field `conditionable_type` + if (jsonObj.get("conditionable_type") != null && !jsonObj.get("conditionable_type").isJsonNull()) { + ConditionableTypeEnum.validateJsonElement(jsonObj.get("conditionable_type")); + } + if ((jsonObj.get("property") != null && !jsonObj.get("property").isJsonNull()) && !jsonObj.get("property").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `property` to be a primitive type in the JSON string but got `%s`", jsonObj.get("property").toString())); + } + if ((jsonObj.get("operator") != null && !jsonObj.get("operator").isJsonNull()) && !jsonObj.get("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonNull() && !jsonObj.get("values").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + } + if ((jsonObj.get("form_field_id") != null && !jsonObj.get("form_field_id").isJsonNull()) && !jsonObj.get("form_field_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `form_field_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("form_field_id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SlaConditionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SlaConditionsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SlaConditionsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SlaConditionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SlaConditionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SlaConditionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SlaConditionsInner + * @throws IOException if the JSON string is invalid with respect to SlaConditionsInner + */ + public static SlaConditionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SlaConditionsInner.class); + } + + /** + * Convert an instance of SlaConditionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SlaList.java b/src/main/java/com/rootly/client/model/SlaList.java new file mode 100644 index 00000000..f2f16daa --- /dev/null +++ b/src/main/java/com/rootly/client/model/SlaList.java @@ -0,0 +1,294 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import com.rootly.client.model.SlaResponseData; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SlaList + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SlaList { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LINKS = "links"; + @SerializedName(SERIALIZED_NAME_LINKS) + @javax.annotation.Nonnull + private Links links; + + public static final String SERIALIZED_NAME_META = "meta"; + @SerializedName(SERIALIZED_NAME_META) + @javax.annotation.Nonnull + private Meta meta; + + public SlaList() { + } + + public SlaList data(@javax.annotation.Nonnull List data) { + this.data = data; + return this; + } + + public SlaList addDataItem(SlaResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List data) { + this.data = data; + } + + + public SlaList links(@javax.annotation.Nonnull Links links) { + this.links = links; + return this; + } + + /** + * Get links + * @return links + */ + @javax.annotation.Nonnull + public Links getLinks() { + return links; + } + + public void setLinks(@javax.annotation.Nonnull Links links) { + this.links = links; + } + + + public SlaList meta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + return this; + } + + /** + * Get meta + * @return meta + */ + @javax.annotation.Nonnull + public Meta getMeta() { + return meta; + } + + public void setMeta(@javax.annotation.Nonnull Meta meta) { + this.meta = meta; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlaList slaList = (SlaList) o; + return Objects.equals(this.data, slaList.data) && + Objects.equals(this.links, slaList.links) && + Objects.equals(this.meta, slaList.meta); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlaList {\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("}"); + 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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + openapiFields.add("links"); + openapiFields.add("meta"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("links"); + openapiRequiredFields.add("meta"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SlaList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SlaList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SlaList is not found in the empty JSON string", SlaList.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SlaList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SlaList` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SlaList.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SlaResponseData.validateJsonElement(jsonArraydata.get(i)); + }; + // validate the required field `links` + Links.validateJsonElement(jsonObj.get("links")); + // validate the required field `meta` + Meta.validateJsonElement(jsonObj.get("meta")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SlaList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SlaList' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SlaList.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SlaList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SlaList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SlaList given an JSON string + * + * @param jsonString JSON string + * @return An instance of SlaList + * @throws IOException if the JSON string is invalid with respect to SlaList + */ + public static SlaList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SlaList.class); + } + + /** + * Convert an instance of SlaList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SlaNotificationConfigurationsInner.java b/src/main/java/com/rootly/client/model/SlaNotificationConfigurationsInner.java new file mode 100644 index 00000000..4ec3a176 --- /dev/null +++ b/src/main/java/com/rootly/client/model/SlaNotificationConfigurationsInner.java @@ -0,0 +1,382 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SlaNotificationConfigurationsInner + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SlaNotificationConfigurationsInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private UUID id; + + /** + * When to send the notification relative to the deadline + */ + @JsonAdapter(OffsetTypeEnum.Adapter.class) + public enum OffsetTypeEnum { + BEFORE_DUE("before_due"), + + WHEN_DUE("when_due"), + + AFTER_DUE("after_due"); + + private String value; + + OffsetTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OffsetTypeEnum fromValue(String value) { + for (OffsetTypeEnum b : OffsetTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OffsetTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OffsetTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OffsetTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OffsetTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OFFSET_TYPE = "offset_type"; + @SerializedName(SERIALIZED_NAME_OFFSET_TYPE) + @javax.annotation.Nullable + private OffsetTypeEnum offsetType; + + public static final String SERIALIZED_NAME_OFFSET_DAYS = "offset_days"; + @SerializedName(SERIALIZED_NAME_OFFSET_DAYS) + @javax.annotation.Nullable + private Integer offsetDays; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private String createdAt; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + @javax.annotation.Nullable + private String updatedAt; + + public SlaNotificationConfigurationsInner() { + } + + public SlaNotificationConfigurationsInner id(@javax.annotation.Nullable UUID id) { + this.id = id; + return this; + } + + /** + * Unique ID of the notification configuration + * @return id + */ + @javax.annotation.Nullable + public UUID getId() { + return id; + } + + public void setId(@javax.annotation.Nullable UUID id) { + this.id = id; + } + + + public SlaNotificationConfigurationsInner offsetType(@javax.annotation.Nullable OffsetTypeEnum offsetType) { + this.offsetType = offsetType; + return this; + } + + /** + * When to send the notification relative to the deadline + * @return offsetType + */ + @javax.annotation.Nullable + public OffsetTypeEnum getOffsetType() { + return offsetType; + } + + public void setOffsetType(@javax.annotation.Nullable OffsetTypeEnum offsetType) { + this.offsetType = offsetType; + } + + + public SlaNotificationConfigurationsInner offsetDays(@javax.annotation.Nullable Integer offsetDays) { + this.offsetDays = offsetDays; + return this; + } + + /** + * Number of days offset from the deadline + * @return offsetDays + */ + @javax.annotation.Nullable + public Integer getOffsetDays() { + return offsetDays; + } + + public void setOffsetDays(@javax.annotation.Nullable Integer offsetDays) { + this.offsetDays = offsetDays; + } + + + public SlaNotificationConfigurationsInner createdAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date of creation + * @return createdAt + */ + @javax.annotation.Nullable + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable String createdAt) { + this.createdAt = createdAt; + } + + + public SlaNotificationConfigurationsInner updatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Date of last update + * @return updatedAt + */ + @javax.annotation.Nullable + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(@javax.annotation.Nullable String updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlaNotificationConfigurationsInner slaNotificationConfigurationsInner = (SlaNotificationConfigurationsInner) o; + return Objects.equals(this.id, slaNotificationConfigurationsInner.id) && + Objects.equals(this.offsetType, slaNotificationConfigurationsInner.offsetType) && + Objects.equals(this.offsetDays, slaNotificationConfigurationsInner.offsetDays) && + Objects.equals(this.createdAt, slaNotificationConfigurationsInner.createdAt) && + Objects.equals(this.updatedAt, slaNotificationConfigurationsInner.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(id, offsetType, offsetDays, createdAt, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlaNotificationConfigurationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" offsetType: ").append(toIndentedString(offsetType)).append("\n"); + sb.append(" offsetDays: ").append(toIndentedString(offsetDays)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("offset_type"); + openapiFields.add("offset_days"); + openapiFields.add("created_at"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SlaNotificationConfigurationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SlaNotificationConfigurationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SlaNotificationConfigurationsInner is not found in the empty JSON string", SlaNotificationConfigurationsInner.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SlaNotificationConfigurationsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SlaNotificationConfigurationsInner` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("offset_type") != null && !jsonObj.get("offset_type").isJsonNull()) && !jsonObj.get("offset_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `offset_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("offset_type").toString())); + } + // validate the optional field `offset_type` + if (jsonObj.get("offset_type") != null && !jsonObj.get("offset_type").isJsonNull()) { + OffsetTypeEnum.validateJsonElement(jsonObj.get("offset_type")); + } + if ((jsonObj.get("created_at") != null && !jsonObj.get("created_at").isJsonNull()) && !jsonObj.get("created_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `created_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("created_at").toString())); + } + if ((jsonObj.get("updated_at") != null && !jsonObj.get("updated_at").isJsonNull()) && !jsonObj.get("updated_at").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `updated_at` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updated_at").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SlaNotificationConfigurationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SlaNotificationConfigurationsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SlaNotificationConfigurationsInner.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SlaNotificationConfigurationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SlaNotificationConfigurationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SlaNotificationConfigurationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SlaNotificationConfigurationsInner + * @throws IOException if the JSON string is invalid with respect to SlaNotificationConfigurationsInner + */ + public static SlaNotificationConfigurationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SlaNotificationConfigurationsInner.class); + } + + /** + * Convert an instance of SlaNotificationConfigurationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SlaResponse.java b/src/main/java/com/rootly/client/model/SlaResponse.java new file mode 100644 index 00000000..60b9e2ad --- /dev/null +++ b/src/main/java/com/rootly/client/model/SlaResponse.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SlaResponseData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SlaResponse + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SlaResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SlaResponseData data; + + public SlaResponse() { + } + + public SlaResponse data(@javax.annotation.Nonnull SlaResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SlaResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SlaResponseData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlaResponse slaResponse = (SlaResponse) o; + return Objects.equals(this.data, slaResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlaResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SlaResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SlaResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SlaResponse is not found in the empty JSON string", SlaResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SlaResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SlaResponse` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SlaResponse.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + SlaResponseData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SlaResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SlaResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SlaResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SlaResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SlaResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SlaResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SlaResponse + * @throws IOException if the JSON string is invalid with respect to SlaResponse + */ + public static SlaResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SlaResponse.class); + } + + /** + * Convert an instance of SlaResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SlaResponseData.java b/src/main/java/com/rootly/client/model/SlaResponseData.java new file mode 100644 index 00000000..f324c6e8 --- /dev/null +++ b/src/main/java/com/rootly/client/model/SlaResponseData.java @@ -0,0 +1,328 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.Sla; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SlaResponseData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SlaResponseData { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SLAS("slas"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private Sla attributes; + + public SlaResponseData() { + } + + public SlaResponseData id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Unique ID of the SLA + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public SlaResponseData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public SlaResponseData attributes(@javax.annotation.Nonnull Sla attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public Sla getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull Sla attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SlaResponseData slaResponseData = (SlaResponseData) o; + return Objects.equals(this.id, slaResponseData.id) && + Objects.equals(this.type, slaResponseData.type) && + Objects.equals(this.attributes, slaResponseData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SlaResponseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SlaResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SlaResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SlaResponseData is not found in the empty JSON string", SlaResponseData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SlaResponseData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SlaResponseData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SlaResponseData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + Sla.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SlaResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SlaResponseData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SlaResponseData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SlaResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SlaResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SlaResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SlaResponseData + * @throws IOException if the JSON string is invalid with respect to SlaResponseData + */ + public static SlaResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SlaResponseData.class); + } + + /** + * Convert an instance of SlaResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SnoozeAlert.java b/src/main/java/com/rootly/client/model/SnoozeAlert.java new file mode 100644 index 00000000..2ffb60cf --- /dev/null +++ b/src/main/java/com/rootly/client/model/SnoozeAlert.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SnoozeAlertData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SnoozeAlert + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SnoozeAlert { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SnoozeAlertData data; + + public SnoozeAlert() { + } + + public SnoozeAlert data(@javax.annotation.Nonnull SnoozeAlertData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SnoozeAlertData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SnoozeAlertData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SnoozeAlert snoozeAlert = (SnoozeAlert) o; + return Objects.equals(this.data, snoozeAlert.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SnoozeAlert {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SnoozeAlert + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SnoozeAlert.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SnoozeAlert is not found in the empty JSON string", SnoozeAlert.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SnoozeAlert.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SnoozeAlert` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SnoozeAlert.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + SnoozeAlertData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SnoozeAlert.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SnoozeAlert' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SnoozeAlert.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SnoozeAlert value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SnoozeAlert read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SnoozeAlert given an JSON string + * + * @param jsonString JSON string + * @return An instance of SnoozeAlert + * @throws IOException if the JSON string is invalid with respect to SnoozeAlert + */ + public static SnoozeAlert fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SnoozeAlert.class); + } + + /** + * Convert an instance of SnoozeAlert to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SnoozeAlertData.java b/src/main/java/com/rootly/client/model/SnoozeAlertData.java new file mode 100644 index 00000000..418f02bd --- /dev/null +++ b/src/main/java/com/rootly/client/model/SnoozeAlertData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SnoozeAlertDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SnoozeAlertData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SnoozeAlertData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ALERTS("alerts"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private SnoozeAlertDataAttributes attributes; + + public SnoozeAlertData() { + } + + public SnoozeAlertData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public SnoozeAlertData attributes(@javax.annotation.Nonnull SnoozeAlertDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public SnoozeAlertDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull SnoozeAlertDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SnoozeAlertData snoozeAlertData = (SnoozeAlertData) o; + return Objects.equals(this.type, snoozeAlertData.type) && + Objects.equals(this.attributes, snoozeAlertData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SnoozeAlertData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SnoozeAlertData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SnoozeAlertData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SnoozeAlertData is not found in the empty JSON string", SnoozeAlertData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SnoozeAlertData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SnoozeAlertData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SnoozeAlertData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + SnoozeAlertDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SnoozeAlertData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SnoozeAlertData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SnoozeAlertData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SnoozeAlertData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SnoozeAlertData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SnoozeAlertData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SnoozeAlertData + * @throws IOException if the JSON string is invalid with respect to SnoozeAlertData + */ + public static SnoozeAlertData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SnoozeAlertData.class); + } + + /** + * Convert an instance of SnoozeAlertData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/SnoozeAlertDataAttributes.java b/src/main/java/com/rootly/client/model/SnoozeAlertDataAttributes.java new file mode 100644 index 00000000..d870b8a5 --- /dev/null +++ b/src/main/java/com/rootly/client/model/SnoozeAlertDataAttributes.java @@ -0,0 +1,213 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * SnoozeAlertDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class SnoozeAlertDataAttributes { + public static final String SERIALIZED_NAME_DELAY_MINUTES = "delay_minutes"; + @SerializedName(SERIALIZED_NAME_DELAY_MINUTES) + @javax.annotation.Nonnull + private Integer delayMinutes; + + public SnoozeAlertDataAttributes() { + } + + public SnoozeAlertDataAttributes delayMinutes(@javax.annotation.Nonnull Integer delayMinutes) { + this.delayMinutes = delayMinutes; + return this; + } + + /** + * Number of minutes to snooze the alert for + * minimum: 1 + * maximum: 1440 + * @return delayMinutes + */ + @javax.annotation.Nonnull + public Integer getDelayMinutes() { + return delayMinutes; + } + + public void setDelayMinutes(@javax.annotation.Nonnull Integer delayMinutes) { + this.delayMinutes = delayMinutes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SnoozeAlertDataAttributes snoozeAlertDataAttributes = (SnoozeAlertDataAttributes) o; + return Objects.equals(this.delayMinutes, snoozeAlertDataAttributes.delayMinutes); + } + + @Override + public int hashCode() { + return Objects.hash(delayMinutes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SnoozeAlertDataAttributes {\n"); + sb.append(" delayMinutes: ").append(toIndentedString(delayMinutes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("delay_minutes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("delay_minutes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to SnoozeAlertDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SnoozeAlertDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SnoozeAlertDataAttributes is not found in the empty JSON string", SnoozeAlertDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!SnoozeAlertDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SnoozeAlertDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SnoozeAlertDataAttributes.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SnoozeAlertDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SnoozeAlertDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SnoozeAlertDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SnoozeAlertDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SnoozeAlertDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SnoozeAlertDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of SnoozeAlertDataAttributes + * @throws IOException if the JSON string is invalid with respect to SnoozeAlertDataAttributes + */ + public static SnoozeAlertDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SnoozeAlertDataAttributes.class); + } + + /** + * Convert an instance of SnoozeAlertDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateApiKey.java b/src/main/java/com/rootly/client/model/UpdateApiKey.java new file mode 100644 index 00000000..abc521fe --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateApiKey.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateApiKeyData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateApiKey + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateApiKey { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private UpdateApiKeyData data; + + public UpdateApiKey() { + } + + public UpdateApiKey data(@javax.annotation.Nonnull UpdateApiKeyData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public UpdateApiKeyData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull UpdateApiKeyData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKey updateApiKey = (UpdateApiKey) o; + return Objects.equals(this.data, updateApiKey.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateApiKey {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateApiKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateApiKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateApiKey is not found in the empty JSON string", UpdateApiKey.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateApiKey.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateApiKey` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateApiKey.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + UpdateApiKeyData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateApiKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateApiKey' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateApiKey.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateApiKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateApiKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateApiKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateApiKey + * @throws IOException if the JSON string is invalid with respect to UpdateApiKey + */ + public static UpdateApiKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateApiKey.class); + } + + /** + * Convert an instance of UpdateApiKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateApiKeyData.java b/src/main/java/com/rootly/client/model/UpdateApiKeyData.java new file mode 100644 index 00000000..e782a68b --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateApiKeyData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateApiKeyDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateApiKeyData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateApiKeyData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + API_KEYS("api_keys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private UpdateApiKeyDataAttributes attributes; + + public UpdateApiKeyData() { + } + + public UpdateApiKeyData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public UpdateApiKeyData attributes(@javax.annotation.Nonnull UpdateApiKeyDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public UpdateApiKeyDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull UpdateApiKeyDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKeyData updateApiKeyData = (UpdateApiKeyData) o; + return Objects.equals(this.type, updateApiKeyData.type) && + Objects.equals(this.attributes, updateApiKeyData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateApiKeyData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateApiKeyData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateApiKeyData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateApiKeyData is not found in the empty JSON string", UpdateApiKeyData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateApiKeyData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateApiKeyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateApiKeyData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + UpdateApiKeyDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateApiKeyData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateApiKeyData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateApiKeyData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateApiKeyData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateApiKeyData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateApiKeyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateApiKeyData + * @throws IOException if the JSON string is invalid with respect to UpdateApiKeyData + */ + public static UpdateApiKeyData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateApiKeyData.class); + } + + /** + * Convert an instance of UpdateApiKeyData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateApiKeyDataAttributes.java b/src/main/java/com/rootly/client/model/UpdateApiKeyDataAttributes.java new file mode 100644 index 00000000..cd64e19b --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateApiKeyDataAttributes.java @@ -0,0 +1,276 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateApiKeyDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateApiKeyDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expires_at"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + @javax.annotation.Nullable + private OffsetDateTime expiresAt; + + public UpdateApiKeyDataAttributes() { + } + + public UpdateApiKeyDataAttributes name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the API key + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateApiKeyDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the API key + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UpdateApiKeyDataAttributes expiresAt(@javax.annotation.Nullable OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + return this; + } + + /** + * The expiration date of the API key (ISO 8601) + * @return expiresAt + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(@javax.annotation.Nullable OffsetDateTime expiresAt) { + this.expiresAt = expiresAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateApiKeyDataAttributes updateApiKeyDataAttributes = (UpdateApiKeyDataAttributes) o; + return Objects.equals(this.name, updateApiKeyDataAttributes.name) && + Objects.equals(this.description, updateApiKeyDataAttributes.description) && + Objects.equals(this.expiresAt, updateApiKeyDataAttributes.expiresAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, expiresAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateApiKeyDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("expires_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateApiKeyDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateApiKeyDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateApiKeyDataAttributes is not found in the empty JSON string", UpdateApiKeyDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateApiKeyDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateApiKeyDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateApiKeyDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateApiKeyDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateApiKeyDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateApiKeyDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateApiKeyDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateApiKeyDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateApiKeyDataAttributes + * @throws IOException if the JSON string is invalid with respect to UpdateApiKeyDataAttributes + */ + public static UpdateApiKeyDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateApiKeyDataAttributes.class); + } + + /** + * Convert an instance of UpdateApiKeyDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplate.java b/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplate.java new file mode 100644 index 00000000..8a7576c3 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplate.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogChecklistTemplateData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateCatalogChecklistTemplate + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateCatalogChecklistTemplate { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private UpdateCatalogChecklistTemplateData data; + + public UpdateCatalogChecklistTemplate() { + } + + public UpdateCatalogChecklistTemplate data(@javax.annotation.Nonnull UpdateCatalogChecklistTemplateData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public UpdateCatalogChecklistTemplateData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull UpdateCatalogChecklistTemplateData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate = (UpdateCatalogChecklistTemplate) o; + return Objects.equals(this.data, updateCatalogChecklistTemplate.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCatalogChecklistTemplate {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateCatalogChecklistTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateCatalogChecklistTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateCatalogChecklistTemplate is not found in the empty JSON string", UpdateCatalogChecklistTemplate.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateCatalogChecklistTemplate.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCatalogChecklistTemplate` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateCatalogChecklistTemplate.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + UpdateCatalogChecklistTemplateData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateCatalogChecklistTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateCatalogChecklistTemplate' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateCatalogChecklistTemplate.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateCatalogChecklistTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateCatalogChecklistTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateCatalogChecklistTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateCatalogChecklistTemplate + * @throws IOException if the JSON string is invalid with respect to UpdateCatalogChecklistTemplate + */ + public static UpdateCatalogChecklistTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateCatalogChecklistTemplate.class); + } + + /** + * Convert an instance of UpdateCatalogChecklistTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplateData.java b/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplateData.java new file mode 100644 index 00000000..d5a2851a --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplateData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogChecklistTemplateDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateCatalogChecklistTemplateData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateCatalogChecklistTemplateData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_CHECKLIST_TEMPLATES("catalog_checklist_templates"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private UpdateCatalogChecklistTemplateDataAttributes attributes; + + public UpdateCatalogChecklistTemplateData() { + } + + public UpdateCatalogChecklistTemplateData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public UpdateCatalogChecklistTemplateData attributes(@javax.annotation.Nonnull UpdateCatalogChecklistTemplateDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public UpdateCatalogChecklistTemplateDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull UpdateCatalogChecklistTemplateDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCatalogChecklistTemplateData updateCatalogChecklistTemplateData = (UpdateCatalogChecklistTemplateData) o; + return Objects.equals(this.type, updateCatalogChecklistTemplateData.type) && + Objects.equals(this.attributes, updateCatalogChecklistTemplateData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCatalogChecklistTemplateData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateCatalogChecklistTemplateData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateCatalogChecklistTemplateData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateCatalogChecklistTemplateData is not found in the empty JSON string", UpdateCatalogChecklistTemplateData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateCatalogChecklistTemplateData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCatalogChecklistTemplateData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateCatalogChecklistTemplateData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + UpdateCatalogChecklistTemplateDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateCatalogChecklistTemplateData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateCatalogChecklistTemplateData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateCatalogChecklistTemplateData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateCatalogChecklistTemplateData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateCatalogChecklistTemplateData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateCatalogChecklistTemplateData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateCatalogChecklistTemplateData + * @throws IOException if the JSON string is invalid with respect to UpdateCatalogChecklistTemplateData + */ + public static UpdateCatalogChecklistTemplateData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateCatalogChecklistTemplateData.class); + } + + /** + * Convert an instance of UpdateCatalogChecklistTemplateData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataAttributes.java b/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataAttributes.java new file mode 100644 index 00000000..1fdd1294 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataAttributes.java @@ -0,0 +1,350 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesFieldsInner; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateCatalogChecklistTemplateDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateCatalogChecklistTemplateDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_FIELDS = "fields"; + @SerializedName(SERIALIZED_NAME_FIELDS) + @javax.annotation.Nullable + private List fields; + + public static final String SERIALIZED_NAME_OWNERS = "owners"; + @SerializedName(SERIALIZED_NAME_OWNERS) + @javax.annotation.Nullable + private List owners; + + public UpdateCatalogChecklistTemplateDataAttributes() { + } + + public UpdateCatalogChecklistTemplateDataAttributes name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the checklist template + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateCatalogChecklistTemplateDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the checklist template + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UpdateCatalogChecklistTemplateDataAttributes fields(@javax.annotation.Nullable List fields) { + this.fields = fields; + return this; + } + + public UpdateCatalogChecklistTemplateDataAttributes addFieldsItem(NewCatalogChecklistTemplateDataAttributesFieldsInner fieldsItem) { + if (this.fields == null) { + this.fields = new ArrayList<>(); + } + this.fields.add(fieldsItem); + return this; + } + + /** + * Template fields. Position is determined by array order. Replaces all existing fields. + * @return fields + */ + @javax.annotation.Nullable + public List getFields() { + return fields; + } + + public void setFields(@javax.annotation.Nullable List fields) { + this.fields = fields; + } + + + public UpdateCatalogChecklistTemplateDataAttributes owners(@javax.annotation.Nullable List owners) { + this.owners = owners; + return this; + } + + public UpdateCatalogChecklistTemplateDataAttributes addOwnersItem(NewCatalogChecklistTemplateDataAttributesOwnersInner ownersItem) { + if (this.owners == null) { + this.owners = new ArrayList<>(); + } + this.owners.add(ownersItem); + return this; + } + + /** + * Template owners. Replaces all existing owners. + * @return owners + */ + @javax.annotation.Nullable + public List getOwners() { + return owners; + } + + public void setOwners(@javax.annotation.Nullable List owners) { + this.owners = owners; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCatalogChecklistTemplateDataAttributes updateCatalogChecklistTemplateDataAttributes = (UpdateCatalogChecklistTemplateDataAttributes) o; + return Objects.equals(this.name, updateCatalogChecklistTemplateDataAttributes.name) && + Objects.equals(this.description, updateCatalogChecklistTemplateDataAttributes.description) && + Objects.equals(this.fields, updateCatalogChecklistTemplateDataAttributes.fields) && + Objects.equals(this.owners, updateCatalogChecklistTemplateDataAttributes.owners); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, fields, owners); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCatalogChecklistTemplateDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" owners: ").append(toIndentedString(owners)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("fields"); + openapiFields.add("owners"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateCatalogChecklistTemplateDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateCatalogChecklistTemplateDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateCatalogChecklistTemplateDataAttributes is not found in the empty JSON string", UpdateCatalogChecklistTemplateDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateCatalogChecklistTemplateDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCatalogChecklistTemplateDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if (jsonObj.get("fields") != null && !jsonObj.get("fields").isJsonNull()) { + JsonArray jsonArrayfields = jsonObj.getAsJsonArray("fields"); + if (jsonArrayfields != null) { + // ensure the json data is an array + if (!jsonObj.get("fields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `fields` to be an array in the JSON string but got `%s`", jsonObj.get("fields").toString())); + } + + // validate the optional field `fields` (array) + for (int i = 0; i < jsonArrayfields.size(); i++) { + NewCatalogChecklistTemplateDataAttributesFieldsInner.validateJsonElement(jsonArrayfields.get(i)); + }; + } + } + if (jsonObj.get("owners") != null && !jsonObj.get("owners").isJsonNull()) { + JsonArray jsonArrayowners = jsonObj.getAsJsonArray("owners"); + if (jsonArrayowners != null) { + // ensure the json data is an array + if (!jsonObj.get("owners").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `owners` to be an array in the JSON string but got `%s`", jsonObj.get("owners").toString())); + } + + // validate the optional field `owners` (array) + for (int i = 0; i < jsonArrayowners.size(); i++) { + NewCatalogChecklistTemplateDataAttributesOwnersInner.validateJsonElement(jsonArrayowners.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateCatalogChecklistTemplateDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateCatalogChecklistTemplateDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateCatalogChecklistTemplateDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateCatalogChecklistTemplateDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateCatalogChecklistTemplateDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateCatalogChecklistTemplateDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateCatalogChecklistTemplateDataAttributes + * @throws IOException if the JSON string is invalid with respect to UpdateCatalogChecklistTemplateDataAttributes + */ + public static UpdateCatalogChecklistTemplateDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateCatalogChecklistTemplateDataAttributes.class); + } + + /** + * Convert an instance of UpdateCatalogChecklistTemplateDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateCatalogProperty.java b/src/main/java/com/rootly/client/model/UpdateCatalogProperty.java new file mode 100644 index 00000000..37ac2af3 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateCatalogProperty.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogPropertyData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateCatalogProperty + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateCatalogProperty { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private UpdateCatalogPropertyData data; + + public UpdateCatalogProperty() { + } + + public UpdateCatalogProperty data(@javax.annotation.Nonnull UpdateCatalogPropertyData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public UpdateCatalogPropertyData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull UpdateCatalogPropertyData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCatalogProperty updateCatalogProperty = (UpdateCatalogProperty) o; + return Objects.equals(this.data, updateCatalogProperty.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCatalogProperty {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateCatalogProperty + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateCatalogProperty.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateCatalogProperty is not found in the empty JSON string", UpdateCatalogProperty.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateCatalogProperty.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCatalogProperty` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateCatalogProperty.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + UpdateCatalogPropertyData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateCatalogProperty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateCatalogProperty' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateCatalogProperty.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateCatalogProperty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateCatalogProperty read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateCatalogProperty given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateCatalogProperty + * @throws IOException if the JSON string is invalid with respect to UpdateCatalogProperty + */ + public static UpdateCatalogProperty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateCatalogProperty.class); + } + + /** + * Convert an instance of UpdateCatalogProperty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateCatalogPropertyData.java b/src/main/java/com/rootly/client/model/UpdateCatalogPropertyData.java new file mode 100644 index 00000000..bdcfde49 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateCatalogPropertyData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogPropertyDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateCatalogPropertyData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateCatalogPropertyData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CATALOG_PROPERTIES("catalog_properties"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private UpdateCatalogPropertyDataAttributes attributes; + + public UpdateCatalogPropertyData() { + } + + public UpdateCatalogPropertyData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public UpdateCatalogPropertyData attributes(@javax.annotation.Nonnull UpdateCatalogPropertyDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public UpdateCatalogPropertyDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull UpdateCatalogPropertyDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCatalogPropertyData updateCatalogPropertyData = (UpdateCatalogPropertyData) o; + return Objects.equals(this.type, updateCatalogPropertyData.type) && + Objects.equals(this.attributes, updateCatalogPropertyData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCatalogPropertyData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateCatalogPropertyData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateCatalogPropertyData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateCatalogPropertyData is not found in the empty JSON string", UpdateCatalogPropertyData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateCatalogPropertyData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCatalogPropertyData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateCatalogPropertyData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + UpdateCatalogPropertyDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateCatalogPropertyData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateCatalogPropertyData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateCatalogPropertyData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateCatalogPropertyData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateCatalogPropertyData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateCatalogPropertyData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateCatalogPropertyData + * @throws IOException if the JSON string is invalid with respect to UpdateCatalogPropertyData + */ + public static UpdateCatalogPropertyData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateCatalogPropertyData.class); + } + + /** + * Convert an instance of UpdateCatalogPropertyData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateCatalogPropertyDataAttributes.java b/src/main/java/com/rootly/client/model/UpdateCatalogPropertyDataAttributes.java new file mode 100644 index 00000000..d8bcdffb --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateCatalogPropertyDataAttributes.java @@ -0,0 +1,502 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateCatalogPropertyDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateCatalogPropertyDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + /** + * Gets or Sets kind + */ + @JsonAdapter(KindEnum.Adapter.class) + public enum KindEnum { + TEXT("text"), + + REFERENCE("reference"), + + BOOLEAN("boolean"), + + REFERENCE2("reference"), + + SERVICE("service"), + + FUNCTIONALITY("functionality"), + + ENVIRONMENT("environment"), + + GROUP("group"), + + CAUSE("cause"), + + INCIDENT_TYPE("incident_type"), + + USER("user"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final KindEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public KindEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return KindEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + KindEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_KIND = "kind"; + @SerializedName(SERIALIZED_NAME_KIND) + @javax.annotation.Nullable + private KindEnum kind; + + public static final String SERIALIZED_NAME_KIND_CATALOG_ID = "kind_catalog_id"; + @SerializedName(SERIALIZED_NAME_KIND_CATALOG_ID) + @javax.annotation.Nullable + private String kindCatalogId; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + public static final String SERIALIZED_NAME_REQUIRED = "required"; + @SerializedName(SERIALIZED_NAME_REQUIRED) + @javax.annotation.Nullable + private Boolean required; + + /** + * The type of catalog the property belongs to. + */ + @JsonAdapter(CatalogTypeEnum.Adapter.class) + public enum CatalogTypeEnum { + CATALOG("catalog"), + + CAUSE("cause"), + + ENVIRONMENT("environment"), + + FUNCTIONALITY("functionality"), + + INCIDENT_TYPE("incident_type"), + + SERVICE("service"), + + TEAM("team"); + + private String value; + + CatalogTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CatalogTypeEnum fromValue(String value) { + for (CatalogTypeEnum b : CatalogTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CatalogTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CatalogTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CatalogTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CatalogTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CATALOG_TYPE = "catalog_type"; + @SerializedName(SERIALIZED_NAME_CATALOG_TYPE) + @javax.annotation.Nullable + private CatalogTypeEnum catalogType; + + public UpdateCatalogPropertyDataAttributes() { + } + + public UpdateCatalogPropertyDataAttributes name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateCatalogPropertyDataAttributes kind(@javax.annotation.Nullable KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + */ + @javax.annotation.Nullable + public KindEnum getKind() { + return kind; + } + + public void setKind(@javax.annotation.Nullable KindEnum kind) { + this.kind = kind; + } + + + public UpdateCatalogPropertyDataAttributes kindCatalogId(@javax.annotation.Nullable String kindCatalogId) { + this.kindCatalogId = kindCatalogId; + return this; + } + + /** + * Restricts values to items of specified catalog. + * @return kindCatalogId + */ + @javax.annotation.Nullable + public String getKindCatalogId() { + return kindCatalogId; + } + + public void setKindCatalogId(@javax.annotation.Nullable String kindCatalogId) { + this.kindCatalogId = kindCatalogId; + } + + + public UpdateCatalogPropertyDataAttributes position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Default position of the item when displayed in a list. + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public UpdateCatalogPropertyDataAttributes required(@javax.annotation.Nullable Boolean required) { + this.required = required; + return this; + } + + /** + * Whether the property is required. + * @return required + */ + @javax.annotation.Nullable + public Boolean getRequired() { + return required; + } + + public void setRequired(@javax.annotation.Nullable Boolean required) { + this.required = required; + } + + + public UpdateCatalogPropertyDataAttributes catalogType(@javax.annotation.Nullable CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + return this; + } + + /** + * The type of catalog the property belongs to. + * @return catalogType + */ + @javax.annotation.Nullable + public CatalogTypeEnum getCatalogType() { + return catalogType; + } + + public void setCatalogType(@javax.annotation.Nullable CatalogTypeEnum catalogType) { + this.catalogType = catalogType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateCatalogPropertyDataAttributes updateCatalogPropertyDataAttributes = (UpdateCatalogPropertyDataAttributes) o; + return Objects.equals(this.name, updateCatalogPropertyDataAttributes.name) && + Objects.equals(this.kind, updateCatalogPropertyDataAttributes.kind) && + Objects.equals(this.kindCatalogId, updateCatalogPropertyDataAttributes.kindCatalogId) && + Objects.equals(this.position, updateCatalogPropertyDataAttributes.position) && + Objects.equals(this.required, updateCatalogPropertyDataAttributes.required) && + Objects.equals(this.catalogType, updateCatalogPropertyDataAttributes.catalogType); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, kind, kindCatalogId, position, required, catalogType); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateCatalogPropertyDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append(" kindCatalogId: ").append(toIndentedString(kindCatalogId)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" required: ").append(toIndentedString(required)).append("\n"); + sb.append(" catalogType: ").append(toIndentedString(catalogType)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("kind"); + openapiFields.add("kind_catalog_id"); + openapiFields.add("position"); + openapiFields.add("required"); + openapiFields.add("catalog_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateCatalogPropertyDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateCatalogPropertyDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateCatalogPropertyDataAttributes is not found in the empty JSON string", UpdateCatalogPropertyDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateCatalogPropertyDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCatalogPropertyDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString())); + } + // validate the optional field `kind` + if (jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) { + KindEnum.validateJsonElement(jsonObj.get("kind")); + } + if ((jsonObj.get("kind_catalog_id") != null && !jsonObj.get("kind_catalog_id").isJsonNull()) && !jsonObj.get("kind_catalog_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kind_catalog_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind_catalog_id").toString())); + } + if ((jsonObj.get("catalog_type") != null && !jsonObj.get("catalog_type").isJsonNull()) && !jsonObj.get("catalog_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `catalog_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("catalog_type").toString())); + } + // validate the optional field `catalog_type` + if (jsonObj.get("catalog_type") != null && !jsonObj.get("catalog_type").isJsonNull()) { + CatalogTypeEnum.validateJsonElement(jsonObj.get("catalog_type")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateCatalogPropertyDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateCatalogPropertyDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateCatalogPropertyDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateCatalogPropertyDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateCatalogPropertyDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateCatalogPropertyDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateCatalogPropertyDataAttributes + * @throws IOException if the JSON string is invalid with respect to UpdateCatalogPropertyDataAttributes + */ + public static UpdateCatalogPropertyDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateCatalogPropertyDataAttributes.class); + } + + /** + * Convert an instance of UpdateCatalogPropertyDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateEdgeConnectorActionRequest.java b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorActionRequest.java new file mode 100644 index 00000000..bf964173 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorActionRequest.java @@ -0,0 +1,208 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateEdgeConnectorActionRequestAction; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateEdgeConnectorActionRequest + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateEdgeConnectorActionRequest { + public static final String SERIALIZED_NAME_ACTION = "action"; + @SerializedName(SERIALIZED_NAME_ACTION) + @javax.annotation.Nullable + private UpdateEdgeConnectorActionRequestAction action; + + public UpdateEdgeConnectorActionRequest() { + } + + public UpdateEdgeConnectorActionRequest action(@javax.annotation.Nullable UpdateEdgeConnectorActionRequestAction action) { + this.action = action; + return this; + } + + /** + * Get action + * @return action + */ + @javax.annotation.Nullable + public UpdateEdgeConnectorActionRequestAction getAction() { + return action; + } + + public void setAction(@javax.annotation.Nullable UpdateEdgeConnectorActionRequestAction action) { + this.action = action; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEdgeConnectorActionRequest updateEdgeConnectorActionRequest = (UpdateEdgeConnectorActionRequest) o; + return Objects.equals(this.action, updateEdgeConnectorActionRequest.action); + } + + @Override + public int hashCode() { + return Objects.hash(action); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEdgeConnectorActionRequest {\n"); + sb.append(" action: ").append(toIndentedString(action)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("action"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEdgeConnectorActionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEdgeConnectorActionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEdgeConnectorActionRequest is not found in the empty JSON string", UpdateEdgeConnectorActionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEdgeConnectorActionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEdgeConnectorActionRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `action` + if (jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) { + UpdateEdgeConnectorActionRequestAction.validateJsonElement(jsonObj.get("action")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEdgeConnectorActionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEdgeConnectorActionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEdgeConnectorActionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEdgeConnectorActionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEdgeConnectorActionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEdgeConnectorActionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEdgeConnectorActionRequest + * @throws IOException if the JSON string is invalid with respect to UpdateEdgeConnectorActionRequest + */ + public static UpdateEdgeConnectorActionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEdgeConnectorActionRequest.class); + } + + /** + * Convert an instance of UpdateEdgeConnectorActionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestAction.java b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestAction.java new file mode 100644 index 00000000..c9feecfb --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestAction.java @@ -0,0 +1,319 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateEdgeConnectorActionRequestAction + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateEdgeConnectorActionRequestAction { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + /** + * Gets or Sets actionType + */ + @JsonAdapter(ActionTypeEnum.Adapter.class) + public enum ActionTypeEnum { + SCRIPT("script"), + + HTTP("http"); + + private String value; + + ActionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ActionTypeEnum fromValue(String value) { + for (ActionTypeEnum b : ActionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ActionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ActionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ActionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ActionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ACTION_TYPE = "action_type"; + @SerializedName(SERIALIZED_NAME_ACTION_TYPE) + @javax.annotation.Nullable + private ActionTypeEnum actionType; + + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Object metadata; + + public UpdateEdgeConnectorActionRequestAction() { + } + + public UpdateEdgeConnectorActionRequestAction name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateEdgeConnectorActionRequestAction actionType(@javax.annotation.Nullable ActionTypeEnum actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get actionType + * @return actionType + */ + @javax.annotation.Nullable + public ActionTypeEnum getActionType() { + return actionType; + } + + public void setActionType(@javax.annotation.Nullable ActionTypeEnum actionType) { + this.actionType = actionType; + } + + + public UpdateEdgeConnectorActionRequestAction metadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Object getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Object metadata) { + this.metadata = metadata; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEdgeConnectorActionRequestAction updateEdgeConnectorActionRequestAction = (UpdateEdgeConnectorActionRequestAction) o; + return Objects.equals(this.name, updateEdgeConnectorActionRequestAction.name) && + Objects.equals(this.actionType, updateEdgeConnectorActionRequestAction.actionType) && + Objects.equals(this.metadata, updateEdgeConnectorActionRequestAction.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(name, actionType, metadata); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEdgeConnectorActionRequestAction {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" actionType: ").append(toIndentedString(actionType)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("action_type"); + openapiFields.add("metadata"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEdgeConnectorActionRequestAction + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEdgeConnectorActionRequestAction.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEdgeConnectorActionRequestAction is not found in the empty JSON string", UpdateEdgeConnectorActionRequestAction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEdgeConnectorActionRequestAction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEdgeConnectorActionRequestAction` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("action_type") != null && !jsonObj.get("action_type").isJsonNull()) && !jsonObj.get("action_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `action_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action_type").toString())); + } + // validate the optional field `action_type` + if (jsonObj.get("action_type") != null && !jsonObj.get("action_type").isJsonNull()) { + ActionTypeEnum.validateJsonElement(jsonObj.get("action_type")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEdgeConnectorActionRequestAction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEdgeConnectorActionRequestAction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEdgeConnectorActionRequestAction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEdgeConnectorActionRequestAction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEdgeConnectorActionRequestAction read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEdgeConnectorActionRequestAction given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEdgeConnectorActionRequestAction + * @throws IOException if the JSON string is invalid with respect to UpdateEdgeConnectorActionRequestAction + */ + public static UpdateEdgeConnectorActionRequestAction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEdgeConnectorActionRequestAction.class); + } + + /** + * Convert an instance of UpdateEdgeConnectorActionRequestAction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequest.java b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequest.java new file mode 100644 index 00000000..cbc0d26f --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequest.java @@ -0,0 +1,208 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateEdgeConnectorRequestData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateEdgeConnectorRequest + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateEdgeConnectorRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private UpdateEdgeConnectorRequestData data; + + public UpdateEdgeConnectorRequest() { + } + + public UpdateEdgeConnectorRequest data(@javax.annotation.Nullable UpdateEdgeConnectorRequestData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public UpdateEdgeConnectorRequestData getData() { + return data; + } + + public void setData(@javax.annotation.Nullable UpdateEdgeConnectorRequestData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEdgeConnectorRequest updateEdgeConnectorRequest = (UpdateEdgeConnectorRequest) o; + return Objects.equals(this.data, updateEdgeConnectorRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEdgeConnectorRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEdgeConnectorRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEdgeConnectorRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEdgeConnectorRequest is not found in the empty JSON string", UpdateEdgeConnectorRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEdgeConnectorRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEdgeConnectorRequest` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `data` + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + UpdateEdgeConnectorRequestData.validateJsonElement(jsonObj.get("data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEdgeConnectorRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEdgeConnectorRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEdgeConnectorRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEdgeConnectorRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEdgeConnectorRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEdgeConnectorRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEdgeConnectorRequest + * @throws IOException if the JSON string is invalid with respect to UpdateEdgeConnectorRequest + */ + public static UpdateEdgeConnectorRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEdgeConnectorRequest.class); + } + + /** + * Convert an instance of UpdateEdgeConnectorRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequestData.java b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequestData.java new file mode 100644 index 00000000..e367a219 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequestData.java @@ -0,0 +1,322 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateEdgeConnectorRequestDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateEdgeConnectorRequestData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateEdgeConnectorRequestData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + EDGE_CONNECTORS("edge_connectors"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private TypeEnum type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private UpdateEdgeConnectorRequestDataAttributes attributes; + + public UpdateEdgeConnectorRequestData() { + } + + public UpdateEdgeConnectorRequestData type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public UpdateEdgeConnectorRequestData id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public UpdateEdgeConnectorRequestData attributes(@javax.annotation.Nullable UpdateEdgeConnectorRequestDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public UpdateEdgeConnectorRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable UpdateEdgeConnectorRequestDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEdgeConnectorRequestData updateEdgeConnectorRequestData = (UpdateEdgeConnectorRequestData) o; + return Objects.equals(this.type, updateEdgeConnectorRequestData.type) && + Objects.equals(this.id, updateEdgeConnectorRequestData.id) && + Objects.equals(this.attributes, updateEdgeConnectorRequestData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEdgeConnectorRequestData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("id"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEdgeConnectorRequestData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEdgeConnectorRequestData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEdgeConnectorRequestData is not found in the empty JSON string", UpdateEdgeConnectorRequestData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEdgeConnectorRequestData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEdgeConnectorRequestData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field `attributes` + if (jsonObj.get("attributes") != null && !jsonObj.get("attributes").isJsonNull()) { + UpdateEdgeConnectorRequestDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEdgeConnectorRequestData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEdgeConnectorRequestData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEdgeConnectorRequestData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEdgeConnectorRequestData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEdgeConnectorRequestData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEdgeConnectorRequestData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEdgeConnectorRequestData + * @throws IOException if the JSON string is invalid with respect to UpdateEdgeConnectorRequestData + */ + public static UpdateEdgeConnectorRequestData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEdgeConnectorRequestData.class); + } + + /** + * Convert an instance of UpdateEdgeConnectorRequestData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataAttributes.java b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataAttributes.java new file mode 100644 index 00000000..1fb3b447 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataAttributes.java @@ -0,0 +1,363 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateEdgeConnectorRequestDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateEdgeConnectorRequestDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + /** + * Gets or Sets status + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + PAUSED("paused"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable + private StatusEnum status; + + public static final String SERIALIZED_NAME_SUBSCRIPTIONS = "subscriptions"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTIONS) + @javax.annotation.Nullable + private List subscriptions = new ArrayList<>(); + + public UpdateEdgeConnectorRequestDataAttributes() { + } + + public UpdateEdgeConnectorRequestDataAttributes name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateEdgeConnectorRequestDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UpdateEdgeConnectorRequestDataAttributes status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + } + + + public UpdateEdgeConnectorRequestDataAttributes subscriptions(@javax.annotation.Nullable List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + public UpdateEdgeConnectorRequestDataAttributes addSubscriptionsItem(String subscriptionsItem) { + if (this.subscriptions == null) { + this.subscriptions = new ArrayList<>(); + } + this.subscriptions.add(subscriptionsItem); + return this; + } + + /** + * Get subscriptions + * @return subscriptions + */ + @javax.annotation.Nullable + public List getSubscriptions() { + return subscriptions; + } + + public void setSubscriptions(@javax.annotation.Nullable List subscriptions) { + this.subscriptions = subscriptions; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEdgeConnectorRequestDataAttributes updateEdgeConnectorRequestDataAttributes = (UpdateEdgeConnectorRequestDataAttributes) o; + return Objects.equals(this.name, updateEdgeConnectorRequestDataAttributes.name) && + Objects.equals(this.description, updateEdgeConnectorRequestDataAttributes.description) && + Objects.equals(this.status, updateEdgeConnectorRequestDataAttributes.status) && + Objects.equals(this.subscriptions, updateEdgeConnectorRequestDataAttributes.subscriptions); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, status, subscriptions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEdgeConnectorRequestDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" subscriptions: ").append(toIndentedString(subscriptions)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("status"); + openapiFields.add("subscriptions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateEdgeConnectorRequestDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEdgeConnectorRequestDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEdgeConnectorRequestDataAttributes is not found in the empty JSON string", UpdateEdgeConnectorRequestDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateEdgeConnectorRequestDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateEdgeConnectorRequestDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field `status` + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("status")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("subscriptions") != null && !jsonObj.get("subscriptions").isJsonNull() && !jsonObj.get("subscriptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subscriptions` to be an array in the JSON string but got `%s`", jsonObj.get("subscriptions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateEdgeConnectorRequestDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEdgeConnectorRequestDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEdgeConnectorRequestDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateEdgeConnectorRequestDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateEdgeConnectorRequestDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEdgeConnectorRequestDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEdgeConnectorRequestDataAttributes + * @throws IOException if the JSON string is invalid with respect to UpdateEdgeConnectorRequestDataAttributes + */ + public static UpdateEdgeConnectorRequestDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEdgeConnectorRequestDataAttributes.class); + } + + /** + * Convert an instance of UpdateEdgeConnectorRequestDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateGithubIssueTaskParamsRepository.java b/src/main/java/com/rootly/client/model/UpdateGithubIssueTaskParamsRepository.java new file mode 100644 index 00000000..ba5625fc --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateGithubIssueTaskParamsRepository.java @@ -0,0 +1,236 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * The repository (used for loading labels and issue types) + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateGithubIssueTaskParamsRepository { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public UpdateGithubIssueTaskParamsRepository() { + } + + public UpdateGithubIssueTaskParamsRepository id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public UpdateGithubIssueTaskParamsRepository name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateGithubIssueTaskParamsRepository updateGithubIssueTaskParamsRepository = (UpdateGithubIssueTaskParamsRepository) o; + return Objects.equals(this.id, updateGithubIssueTaskParamsRepository.id) && + Objects.equals(this.name, updateGithubIssueTaskParamsRepository.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateGithubIssueTaskParamsRepository {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateGithubIssueTaskParamsRepository + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateGithubIssueTaskParamsRepository.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateGithubIssueTaskParamsRepository is not found in the empty JSON string", UpdateGithubIssueTaskParamsRepository.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateGithubIssueTaskParamsRepository.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateGithubIssueTaskParamsRepository` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateGithubIssueTaskParamsRepository.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateGithubIssueTaskParamsRepository' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateGithubIssueTaskParamsRepository.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateGithubIssueTaskParamsRepository value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateGithubIssueTaskParamsRepository read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateGithubIssueTaskParamsRepository given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateGithubIssueTaskParamsRepository + * @throws IOException if the JSON string is invalid with respect to UpdateGithubIssueTaskParamsRepository + */ + public static UpdateGithubIssueTaskParamsRepository fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateGithubIssueTaskParamsRepository.class); + } + + /** + * Convert an instance of UpdateGithubIssueTaskParamsRepository to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateOnCallPayReport.java b/src/main/java/com/rootly/client/model/UpdateOnCallPayReport.java new file mode 100644 index 00000000..ffc0bb66 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateOnCallPayReport.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateOnCallPayReportData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateOnCallPayReport + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateOnCallPayReport { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private UpdateOnCallPayReportData data; + + public UpdateOnCallPayReport() { + } + + public UpdateOnCallPayReport data(@javax.annotation.Nonnull UpdateOnCallPayReportData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public UpdateOnCallPayReportData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull UpdateOnCallPayReportData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOnCallPayReport updateOnCallPayReport = (UpdateOnCallPayReport) o; + return Objects.equals(this.data, updateOnCallPayReport.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateOnCallPayReport {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateOnCallPayReport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateOnCallPayReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateOnCallPayReport is not found in the empty JSON string", UpdateOnCallPayReport.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateOnCallPayReport.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateOnCallPayReport` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateOnCallPayReport.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + UpdateOnCallPayReportData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateOnCallPayReport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateOnCallPayReport' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateOnCallPayReport.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateOnCallPayReport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateOnCallPayReport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateOnCallPayReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateOnCallPayReport + * @throws IOException if the JSON string is invalid with respect to UpdateOnCallPayReport + */ + public static UpdateOnCallPayReport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateOnCallPayReport.class); + } + + /** + * Convert an instance of UpdateOnCallPayReport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateOnCallPayReportData.java b/src/main/java/com/rootly/client/model/UpdateOnCallPayReportData.java new file mode 100644 index 00000000..a75f21af --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateOnCallPayReportData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateOnCallPayReportDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateOnCallPayReportData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateOnCallPayReportData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ON_CALL_PAY_REPORTS("on_call_pay_reports"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private UpdateOnCallPayReportDataAttributes attributes; + + public UpdateOnCallPayReportData() { + } + + public UpdateOnCallPayReportData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public UpdateOnCallPayReportData attributes(@javax.annotation.Nonnull UpdateOnCallPayReportDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public UpdateOnCallPayReportDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull UpdateOnCallPayReportDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOnCallPayReportData updateOnCallPayReportData = (UpdateOnCallPayReportData) o; + return Objects.equals(this.type, updateOnCallPayReportData.type) && + Objects.equals(this.attributes, updateOnCallPayReportData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateOnCallPayReportData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateOnCallPayReportData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateOnCallPayReportData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateOnCallPayReportData is not found in the empty JSON string", UpdateOnCallPayReportData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateOnCallPayReportData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateOnCallPayReportData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateOnCallPayReportData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + UpdateOnCallPayReportDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateOnCallPayReportData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateOnCallPayReportData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateOnCallPayReportData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateOnCallPayReportData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateOnCallPayReportData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateOnCallPayReportData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateOnCallPayReportData + * @throws IOException if the JSON string is invalid with respect to UpdateOnCallPayReportData + */ + public static UpdateOnCallPayReportData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateOnCallPayReportData.class); + } + + /** + * Convert an instance of UpdateOnCallPayReportData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateOnCallPayReportDataAttributes.java b/src/main/java/com/rootly/client/model/UpdateOnCallPayReportDataAttributes.java new file mode 100644 index 00000000..6dcd2814 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateOnCallPayReportDataAttributes.java @@ -0,0 +1,272 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateOnCallPayReportDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateOnCallPayReportDataAttributes { + public static final String SERIALIZED_NAME_START_DATE = "start_date"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private LocalDate startDate; + + public static final String SERIALIZED_NAME_END_DATE = "end_date"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private LocalDate endDate; + + public static final String SERIALIZED_NAME_SCHEDULE_IDS = "schedule_ids"; + @SerializedName(SERIALIZED_NAME_SCHEDULE_IDS) + @javax.annotation.Nullable + private List scheduleIds = new ArrayList<>(); + + public UpdateOnCallPayReportDataAttributes() { + } + + public UpdateOnCallPayReportDataAttributes startDate(@javax.annotation.Nullable LocalDate startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date for the report period. + * @return startDate + */ + @javax.annotation.Nullable + public LocalDate getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable LocalDate startDate) { + this.startDate = startDate; + } + + + public UpdateOnCallPayReportDataAttributes endDate(@javax.annotation.Nullable LocalDate endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date for the report period. + * @return endDate + */ + @javax.annotation.Nullable + public LocalDate getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable LocalDate endDate) { + this.endDate = endDate; + } + + + public UpdateOnCallPayReportDataAttributes scheduleIds(@javax.annotation.Nullable List scheduleIds) { + this.scheduleIds = scheduleIds; + return this; + } + + public UpdateOnCallPayReportDataAttributes addScheduleIdsItem(String scheduleIdsItem) { + if (this.scheduleIds == null) { + this.scheduleIds = new ArrayList<>(); + } + this.scheduleIds.add(scheduleIdsItem); + return this; + } + + /** + * List of schedule UUIDs to scope the report. + * @return scheduleIds + */ + @javax.annotation.Nullable + public List getScheduleIds() { + return scheduleIds; + } + + public void setScheduleIds(@javax.annotation.Nullable List scheduleIds) { + this.scheduleIds = scheduleIds; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateOnCallPayReportDataAttributes updateOnCallPayReportDataAttributes = (UpdateOnCallPayReportDataAttributes) o; + return Objects.equals(this.startDate, updateOnCallPayReportDataAttributes.startDate) && + Objects.equals(this.endDate, updateOnCallPayReportDataAttributes.endDate) && + Objects.equals(this.scheduleIds, updateOnCallPayReportDataAttributes.scheduleIds); + } + + @Override + public int hashCode() { + return Objects.hash(startDate, endDate, scheduleIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateOnCallPayReportDataAttributes {\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" scheduleIds: ").append(toIndentedString(scheduleIds)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("start_date"); + openapiFields.add("end_date"); + openapiFields.add("schedule_ids"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateOnCallPayReportDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateOnCallPayReportDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateOnCallPayReportDataAttributes is not found in the empty JSON string", UpdateOnCallPayReportDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateOnCallPayReportDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateOnCallPayReportDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("schedule_ids") != null && !jsonObj.get("schedule_ids").isJsonNull() && !jsonObj.get("schedule_ids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `schedule_ids` to be an array in the JSON string but got `%s`", jsonObj.get("schedule_ids").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateOnCallPayReportDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateOnCallPayReportDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateOnCallPayReportDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateOnCallPayReportDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateOnCallPayReportDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateOnCallPayReportDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateOnCallPayReportDataAttributes + * @throws IOException if the JSON string is invalid with respect to UpdateOnCallPayReportDataAttributes + */ + public static UpdateOnCallPayReportDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateOnCallPayReportDataAttributes.class); + } + + /** + * Convert an instance of UpdateOnCallPayReportDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateSla.java b/src/main/java/com/rootly/client/model/UpdateSla.java new file mode 100644 index 00000000..7f8c7959 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateSla.java @@ -0,0 +1,214 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateSlaData; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateSla + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateSla { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private UpdateSlaData data; + + public UpdateSla() { + } + + public UpdateSla data(@javax.annotation.Nonnull UpdateSlaData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public UpdateSlaData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull UpdateSlaData data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSla updateSla = (UpdateSla) o; + return Objects.equals(this.data, updateSla.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSla {\n"); + sb.append(" data: ").append(toIndentedString(data)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSla + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSla.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSla is not found in the empty JSON string", UpdateSla.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSla.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSla` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSla.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the required field `data` + UpdateSlaData.validateJsonElement(jsonObj.get("data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSla.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSla' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSla.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSla value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSla read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSla given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSla + * @throws IOException if the JSON string is invalid with respect to UpdateSla + */ + public static UpdateSla fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSla.class); + } + + /** + * Convert an instance of UpdateSla to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateSlaData.java b/src/main/java/com/rootly/client/model/UpdateSlaData.java new file mode 100644 index 00000000..ca5b5066 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateSlaData.java @@ -0,0 +1,297 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateSlaDataAttributes; +import java.io.IOException; +import java.util.Arrays; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateSlaData + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateSlaData { + /** + * Gets or Sets type + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SLAS("slas"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nonnull + private UpdateSlaDataAttributes attributes; + + public UpdateSlaData() { + } + + public UpdateSlaData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public UpdateSlaData attributes(@javax.annotation.Nonnull UpdateSlaDataAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nonnull + public UpdateSlaDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nonnull UpdateSlaDataAttributes attributes) { + this.attributes = attributes; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSlaData updateSlaData = (UpdateSlaData) o; + return Objects.equals(this.type, updateSlaData.type) && + Objects.equals(this.attributes, updateSlaData.attributes); + } + + @Override + public int hashCode() { + return Objects.hash(type, attributes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSlaData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("type"); + openapiFields.add("attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("attributes"); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSlaData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSlaData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSlaData is not found in the empty JSON string", UpdateSlaData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSlaData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSlaData` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateSlaData.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the required field `attributes` + UpdateSlaDataAttributes.validateJsonElement(jsonObj.get("attributes")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSlaData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSlaData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSlaData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSlaData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSlaData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSlaData given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSlaData + * @throws IOException if the JSON string is invalid with respect to UpdateSlaData + */ + public static UpdateSlaData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSlaData.class); + } + + /** + * Convert an instance of UpdateSlaData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/rootly/client/model/UpdateSlaDataAttributes.java b/src/main/java/com/rootly/client/model/UpdateSlaDataAttributes.java new file mode 100644 index 00000000..7faaa585 --- /dev/null +++ b/src/main/java/com/rootly/client/model/UpdateSlaDataAttributes.java @@ -0,0 +1,1021 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaDataAttributesConditionsInner; +import com.rootly.client.model.NewSlaDataAttributesNotificationConfigurationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.rootly.client.JSON; + +/** + * UpdateSlaDataAttributes + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-05-07T08:36:28.586343560Z[Etc/UTC]", comments = "Generator version: 7.13.0") +public class UpdateSlaDataAttributes { + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_POSITION = "position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private Integer position; + + /** + * Whether all or any conditions must match + */ + @JsonAdapter(ConditionMatchTypeEnum.Adapter.class) + public enum ConditionMatchTypeEnum { + ALL("ALL"), + + ANY("ANY"); + + private String value; + + ConditionMatchTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConditionMatchTypeEnum fromValue(String value) { + for (ConditionMatchTypeEnum b : ConditionMatchTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ConditionMatchTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConditionMatchTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConditionMatchTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConditionMatchTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONDITION_MATCH_TYPE = "condition_match_type"; + @SerializedName(SERIALIZED_NAME_CONDITION_MATCH_TYPE) + @javax.annotation.Nullable + private ConditionMatchTypeEnum conditionMatchType; + + public static final String SERIALIZED_NAME_MANAGER_ROLE_ID = "manager_role_id"; + @SerializedName(SERIALIZED_NAME_MANAGER_ROLE_ID) + @javax.annotation.Nullable + private UUID managerRoleId; + + public static final String SERIALIZED_NAME_MANAGER_USER_ID = "manager_user_id"; + @SerializedName(SERIALIZED_NAME_MANAGER_USER_ID) + @javax.annotation.Nullable + private Integer managerUserId; + + /** + * Number of days for the assignment deadline + */ + @JsonAdapter(AssignmentDeadlineDaysEnum.Adapter.class) + public enum AssignmentDeadlineDaysEnum { + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7), + + NUMBER_14(14), + + NUMBER_21(21), + + NUMBER_30(30); + + private Integer value; + + AssignmentDeadlineDaysEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssignmentDeadlineDaysEnum fromValue(Integer value) { + for (AssignmentDeadlineDaysEnum b : AssignmentDeadlineDaysEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AssignmentDeadlineDaysEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssignmentDeadlineDaysEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return AssignmentDeadlineDaysEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + Integer value = jsonElement.getAsInt(); + AssignmentDeadlineDaysEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_DAYS = "assignment_deadline_days"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_DAYS) + @javax.annotation.Nullable + private AssignmentDeadlineDaysEnum assignmentDeadlineDays; + + /** + * The incident parent status that triggers the assignment deadline + */ + @JsonAdapter(AssignmentDeadlineParentStatusEnum.Adapter.class) + public enum AssignmentDeadlineParentStatusEnum { + IN_TRIAGE("in_triage"), + + STARTED("started"), + + MITIGATED("mitigated"), + + RESOLVED("resolved"), + + CLOSED("closed"), + + CANCELLED("cancelled"); + + private String value; + + AssignmentDeadlineParentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AssignmentDeadlineParentStatusEnum fromValue(String value) { + for (AssignmentDeadlineParentStatusEnum b : AssignmentDeadlineParentStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AssignmentDeadlineParentStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AssignmentDeadlineParentStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AssignmentDeadlineParentStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AssignmentDeadlineParentStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_PARENT_STATUS = "assignment_deadline_parent_status"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_PARENT_STATUS) + @javax.annotation.Nullable + private AssignmentDeadlineParentStatusEnum assignmentDeadlineParentStatus; + + public static final String SERIALIZED_NAME_ASSIGNMENT_DEADLINE_SUB_STATUS_ID = "assignment_deadline_sub_status_id"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_DEADLINE_SUB_STATUS_ID) + @javax.annotation.Nullable + private UUID assignmentDeadlineSubStatusId; + + public static final String SERIALIZED_NAME_ASSIGNMENT_SKIP_WEEKENDS = "assignment_skip_weekends"; + @SerializedName(SERIALIZED_NAME_ASSIGNMENT_SKIP_WEEKENDS) + @javax.annotation.Nullable + private Boolean assignmentSkipWeekends; + + /** + * Number of days for the completion deadline + */ + @JsonAdapter(CompletionDeadlineDaysEnum.Adapter.class) + public enum CompletionDeadlineDaysEnum { + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6), + + NUMBER_7(7), + + NUMBER_14(14), + + NUMBER_21(21), + + NUMBER_30(30); + + private Integer value; + + CompletionDeadlineDaysEnum(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CompletionDeadlineDaysEnum fromValue(Integer value) { + for (CompletionDeadlineDaysEnum b : CompletionDeadlineDaysEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CompletionDeadlineDaysEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CompletionDeadlineDaysEnum read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return CompletionDeadlineDaysEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + Integer value = jsonElement.getAsInt(); + CompletionDeadlineDaysEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_DAYS = "completion_deadline_days"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_DAYS) + @javax.annotation.Nullable + private CompletionDeadlineDaysEnum completionDeadlineDays; + + /** + * The incident parent status that triggers the completion deadline + */ + @JsonAdapter(CompletionDeadlineParentStatusEnum.Adapter.class) + public enum CompletionDeadlineParentStatusEnum { + IN_TRIAGE("in_triage"), + + STARTED("started"), + + MITIGATED("mitigated"), + + RESOLVED("resolved"), + + CLOSED("closed"), + + CANCELLED("cancelled"); + + private String value; + + CompletionDeadlineParentStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CompletionDeadlineParentStatusEnum fromValue(String value) { + for (CompletionDeadlineParentStatusEnum b : CompletionDeadlineParentStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CompletionDeadlineParentStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CompletionDeadlineParentStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CompletionDeadlineParentStatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CompletionDeadlineParentStatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_PARENT_STATUS = "completion_deadline_parent_status"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_PARENT_STATUS) + @javax.annotation.Nullable + private CompletionDeadlineParentStatusEnum completionDeadlineParentStatus; + + public static final String SERIALIZED_NAME_COMPLETION_DEADLINE_SUB_STATUS_ID = "completion_deadline_sub_status_id"; + @SerializedName(SERIALIZED_NAME_COMPLETION_DEADLINE_SUB_STATUS_ID) + @javax.annotation.Nullable + private UUID completionDeadlineSubStatusId; + + public static final String SERIALIZED_NAME_COMPLETION_SKIP_WEEKENDS = "completion_skip_weekends"; + @SerializedName(SERIALIZED_NAME_COMPLETION_SKIP_WEEKENDS) + @javax.annotation.Nullable + private Boolean completionSkipWeekends; + + public static final String SERIALIZED_NAME_CONDITIONS = "conditions"; + @SerializedName(SERIALIZED_NAME_CONDITIONS) + @javax.annotation.Nullable + private List conditions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOTIFICATION_CONFIGURATIONS = "notification_configurations"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_CONFIGURATIONS) + @javax.annotation.Nullable + private List notificationConfigurations = new ArrayList<>(); + + public UpdateSlaDataAttributes() { + } + + public UpdateSlaDataAttributes name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the SLA + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateSlaDataAttributes description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the SLA + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UpdateSlaDataAttributes position(@javax.annotation.Nullable Integer position) { + this.position = position; + return this; + } + + /** + * Position of the SLA for ordering + * @return position + */ + @javax.annotation.Nullable + public Integer getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable Integer position) { + this.position = position; + } + + + public UpdateSlaDataAttributes conditionMatchType(@javax.annotation.Nullable ConditionMatchTypeEnum conditionMatchType) { + this.conditionMatchType = conditionMatchType; + return this; + } + + /** + * Whether all or any conditions must match + * @return conditionMatchType + */ + @javax.annotation.Nullable + public ConditionMatchTypeEnum getConditionMatchType() { + return conditionMatchType; + } + + public void setConditionMatchType(@javax.annotation.Nullable ConditionMatchTypeEnum conditionMatchType) { + this.conditionMatchType = conditionMatchType; + } + + + public UpdateSlaDataAttributes managerRoleId(@javax.annotation.Nullable UUID managerRoleId) { + this.managerRoleId = managerRoleId; + return this; + } + + /** + * The ID of the incident role responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. + * @return managerRoleId + */ + @javax.annotation.Nullable + public UUID getManagerRoleId() { + return managerRoleId; + } + + public void setManagerRoleId(@javax.annotation.Nullable UUID managerRoleId) { + this.managerRoleId = managerRoleId; + } + + + public UpdateSlaDataAttributes managerUserId(@javax.annotation.Nullable Integer managerUserId) { + this.managerUserId = managerUserId; + return this; + } + + /** + * The ID of the user responsible for this SLA. Exactly one of `manager_role_id` or `manager_user_id` must be provided. + * @return managerUserId + */ + @javax.annotation.Nullable + public Integer getManagerUserId() { + return managerUserId; + } + + public void setManagerUserId(@javax.annotation.Nullable Integer managerUserId) { + this.managerUserId = managerUserId; + } + + + public UpdateSlaDataAttributes assignmentDeadlineDays(@javax.annotation.Nullable AssignmentDeadlineDaysEnum assignmentDeadlineDays) { + this.assignmentDeadlineDays = assignmentDeadlineDays; + return this; + } + + /** + * Number of days for the assignment deadline + * @return assignmentDeadlineDays + */ + @javax.annotation.Nullable + public AssignmentDeadlineDaysEnum getAssignmentDeadlineDays() { + return assignmentDeadlineDays; + } + + public void setAssignmentDeadlineDays(@javax.annotation.Nullable AssignmentDeadlineDaysEnum assignmentDeadlineDays) { + this.assignmentDeadlineDays = assignmentDeadlineDays; + } + + + public UpdateSlaDataAttributes assignmentDeadlineParentStatus(@javax.annotation.Nullable AssignmentDeadlineParentStatusEnum assignmentDeadlineParentStatus) { + this.assignmentDeadlineParentStatus = assignmentDeadlineParentStatus; + return this; + } + + /** + * The incident parent status that triggers the assignment deadline + * @return assignmentDeadlineParentStatus + */ + @javax.annotation.Nullable + public AssignmentDeadlineParentStatusEnum getAssignmentDeadlineParentStatus() { + return assignmentDeadlineParentStatus; + } + + public void setAssignmentDeadlineParentStatus(@javax.annotation.Nullable AssignmentDeadlineParentStatusEnum assignmentDeadlineParentStatus) { + this.assignmentDeadlineParentStatus = assignmentDeadlineParentStatus; + } + + + public UpdateSlaDataAttributes assignmentDeadlineSubStatusId(@javax.annotation.Nullable UUID assignmentDeadlineSubStatusId) { + this.assignmentDeadlineSubStatusId = assignmentDeadlineSubStatusId; + return this; + } + + /** + * Sub-status for the assignment deadline. Required when custom lifecycle statuses are enabled on the team. + * @return assignmentDeadlineSubStatusId + */ + @javax.annotation.Nullable + public UUID getAssignmentDeadlineSubStatusId() { + return assignmentDeadlineSubStatusId; + } + + public void setAssignmentDeadlineSubStatusId(@javax.annotation.Nullable UUID assignmentDeadlineSubStatusId) { + this.assignmentDeadlineSubStatusId = assignmentDeadlineSubStatusId; + } + + + public UpdateSlaDataAttributes assignmentSkipWeekends(@javax.annotation.Nullable Boolean assignmentSkipWeekends) { + this.assignmentSkipWeekends = assignmentSkipWeekends; + return this; + } + + /** + * Whether to skip weekends when calculating the assignment deadline + * @return assignmentSkipWeekends + */ + @javax.annotation.Nullable + public Boolean getAssignmentSkipWeekends() { + return assignmentSkipWeekends; + } + + public void setAssignmentSkipWeekends(@javax.annotation.Nullable Boolean assignmentSkipWeekends) { + this.assignmentSkipWeekends = assignmentSkipWeekends; + } + + + public UpdateSlaDataAttributes completionDeadlineDays(@javax.annotation.Nullable CompletionDeadlineDaysEnum completionDeadlineDays) { + this.completionDeadlineDays = completionDeadlineDays; + return this; + } + + /** + * Number of days for the completion deadline + * @return completionDeadlineDays + */ + @javax.annotation.Nullable + public CompletionDeadlineDaysEnum getCompletionDeadlineDays() { + return completionDeadlineDays; + } + + public void setCompletionDeadlineDays(@javax.annotation.Nullable CompletionDeadlineDaysEnum completionDeadlineDays) { + this.completionDeadlineDays = completionDeadlineDays; + } + + + public UpdateSlaDataAttributes completionDeadlineParentStatus(@javax.annotation.Nullable CompletionDeadlineParentStatusEnum completionDeadlineParentStatus) { + this.completionDeadlineParentStatus = completionDeadlineParentStatus; + return this; + } + + /** + * The incident parent status that triggers the completion deadline + * @return completionDeadlineParentStatus + */ + @javax.annotation.Nullable + public CompletionDeadlineParentStatusEnum getCompletionDeadlineParentStatus() { + return completionDeadlineParentStatus; + } + + public void setCompletionDeadlineParentStatus(@javax.annotation.Nullable CompletionDeadlineParentStatusEnum completionDeadlineParentStatus) { + this.completionDeadlineParentStatus = completionDeadlineParentStatus; + } + + + public UpdateSlaDataAttributes completionDeadlineSubStatusId(@javax.annotation.Nullable UUID completionDeadlineSubStatusId) { + this.completionDeadlineSubStatusId = completionDeadlineSubStatusId; + return this; + } + + /** + * Sub-status for the completion deadline. Required when custom lifecycle statuses are enabled on the team. + * @return completionDeadlineSubStatusId + */ + @javax.annotation.Nullable + public UUID getCompletionDeadlineSubStatusId() { + return completionDeadlineSubStatusId; + } + + public void setCompletionDeadlineSubStatusId(@javax.annotation.Nullable UUID completionDeadlineSubStatusId) { + this.completionDeadlineSubStatusId = completionDeadlineSubStatusId; + } + + + public UpdateSlaDataAttributes completionSkipWeekends(@javax.annotation.Nullable Boolean completionSkipWeekends) { + this.completionSkipWeekends = completionSkipWeekends; + return this; + } + + /** + * Whether to skip weekends when calculating the completion deadline + * @return completionSkipWeekends + */ + @javax.annotation.Nullable + public Boolean getCompletionSkipWeekends() { + return completionSkipWeekends; + } + + public void setCompletionSkipWeekends(@javax.annotation.Nullable Boolean completionSkipWeekends) { + this.completionSkipWeekends = completionSkipWeekends; + } + + + public UpdateSlaDataAttributes conditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + return this; + } + + public UpdateSlaDataAttributes addConditionsItem(NewSlaDataAttributesConditionsInner conditionsItem) { + if (this.conditions == null) { + this.conditions = new ArrayList<>(); + } + this.conditions.add(conditionsItem); + return this; + } + + /** + * Conditions that determine which incidents this SLA applies to. Replaces all existing conditions. + * @return conditions + */ + @javax.annotation.Nullable + public List getConditions() { + return conditions; + } + + public void setConditions(@javax.annotation.Nullable List conditions) { + this.conditions = conditions; + } + + + public UpdateSlaDataAttributes notificationConfigurations(@javax.annotation.Nullable List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + return this; + } + + public UpdateSlaDataAttributes addNotificationConfigurationsItem(NewSlaDataAttributesNotificationConfigurationsInner notificationConfigurationsItem) { + if (this.notificationConfigurations == null) { + this.notificationConfigurations = new ArrayList<>(); + } + this.notificationConfigurations.add(notificationConfigurationsItem); + return this; + } + + /** + * Notification timing configurations. Replaces all existing configurations. + * @return notificationConfigurations + */ + @javax.annotation.Nullable + public List getNotificationConfigurations() { + return notificationConfigurations; + } + + public void setNotificationConfigurations(@javax.annotation.Nullable List notificationConfigurations) { + this.notificationConfigurations = notificationConfigurations; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSlaDataAttributes updateSlaDataAttributes = (UpdateSlaDataAttributes) o; + return Objects.equals(this.name, updateSlaDataAttributes.name) && + Objects.equals(this.description, updateSlaDataAttributes.description) && + Objects.equals(this.position, updateSlaDataAttributes.position) && + Objects.equals(this.conditionMatchType, updateSlaDataAttributes.conditionMatchType) && + Objects.equals(this.managerRoleId, updateSlaDataAttributes.managerRoleId) && + Objects.equals(this.managerUserId, updateSlaDataAttributes.managerUserId) && + Objects.equals(this.assignmentDeadlineDays, updateSlaDataAttributes.assignmentDeadlineDays) && + Objects.equals(this.assignmentDeadlineParentStatus, updateSlaDataAttributes.assignmentDeadlineParentStatus) && + Objects.equals(this.assignmentDeadlineSubStatusId, updateSlaDataAttributes.assignmentDeadlineSubStatusId) && + Objects.equals(this.assignmentSkipWeekends, updateSlaDataAttributes.assignmentSkipWeekends) && + Objects.equals(this.completionDeadlineDays, updateSlaDataAttributes.completionDeadlineDays) && + Objects.equals(this.completionDeadlineParentStatus, updateSlaDataAttributes.completionDeadlineParentStatus) && + Objects.equals(this.completionDeadlineSubStatusId, updateSlaDataAttributes.completionDeadlineSubStatusId) && + Objects.equals(this.completionSkipWeekends, updateSlaDataAttributes.completionSkipWeekends) && + Objects.equals(this.conditions, updateSlaDataAttributes.conditions) && + Objects.equals(this.notificationConfigurations, updateSlaDataAttributes.notificationConfigurations); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, position, conditionMatchType, managerRoleId, managerUserId, assignmentDeadlineDays, assignmentDeadlineParentStatus, assignmentDeadlineSubStatusId, assignmentSkipWeekends, completionDeadlineDays, completionDeadlineParentStatus, completionDeadlineSubStatusId, completionSkipWeekends, conditions, notificationConfigurations); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSlaDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" conditionMatchType: ").append(toIndentedString(conditionMatchType)).append("\n"); + sb.append(" managerRoleId: ").append(toIndentedString(managerRoleId)).append("\n"); + sb.append(" managerUserId: ").append(toIndentedString(managerUserId)).append("\n"); + sb.append(" assignmentDeadlineDays: ").append(toIndentedString(assignmentDeadlineDays)).append("\n"); + sb.append(" assignmentDeadlineParentStatus: ").append(toIndentedString(assignmentDeadlineParentStatus)).append("\n"); + sb.append(" assignmentDeadlineSubStatusId: ").append(toIndentedString(assignmentDeadlineSubStatusId)).append("\n"); + sb.append(" assignmentSkipWeekends: ").append(toIndentedString(assignmentSkipWeekends)).append("\n"); + sb.append(" completionDeadlineDays: ").append(toIndentedString(completionDeadlineDays)).append("\n"); + sb.append(" completionDeadlineParentStatus: ").append(toIndentedString(completionDeadlineParentStatus)).append("\n"); + sb.append(" completionDeadlineSubStatusId: ").append(toIndentedString(completionDeadlineSubStatusId)).append("\n"); + sb.append(" completionSkipWeekends: ").append(toIndentedString(completionSkipWeekends)).append("\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" notificationConfigurations: ").append(toIndentedString(notificationConfigurations)).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 "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("name"); + openapiFields.add("description"); + openapiFields.add("position"); + openapiFields.add("condition_match_type"); + openapiFields.add("manager_role_id"); + openapiFields.add("manager_user_id"); + openapiFields.add("assignment_deadline_days"); + openapiFields.add("assignment_deadline_parent_status"); + openapiFields.add("assignment_deadline_sub_status_id"); + openapiFields.add("assignment_skip_weekends"); + openapiFields.add("completion_deadline_days"); + openapiFields.add("completion_deadline_parent_status"); + openapiFields.add("completion_deadline_sub_status_id"); + openapiFields.add("completion_skip_weekends"); + openapiFields.add("conditions"); + openapiFields.add("notification_configurations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to UpdateSlaDataAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSlaDataAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSlaDataAttributes is not found in the empty JSON string", UpdateSlaDataAttributes.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UpdateSlaDataAttributes.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateSlaDataAttributes` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + if ((jsonObj.get("condition_match_type") != null && !jsonObj.get("condition_match_type").isJsonNull()) && !jsonObj.get("condition_match_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `condition_match_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("condition_match_type").toString())); + } + // validate the optional field `condition_match_type` + if (jsonObj.get("condition_match_type") != null && !jsonObj.get("condition_match_type").isJsonNull()) { + ConditionMatchTypeEnum.validateJsonElement(jsonObj.get("condition_match_type")); + } + if ((jsonObj.get("manager_role_id") != null && !jsonObj.get("manager_role_id").isJsonNull()) && !jsonObj.get("manager_role_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `manager_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manager_role_id").toString())); + } + // validate the optional field `assignment_deadline_days` + if (jsonObj.get("assignment_deadline_days") != null && !jsonObj.get("assignment_deadline_days").isJsonNull()) { + AssignmentDeadlineDaysEnum.validateJsonElement(jsonObj.get("assignment_deadline_days")); + } + if ((jsonObj.get("assignment_deadline_parent_status") != null && !jsonObj.get("assignment_deadline_parent_status").isJsonNull()) && !jsonObj.get("assignment_deadline_parent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assignment_deadline_parent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assignment_deadline_parent_status").toString())); + } + // validate the optional field `assignment_deadline_parent_status` + if (jsonObj.get("assignment_deadline_parent_status") != null && !jsonObj.get("assignment_deadline_parent_status").isJsonNull()) { + AssignmentDeadlineParentStatusEnum.validateJsonElement(jsonObj.get("assignment_deadline_parent_status")); + } + if ((jsonObj.get("assignment_deadline_sub_status_id") != null && !jsonObj.get("assignment_deadline_sub_status_id").isJsonNull()) && !jsonObj.get("assignment_deadline_sub_status_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `assignment_deadline_sub_status_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assignment_deadline_sub_status_id").toString())); + } + // validate the optional field `completion_deadline_days` + if (jsonObj.get("completion_deadline_days") != null && !jsonObj.get("completion_deadline_days").isJsonNull()) { + CompletionDeadlineDaysEnum.validateJsonElement(jsonObj.get("completion_deadline_days")); + } + if ((jsonObj.get("completion_deadline_parent_status") != null && !jsonObj.get("completion_deadline_parent_status").isJsonNull()) && !jsonObj.get("completion_deadline_parent_status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completion_deadline_parent_status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completion_deadline_parent_status").toString())); + } + // validate the optional field `completion_deadline_parent_status` + if (jsonObj.get("completion_deadline_parent_status") != null && !jsonObj.get("completion_deadline_parent_status").isJsonNull()) { + CompletionDeadlineParentStatusEnum.validateJsonElement(jsonObj.get("completion_deadline_parent_status")); + } + if ((jsonObj.get("completion_deadline_sub_status_id") != null && !jsonObj.get("completion_deadline_sub_status_id").isJsonNull()) && !jsonObj.get("completion_deadline_sub_status_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `completion_deadline_sub_status_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("completion_deadline_sub_status_id").toString())); + } + if (jsonObj.get("conditions") != null && !jsonObj.get("conditions").isJsonNull()) { + JsonArray jsonArrayconditions = jsonObj.getAsJsonArray("conditions"); + if (jsonArrayconditions != null) { + // ensure the json data is an array + if (!jsonObj.get("conditions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `conditions` to be an array in the JSON string but got `%s`", jsonObj.get("conditions").toString())); + } + + // validate the optional field `conditions` (array) + for (int i = 0; i < jsonArrayconditions.size(); i++) { + NewSlaDataAttributesConditionsInner.validateJsonElement(jsonArrayconditions.get(i)); + }; + } + } + if (jsonObj.get("notification_configurations") != null && !jsonObj.get("notification_configurations").isJsonNull()) { + JsonArray jsonArraynotificationConfigurations = jsonObj.getAsJsonArray("notification_configurations"); + if (jsonArraynotificationConfigurations != null) { + // ensure the json data is an array + if (!jsonObj.get("notification_configurations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `notification_configurations` to be an array in the JSON string but got `%s`", jsonObj.get("notification_configurations").toString())); + } + + // validate the optional field `notification_configurations` (array) + for (int i = 0; i < jsonArraynotificationConfigurations.size(); i++) { + NewSlaDataAttributesNotificationConfigurationsInner.validateJsonElement(jsonArraynotificationConfigurations.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdateSlaDataAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSlaDataAttributes' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSlaDataAttributes.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdateSlaDataAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdateSlaDataAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSlaDataAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSlaDataAttributes + * @throws IOException if the JSON string is invalid with respect to UpdateSlaDataAttributes + */ + public static UpdateSlaDataAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSlaDataAttributes.class); + } + + /** + * Convert an instance of UpdateSlaDataAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/test/java/com/rootly/client/api/ApiKeysApiTest.java b/src/test/java/com/rootly/client/api/ApiKeysApiTest.java new file mode 100644 index 00000000..b78b69af --- /dev/null +++ b/src/test/java/com/rootly/client/api/ApiKeysApiTest.java @@ -0,0 +1,151 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.ApiKeyList; +import com.rootly.client.model.ApiKeyResponse; +import com.rootly.client.model.ApiKeyWithTokenResponse; +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.NewApiKey; +import com.rootly.client.model.RotateApiKey; +import java.util.UUID; +import com.rootly.client.model.UpdateApiKey; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for ApiKeysApi + */ +@Disabled +public class ApiKeysApiTest { + + private final ApiKeysApi api = new ApiKeysApi(); + + /** + * Creates an API key + * + * Creates a new API key and returns it with the plaintext token. **The token is only returned once** — store it securely, as it cannot be retrieved again. **Kinds and required fields:** - `personal` — created for the authenticated user. No additional fields required. - `team` — scoped to a team (group). Requires `group_id`. A service account is automatically created with permissions derived from group membership. - `organization` — organization-wide access. Requires owner or admin role. Optionally set `role_id` and `on_call_role_id` to control the service account's permissions. **Expiration:** All keys require an `expires_at` date set in the future (maximum 5 years). Names must be unique within their kind and scope. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createApiKeyTest() throws ApiException { + NewApiKey newApiKey = null; + ApiKeyWithTokenResponse response = api.createApiKey(newApiKey); + // TODO: test validations + } + + /** + * Revoke an API key + * + * Revoke an API key. The key is immediately invalidated and can no longer be used for authentication. This action cannot be undone. For `team` and `organization` keys, the associated service account is also deleted. Any active sessions using this key will fail on the next request. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteApiKeyTest() throws ApiException { + UUID id = null; + ApiKeyResponse response = api.deleteApiKey(id); + // TODO: test validations + } + + /** + * Retrieves an API key + * + * Retrieves a specific API key by its UUID. Returns key metadata including name, kind, expiration, last usage timestamp, and the grace period status — the secret token is never included. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getApiKeyTest() throws ApiException { + UUID id = null; + String include = null; + ApiKeyResponse response = api.getApiKey(id, include); + // TODO: test validations + } + + /** + * List API keys + * + * List API keys for the current organization. Returns key metadata including name, kind, expiration, and last usage — the secret token value is never included in the response. **API key kinds:** - `personal` — tied to a specific user, inherits that user's permissions. - `team` — scoped to one or more teams (groups), creates a service account with permissions derived from group membership. - `organization` — organization-wide, creates a service account with a configurable role and on-call role. **Automated rotation workflow:** Use `filter[expires_at][lt]` to find keys approaching expiration, then call the rotate endpoint to issue a new token before the old one expires. Combine with `filter[active]=true` to exclude already-expired keys. **Sorting:** Use the `sort` parameter with a field name (e.g., `sort=expires_at`). Prefix with `-` for descending order (e.g., `sort=-created_at`). Allowed fields: `name`, `kind`, `created_at`, `updated_at`, `expires_at`, `last_used_at`. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listApiKeysTest() throws ApiException { + String include = null; + Integer pageNumber = null; + Integer pageSize = null; + String filterKind = null; + String filterSearch = null; + String filterName = null; + String filterUserId = null; + String filterGroupIds = null; + String filterRoleId = null; + Boolean filterActive = null; + Boolean filterExpired = null; + String filterCreatedAtGt = null; + String filterCreatedAtGte = null; + String filterCreatedAtLt = null; + String filterCreatedAtLte = null; + String filterExpiresAtGt = null; + String filterExpiresAtGte = null; + String filterExpiresAtLt = null; + String filterExpiresAtLte = null; + String filterLastUsedAtGt = null; + String filterLastUsedAtGte = null; + String filterLastUsedAtLt = null; + String filterLastUsedAtLte = null; + String sort = null; + ApiKeyList response = api.listApiKeys(include, pageNumber, pageSize, filterKind, filterSearch, filterName, filterUserId, filterGroupIds, filterRoleId, filterActive, filterExpired, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, filterExpiresAtGt, filterExpiresAtGte, filterExpiresAtLt, filterExpiresAtLte, filterLastUsedAtGt, filterLastUsedAtGte, filterLastUsedAtLt, filterLastUsedAtLte, sort); + // TODO: test validations + } + + /** + * Rotate an API key + * + * Rotate an API key's token. Issues a new secret token and returns it — **the new token is only shown once**, so store it securely. **Self-only:** You can only rotate the API key that was used to authenticate this request. Attempting to rotate a different key returns `403 Forbidden`. **Grace period:** When enabled for your organization, the previous token remains valid after rotation, giving you time to deploy the new token without downtime. Pass `grace_period_minutes` (integer, 0–1440, default 30) to control how long the old token stays valid. Set to 0 to immediately invalidate the old token. The `grace_period_ends_at` field in the response confirms the exact time the old token will stop working. **Expiration:** Optionally provide a new `expires_at` date (ISO 8601, up to 5 years). Defaults to 90 days from now if omitted. Dates in the past are rejected. **Typical rotation workflow:** 1. Call this endpoint to get a new token (optionally with a custom `grace_period_minutes`). 2. Deploy the new token to your systems. 3. The old token continues working for `grace_period_minutes` (if grace period is enabled). 4. After the grace period, the old token is automatically invalidated. + * + * @throws ApiException if the Api call fails + */ + @Test + public void rotateApiKeyTest() throws ApiException { + String id = null; + RotateApiKey rotateApiKey = null; + ApiKeyWithTokenResponse response = api.rotateApiKey(id, rotateApiKey); + // TODO: test validations + } + + /** + * Update an API key + * + * Update an API key's mutable attributes: `name`, `description`, and `expires_at`. The key's `kind`, `role_id`, `on_call_role_id`, and token cannot be changed after creation. To issue a new token, use the rotate endpoint. To change the role or kind, revoke the key and create a new one. The new `expires_at` must be in the future and within 5 years. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateApiKeyTest() throws ApiException { + UUID id = null; + UpdateApiKey updateApiKey = null; + ApiKeyResponse response = api.updateApiKey(id, updateApiKey); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/CatalogChecklistTemplatesApiTest.java b/src/test/java/com/rootly/client/api/CatalogChecklistTemplatesApiTest.java new file mode 100644 index 00000000..73ab69fc --- /dev/null +++ b/src/test/java/com/rootly/client/api/CatalogChecklistTemplatesApiTest.java @@ -0,0 +1,135 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.CatalogChecklistTemplateList; +import com.rootly.client.model.CatalogChecklistTemplateResponse; +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.GetAlertFieldIdParameter; +import com.rootly.client.model.NewCatalogChecklistTemplate; +import com.rootly.client.model.UpdateCatalogChecklistTemplate; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for CatalogChecklistTemplatesApi + */ +@Disabled +public class CatalogChecklistTemplatesApiTest { + + private final CatalogChecklistTemplatesApi api = new CatalogChecklistTemplatesApi(); + + /** + * Creates a catalog checklist template + * + * Creates a new catalog checklist template + * + * @throws ApiException if the Api call fails + */ + @Test + public void createCatalogChecklistTemplateTest() throws ApiException { + NewCatalogChecklistTemplate newCatalogChecklistTemplate = null; + CatalogChecklistTemplateResponse response = api.createCatalogChecklistTemplate(newCatalogChecklistTemplate); + // TODO: test validations + } + + /** + * Delete a catalog checklist template + * + * Delete a specific catalog checklist template by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteCatalogChecklistTemplateTest() throws ApiException { + GetAlertFieldIdParameter id = null; + CatalogChecklistTemplateResponse response = api.deleteCatalogChecklistTemplate(id); + // TODO: test validations + } + + /** + * Retrieves a catalog checklist template + * + * Retrieves a specific catalog checklist template by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCatalogChecklistTemplateTest() throws ApiException { + GetAlertFieldIdParameter id = null; + CatalogChecklistTemplateResponse response = api.getCatalogChecklistTemplate(id); + // TODO: test validations + } + + /** + * List catalog checklist templates + * + * List catalog checklist templates + * + * @throws ApiException if the Api call fails + */ + @Test + public void listCatalogChecklistTemplatesTest() throws ApiException { + String include = null; + String sort = null; + Integer pageNumber = null; + Integer pageSize = null; + String filterName = null; + String filterSlug = null; + String filterCatalogType = null; + String filterScopeType = null; + String filterCreatedAtGt = null; + String filterCreatedAtGte = null; + String filterCreatedAtLt = null; + String filterCreatedAtLte = null; + CatalogChecklistTemplateList response = api.listCatalogChecklistTemplates(include, sort, pageNumber, pageSize, filterName, filterSlug, filterCatalogType, filterScopeType, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + // TODO: test validations + } + + /** + * Trigger an audit for a catalog checklist template + * + * Triggers an audit for all applicable entities of the checklist template + * + * @throws ApiException if the Api call fails + */ + @Test + public void triggerCatalogChecklistTemplateTest() throws ApiException { + GetAlertFieldIdParameter id = null; + api.triggerCatalogChecklistTemplate(id); + // TODO: test validations + } + + /** + * Update a catalog checklist template + * + * Update a specific catalog checklist template by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateCatalogChecklistTemplateTest() throws ApiException { + GetAlertFieldIdParameter id = null; + UpdateCatalogChecklistTemplate updateCatalogChecklistTemplate = null; + CatalogChecklistTemplateResponse response = api.updateCatalogChecklistTemplate(id, updateCatalogChecklistTemplate); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/CatalogEntityChecklistsApiTest.java b/src/test/java/com/rootly/client/api/CatalogEntityChecklistsApiTest.java new file mode 100644 index 00000000..ae7a1b31 --- /dev/null +++ b/src/test/java/com/rootly/client/api/CatalogEntityChecklistsApiTest.java @@ -0,0 +1,74 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.CatalogEntityChecklistList; +import com.rootly.client.model.CatalogEntityChecklistResponse; +import com.rootly.client.model.ErrorsList; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for CatalogEntityChecklistsApi + */ +@Disabled +public class CatalogEntityChecklistsApiTest { + + private final CatalogEntityChecklistsApi api = new CatalogEntityChecklistsApi(); + + /** + * Retrieves a catalog entity checklist + * + * Retrieves a specific catalog entity checklist by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCatalogEntityChecklistTest() throws ApiException { + UUID id = null; + CatalogEntityChecklistResponse response = api.getCatalogEntityChecklist(id); + // TODO: test validations + } + + /** + * List catalog entity checklists + * + * List catalog entity checklists + * + * @throws ApiException if the Api call fails + */ + @Test + public void listCatalogEntityChecklistsTest() throws ApiException { + Integer pageNumber = null; + Integer pageSize = null; + String filterStatus = null; + String filterCatalogChecklistTemplateId = null; + String filterAuditableType = null; + String filterAuditableId = null; + String filterCreatedAtGt = null; + String filterCreatedAtGte = null; + String filterCreatedAtLt = null; + String filterCreatedAtLte = null; + CatalogEntityChecklistList response = api.listCatalogEntityChecklists(pageNumber, pageSize, filterStatus, filterCatalogChecklistTemplateId, filterAuditableType, filterAuditableId, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/CatalogPropertiesApiTest.java b/src/test/java/com/rootly/client/api/CatalogPropertiesApiTest.java new file mode 100644 index 00000000..18f19bf9 --- /dev/null +++ b/src/test/java/com/rootly/client/api/CatalogPropertiesApiTest.java @@ -0,0 +1,107 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.NewCatalogField; +import com.rootly.client.model.UpdateCatalogField; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for CatalogPropertiesApi + */ +@Disabled +public class CatalogPropertiesApiTest { + + private final CatalogPropertiesApi api = new CatalogPropertiesApi(); + + /** + * Creates a Catalog Property (alias for field) + * + * Creates a new Catalog Property - returns catalog_properties type + * + * @throws ApiException if the Api call fails + */ + @Test + public void createCatalogPropertyTest() throws ApiException { + String catalogId = null; + NewCatalogField newCatalogField = null; + api.createCatalogProperty(catalogId, newCatalogField); + // TODO: test validations + } + + /** + * Delete a catalog_property + * + * Delete a specific catalog_property by id - returns catalog_properties type + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteCatalogPropertyTest() throws ApiException { + String id = null; + api.deleteCatalogProperty(id); + // TODO: test validations + } + + /** + * Retrieves a Catalog Property (alias for field) + * + * Retrieves a specific Catalog Property by id - returns catalog_properties type + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCatalogPropertyTest() throws ApiException { + String id = null; + api.getCatalogProperty(id); + // TODO: test validations + } + + /** + * List Catalog Properties (alias for fields) + * + * List Catalog Properties - returns catalog_properties type + * + * @throws ApiException if the Api call fails + */ + @Test + public void listCatalogPropertiesTest() throws ApiException { + String catalogId = null; + api.listCatalogProperties(catalogId); + // TODO: test validations + } + + /** + * Update a catalog_property (alias for field) + * + * Update a specific catalog_property by id - returns catalog_properties type + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateCatalogPropertyTest() throws ApiException { + String id = null; + UpdateCatalogField updateCatalogField = null; + api.updateCatalogProperty(id, updateCatalogField); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/MeetingRecordingsApiTest.java b/src/test/java/com/rootly/client/api/MeetingRecordingsApiTest.java new file mode 100644 index 00000000..316c99e3 --- /dev/null +++ b/src/test/java/com/rootly/client/api/MeetingRecordingsApiTest.java @@ -0,0 +1,163 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.MeetingRecordingList; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for MeetingRecordingsApi + */ +@Disabled +public class MeetingRecordingsApiTest { + + private final MeetingRecordingsApi api = new MeetingRecordingsApi(); + + /** + * Create meeting recording + * + * Invite a recording bot to the incident's meeting. If no previous recordings exist for the platform, a new bot is invited (session 1). If previous sessions exist, a new session is created (re-invite). The bot joins the meeting, records audio/video, and generates a transcript when the session ends. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createMeetingRecordingTest() throws ApiException { + String incidentId = null; + String platform = null; + api.createMeetingRecording(incidentId, platform); + // TODO: test validations + } + + /** + * Delete a meeting recording + * + * Delete a meeting recording. Only completed or failed recordings can be deleted. Active recordings (pending, recording, paused) must be stopped first. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteMeetingRecordingTest() throws ApiException { + String id = null; + api.deleteMeetingRecording(id); + // TODO: test validations + } + + /** + * Delete video from a meeting recording + * + * Delete only the video file from a meeting recording. The transcript, summary, and all metadata are preserved. Only non-active recordings with an attached video can have their video deleted. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteMeetingRecordingVideoTest() throws ApiException { + String id = null; + api.deleteMeetingRecordingVideo(id); + // TODO: test validations + } + + /** + * Get a meeting recording + * + * Retrieve a single meeting recording session including its status, duration, speaker count, word count, and transcript summary. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getMeetingRecordingTest() throws ApiException { + String id = null; + api.getMeetingRecording(id); + // TODO: test validations + } + + /** + * Leave a meeting call + * + * Remove the recording bot from the meeting entirely. Unlike stop, this immediately disconnects the bot. The session will transition to analyzing and then completed once transcript processing finishes. + * + * @throws ApiException if the Api call fails + */ + @Test + public void leaveMeetingRecordingTest() throws ApiException { + String id = null; + api.leaveMeetingRecording(id); + // TODO: test validations + } + + /** + * List meeting recordings + * + * List all meeting recording sessions for an incident. Returns recordings sorted by session number. Each recording represents one bot session with its own transcript, status, and metadata. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listMeetingRecordingsTest() throws ApiException { + String incidentId = null; + Integer pageNumber = null; + Integer pageSize = null; + MeetingRecordingList response = api.listMeetingRecordings(incidentId, pageNumber, pageSize); + // TODO: test validations + } + + /** + * Pause a meeting recording + * + * Pause an active recording session. The bot remains in the meeting but stops capturing audio/video. Use the resume endpoint to continue recording. + * + * @throws ApiException if the Api call fails + */ + @Test + public void pauseMeetingRecordingTest() throws ApiException { + String id = null; + api.pauseMeetingRecording(id); + // TODO: test validations + } + + /** + * Resume a meeting recording + * + * Resume a paused recording session. The bot continues capturing audio/video from the meeting. + * + * @throws ApiException if the Api call fails + */ + @Test + public void resumeMeetingRecordingTest() throws ApiException { + String id = null; + api.resumeMeetingRecording(id); + // TODO: test validations + } + + /** + * Stop a meeting recording + * + * Stop an active or paused recording. The bot finishes processing, generates a transcript, and the session status transitions to completed. This is irreversible — to record again, create a new session. + * + * @throws ApiException if the Api call fails + */ + @Test + public void stopMeetingRecordingTest() throws ApiException { + String id = null; + api.stopMeetingRecording(id); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/OnCallPayReportsApiTest.java b/src/test/java/com/rootly/client/api/OnCallPayReportsApiTest.java new file mode 100644 index 00000000..39c43bb9 --- /dev/null +++ b/src/test/java/com/rootly/client/api/OnCallPayReportsApiTest.java @@ -0,0 +1,117 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.NewOnCallPayReport; +import com.rootly.client.model.OnCallPayReportList; +import com.rootly.client.model.OnCallPayReportResponse; +import com.rootly.client.model.UpdateOnCallPayReport; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for OnCallPayReportsApi + */ +@Disabled +public class OnCallPayReportsApiTest { + + private final OnCallPayReportsApi api = new OnCallPayReportsApi(); + + /** + * Creates an On-Call Pay Report + * + * Generates a new on-call pay report for the given date range. The report is generated asynchronously. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createOnCallPayReportTest() throws ApiException { + NewOnCallPayReport newOnCallPayReport = null; + OnCallPayReportResponse response = api.createOnCallPayReport(newOnCallPayReport); + // TODO: test validations + } + + /** + * Retrieves an On-Call Pay Report + * + * Retrieves a specific on-call pay report by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOnCallPayReportTest() throws ApiException { + String id = null; + String include = null; + OnCallPayReportResponse response = api.getOnCallPayReport(id, include); + // TODO: test validations + } + + /** + * List On-Call Pay Reports + * + * List on-call pay reports + * + * @throws ApiException if the Api call fails + */ + @Test + public void listOnCallPayReportsTest() throws ApiException { + String include = null; + Integer pageNumber = null; + Integer pageSize = null; + String filterStatus = null; + String filterCreatedAtGt = null; + String filterCreatedAtGte = null; + String filterCreatedAtLt = null; + String filterCreatedAtLte = null; + OnCallPayReportList response = api.listOnCallPayReports(include, pageNumber, pageSize, filterStatus, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte); + // TODO: test validations + } + + /** + * Regenerate an On-Call Pay Report + * + * Triggers regeneration of an existing on-call pay report. + * + * @throws ApiException if the Api call fails + */ + @Test + public void regenerateOnCallPayReportTest() throws ApiException { + String id = null; + OnCallPayReportResponse response = api.regenerateOnCallPayReport(id); + // TODO: test validations + } + + /** + * Update an On-Call Pay Report + * + * Update a specific on-call pay report by id. Triggers report regeneration. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateOnCallPayReportTest() throws ApiException { + String id = null; + UpdateOnCallPayReport updateOnCallPayReport = null; + OnCallPayReportResponse response = api.updateOnCallPayReport(id, updateOnCallPayReport); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/OnCallsApiTest.java b/src/test/java/com/rootly/client/api/OnCallsApiTest.java new file mode 100644 index 00000000..60f885ce --- /dev/null +++ b/src/test/java/com/rootly/client/api/OnCallsApiTest.java @@ -0,0 +1,58 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.ErrorsList; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for OnCallsApi + */ +@Disabled +public class OnCallsApiTest { + + private final OnCallsApi api = new OnCallsApi(); + + /** + * List on-calls + * + * List who is currently on-call, with support for filtering by escalation policy, schedule, and user. Returns on-call entries grouped by escalation policy level. + * + * @throws ApiException if the Api call fails + */ + @Test + public void listOncallsTest() throws ApiException { + String include = null; + String since = null; + String until = null; + Boolean earliest = null; + String timeZone = null; + String filterEscalationPolicyIds = null; + String filterScheduleIds = null; + String filterUserIds = null; + String filterServiceIds = null; + String filterGroupIds = null; + String filterNotificationTypes = null; + api.listOncalls(include, since, until, earliest, timeZone, filterEscalationPolicyIds, filterScheduleIds, filterUserIds, filterServiceIds, filterGroupIds, filterNotificationTypes); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/api/SlasApiTest.java b/src/test/java/com/rootly/client/api/SlasApiTest.java new file mode 100644 index 00000000..42dd7e64 --- /dev/null +++ b/src/test/java/com/rootly/client/api/SlasApiTest.java @@ -0,0 +1,118 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.api; + +import com.rootly.client.ApiException; +import com.rootly.client.model.ErrorsList; +import com.rootly.client.model.NewSla; +import com.rootly.client.model.SlaList; +import com.rootly.client.model.SlaResponse; +import com.rootly.client.model.UpdateSla; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for SlasApi + */ +@Disabled +public class SlasApiTest { + + private final SlasApi api = new SlasApi(); + + /** + * Creates an SLA + * + * Creates a new SLA from provided data + * + * @throws ApiException if the Api call fails + */ + @Test + public void createSLATest() throws ApiException { + NewSla newSla = null; + SlaResponse response = api.createSLA(newSla); + // TODO: test validations + } + + /** + * Delete an SLA + * + * Delete a specific SLA by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteSLATest() throws ApiException { + String id = null; + SlaResponse response = api.deleteSLA(id); + // TODO: test validations + } + + /** + * Retrieves an SLA + * + * Retrieves a specific SLA by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void getSLATest() throws ApiException { + String id = null; + SlaResponse response = api.getSLA(id); + // TODO: test validations + } + + /** + * List SLAs + * + * List SLAs + * + * @throws ApiException if the Api call fails + */ + @Test + public void listSLAsTest() throws ApiException { + Integer pageNumber = null; + Integer pageSize = null; + String filterSearch = null; + String filterSlug = null; + String filterName = null; + String filterCreatedAtGt = null; + String filterCreatedAtGte = null; + String filterCreatedAtLt = null; + String filterCreatedAtLte = null; + String sort = null; + SlaList response = api.listSLAs(pageNumber, pageSize, filterSearch, filterSlug, filterName, filterCreatedAtGt, filterCreatedAtGte, filterCreatedAtLt, filterCreatedAtLte, sort); + // TODO: test validations + } + + /** + * Update an SLA + * + * Update a specific SLA by id + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateSLATest() throws ApiException { + String id = null; + UpdateSla updateSla = null; + SlaResponse response = api.updateSLA(id, updateSla); + // TODO: test validations + } + +} diff --git a/src/test/java/com/rootly/client/model/AddMicrosoftTeamsChatTabTaskParamsTest.java b/src/test/java/com/rootly/client/model/AddMicrosoftTeamsChatTabTaskParamsTest.java new file mode 100644 index 00000000..26584e85 --- /dev/null +++ b/src/test/java/com/rootly/client/model/AddMicrosoftTeamsChatTabTaskParamsTest.java @@ -0,0 +1,73 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AddMicrosoftTeamsChatTabTaskParams + */ +public class AddMicrosoftTeamsChatTabTaskParamsTest { + private final AddMicrosoftTeamsChatTabTaskParams model = new AddMicrosoftTeamsChatTabTaskParams(); + + /** + * Model tests for AddMicrosoftTeamsChatTabTaskParams + */ + @Test + public void testAddMicrosoftTeamsChatTabTaskParams() { + // TODO: test AddMicrosoftTeamsChatTabTaskParams + } + + /** + * Test the property 'taskType' + */ + @Test + public void taskTypeTest() { + // TODO: test taskType + } + + /** + * Test the property 'chat' + */ + @Test + public void chatTest() { + // TODO: test chat + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'link' + */ + @Test + public void linkTest() { + // TODO: test link + } + +} diff --git a/src/test/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsConditionsInnerTest.java b/src/test/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsConditionsInnerTest.java new file mode 100644 index 00000000..02c2b437 --- /dev/null +++ b/src/test/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsConditionsInnerTest.java @@ -0,0 +1,74 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AlertTriggerParamsAlertPayloadConditionsConditionsInner + */ +public class AlertTriggerParamsAlertPayloadConditionsConditionsInnerTest { + private final AlertTriggerParamsAlertPayloadConditionsConditionsInner model = new AlertTriggerParamsAlertPayloadConditionsConditionsInner(); + + /** + * Model tests for AlertTriggerParamsAlertPayloadConditionsConditionsInner + */ + @Test + public void testAlertTriggerParamsAlertPayloadConditionsConditionsInner() { + // TODO: test AlertTriggerParamsAlertPayloadConditionsConditionsInner + } + + /** + * Test the property 'query' + */ + @Test + public void queryTest() { + // TODO: test query + } + + /** + * Test the property 'operator' + */ + @Test + public void operatorTest() { + // TODO: test operator + } + + /** + * Test the property 'values' + */ + @Test + public void valuesTest() { + // TODO: test values + } + + /** + * Test the property 'useRegexp' + */ + @Test + public void useRegexpTest() { + // TODO: test useRegexp + } + +} diff --git a/src/test/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsTest.java b/src/test/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsTest.java new file mode 100644 index 00000000..09a5c64e --- /dev/null +++ b/src/test/java/com/rootly/client/model/AlertTriggerParamsAlertPayloadConditionsTest.java @@ -0,0 +1,59 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AlertTriggerParamsAlertPayloadConditionsConditionsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AlertTriggerParamsAlertPayloadConditions + */ +public class AlertTriggerParamsAlertPayloadConditionsTest { + private final AlertTriggerParamsAlertPayloadConditions model = new AlertTriggerParamsAlertPayloadConditions(); + + /** + * Model tests for AlertTriggerParamsAlertPayloadConditions + */ + @Test + public void testAlertTriggerParamsAlertPayloadConditions() { + // TODO: test AlertTriggerParamsAlertPayloadConditions + } + + /** + * Test the property 'logic' + */ + @Test + public void logicTest() { + // TODO: test logic + } + + /** + * Test the property 'conditions' + */ + @Test + public void conditionsTest() { + // TODO: test conditions + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyListTest.java b/src/test/java/com/rootly/client/model/ApiKeyListTest.java new file mode 100644 index 00000000..c0e6bd6f --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyListTest.java @@ -0,0 +1,69 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKeyList + */ +public class ApiKeyListTest { + private final ApiKeyList model = new ApiKeyList(); + + /** + * Model tests for ApiKeyList + */ + @Test + public void testApiKeyList() { + // TODO: test ApiKeyList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + // TODO: test links + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyResponseDataTest.java b/src/test/java/com/rootly/client/model/ApiKeyResponseDataTest.java new file mode 100644 index 00000000..19ba3baa --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKey; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKeyResponseData + */ +public class ApiKeyResponseDataTest { + private final ApiKeyResponseData model = new ApiKeyResponseData(); + + /** + * Model tests for ApiKeyResponseData + */ + @Test + public void testApiKeyResponseData() { + // TODO: test ApiKeyResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyResponseTest.java b/src/test/java/com/rootly/client/model/ApiKeyResponseTest.java new file mode 100644 index 00000000..f7a6eaf5 --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKeyResponse + */ +public class ApiKeyResponseTest { + private final ApiKeyResponse model = new ApiKeyResponse(); + + /** + * Model tests for ApiKeyResponse + */ + @Test + public void testApiKeyResponse() { + // TODO: test ApiKeyResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyTest.java b/src/test/java/com/rootly/client/model/ApiKeyTest.java new file mode 100644 index 00000000..4735b05f --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyTest.java @@ -0,0 +1,121 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKey + */ +public class ApiKeyTest { + private final ApiKey model = new ApiKey(); + + /** + * Model tests for ApiKey + */ + @Test + public void testApiKey() { + // TODO: test ApiKey + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + + /** + * Test the property 'onCallRoleId' + */ + @Test + public void onCallRoleIdTest() { + // TODO: test onCallRoleId + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + + /** + * Test the property 'lastUsedAt' + */ + @Test + public void lastUsedAtTest() { + // TODO: test lastUsedAt + } + + /** + * Test the property 'gracePeriodEndsAt' + */ + @Test + public void gracePeriodEndsAtTest() { + // TODO: test gracePeriodEndsAt + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseDataAttributesTest.java b/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseDataAttributesTest.java new file mode 100644 index 00000000..dd8bedfe --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseDataAttributesTest.java @@ -0,0 +1,129 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKeyWithTokenResponseDataAttributes + */ +public class ApiKeyWithTokenResponseDataAttributesTest { + private final ApiKeyWithTokenResponseDataAttributes model = new ApiKeyWithTokenResponseDataAttributes(); + + /** + * Model tests for ApiKeyWithTokenResponseDataAttributes + */ + @Test + public void testApiKeyWithTokenResponseDataAttributes() { + // TODO: test ApiKeyWithTokenResponseDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + + /** + * Test the property 'onCallRoleId' + */ + @Test + public void onCallRoleIdTest() { + // TODO: test onCallRoleId + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + + /** + * Test the property 'lastUsedAt' + */ + @Test + public void lastUsedAtTest() { + // TODO: test lastUsedAt + } + + /** + * Test the property 'gracePeriodEndsAt' + */ + @Test + public void gracePeriodEndsAtTest() { + // TODO: test gracePeriodEndsAt + } + + /** + * Test the property 'token' + */ + @Test + public void tokenTest() { + // TODO: test token + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseDataTest.java b/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseDataTest.java new file mode 100644 index 00000000..1dc19242 --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyWithTokenResponseDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKeyWithTokenResponseData + */ +public class ApiKeyWithTokenResponseDataTest { + private final ApiKeyWithTokenResponseData model = new ApiKeyWithTokenResponseData(); + + /** + * Model tests for ApiKeyWithTokenResponseData + */ + @Test + public void testApiKeyWithTokenResponseData() { + // TODO: test ApiKeyWithTokenResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseTest.java b/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseTest.java new file mode 100644 index 00000000..64161e99 --- /dev/null +++ b/src/test/java/com/rootly/client/model/ApiKeyWithTokenResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.ApiKeyWithTokenResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ApiKeyWithTokenResponse + */ +public class ApiKeyWithTokenResponseTest { + private final ApiKeyWithTokenResponse model = new ApiKeyWithTokenResponse(); + + /** + * Model tests for ApiKeyWithTokenResponse + */ + @Test + public void testApiKeyWithTokenResponse() { + // TODO: test ApiKeyWithTokenResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/BuiltinFieldTest.java b/src/test/java/com/rootly/client/model/BuiltinFieldTest.java new file mode 100644 index 00000000..321c948b --- /dev/null +++ b/src/test/java/com/rootly/client/model/BuiltinFieldTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BuiltinField + */ +public class BuiltinFieldTest { + private final BuiltinField model = new BuiltinField(); + + /** + * Model tests for BuiltinField + */ + @Test + public void testBuiltinField() { + // TODO: test BuiltinField + } + + /** + * Test the property 'fieldSource' + */ + @Test + public void fieldSourceTest() { + // TODO: test fieldSource + } + + /** + * Test the property 'fieldKey' + */ + @Test + public void fieldKeyTest() { + // TODO: test fieldKey + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogChecklistTemplateFieldsInnerTest.java b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateFieldsInnerTest.java new file mode 100644 index 00000000..8c4f9d56 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateFieldsInnerTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogChecklistTemplateFieldsInner + */ +public class CatalogChecklistTemplateFieldsInnerTest { + private final CatalogChecklistTemplateFieldsInner model = new CatalogChecklistTemplateFieldsInner(); + + /** + * Model tests for CatalogChecklistTemplateFieldsInner + */ + @Test + public void testCatalogChecklistTemplateFieldsInner() { + // TODO: test CatalogChecklistTemplateFieldsInner + } + + /** + * Test the property 'fieldSource' + */ + @Test + public void fieldSourceTest() { + // TODO: test fieldSource + } + + /** + * Test the property 'fieldKey' + */ + @Test + public void fieldKeyTest() { + // TODO: test fieldKey + } + + /** + * Test the property 'catalogPropertyId' + */ + @Test + public void catalogPropertyIdTest() { + // TODO: test catalogPropertyId + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogChecklistTemplateListTest.java b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateListTest.java new file mode 100644 index 00000000..383cdcfc --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateListTest.java @@ -0,0 +1,69 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplateResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogChecklistTemplateList + */ +public class CatalogChecklistTemplateListTest { + private final CatalogChecklistTemplateList model = new CatalogChecklistTemplateList(); + + /** + * Model tests for CatalogChecklistTemplateList + */ + @Test + public void testCatalogChecklistTemplateList() { + // TODO: test CatalogChecklistTemplateList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + // TODO: test links + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogChecklistTemplateOwnersInnerTest.java b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateOwnersInnerTest.java new file mode 100644 index 00000000..1a0fa1e1 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateOwnersInnerTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogChecklistTemplateOwnersInner + */ +public class CatalogChecklistTemplateOwnersInnerTest { + private final CatalogChecklistTemplateOwnersInner model = new CatalogChecklistTemplateOwnersInner(); + + /** + * Model tests for CatalogChecklistTemplateOwnersInner + */ + @Test + public void testCatalogChecklistTemplateOwnersInner() { + // TODO: test CatalogChecklistTemplateOwnersInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogChecklistTemplateResponseDataTest.java b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateResponseDataTest.java new file mode 100644 index 00000000..6200099f --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplate; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogChecklistTemplateResponseData + */ +public class CatalogChecklistTemplateResponseDataTest { + private final CatalogChecklistTemplateResponseData model = new CatalogChecklistTemplateResponseData(); + + /** + * Model tests for CatalogChecklistTemplateResponseData + */ + @Test + public void testCatalogChecklistTemplateResponseData() { + // TODO: test CatalogChecklistTemplateResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogChecklistTemplateResponseTest.java b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateResponseTest.java new file mode 100644 index 00000000..f2b7be66 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplateResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogChecklistTemplateResponse + */ +public class CatalogChecklistTemplateResponseTest { + private final CatalogChecklistTemplateResponse model = new CatalogChecklistTemplateResponse(); + + /** + * Model tests for CatalogChecklistTemplateResponse + */ + @Test + public void testCatalogChecklistTemplateResponse() { + // TODO: test CatalogChecklistTemplateResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogChecklistTemplateTest.java b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateTest.java new file mode 100644 index 00000000..4d575972 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogChecklistTemplateTest.java @@ -0,0 +1,125 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogChecklistTemplateFieldsInner; +import com.rootly.client.model.CatalogChecklistTemplateOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogChecklistTemplate + */ +public class CatalogChecklistTemplateTest { + private final CatalogChecklistTemplate model = new CatalogChecklistTemplate(); + + /** + * Model tests for CatalogChecklistTemplate + */ + @Test + public void testCatalogChecklistTemplate() { + // TODO: test CatalogChecklistTemplate + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'slug' + */ + @Test + public void slugTest() { + // TODO: test slug + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'catalogType' + */ + @Test + public void catalogTypeTest() { + // TODO: test catalogType + } + + /** + * Test the property 'scopeType' + */ + @Test + public void scopeTypeTest() { + // TODO: test scopeType + } + + /** + * Test the property 'scopeId' + */ + @Test + public void scopeIdTest() { + // TODO: test scopeId + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'fields' + */ + @Test + public void fieldsTest() { + // TODO: test fields + } + + /** + * Test the property 'owners' + */ + @Test + public void ownersTest() { + // TODO: test owners + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataAttributesTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataAttributesTest.java new file mode 100644 index 00000000..aed4bd1b --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataAttributesTest.java @@ -0,0 +1,113 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistChecklistFieldsInnerDataAttributes + */ +public class CatalogEntityChecklistChecklistFieldsInnerDataAttributesTest { + private final CatalogEntityChecklistChecklistFieldsInnerDataAttributes model = new CatalogEntityChecklistChecklistFieldsInnerDataAttributes(); + + /** + * Model tests for CatalogEntityChecklistChecklistFieldsInnerDataAttributes + */ + @Test + public void testCatalogEntityChecklistChecklistFieldsInnerDataAttributes() { + // TODO: test CatalogEntityChecklistChecklistFieldsInnerDataAttributes + } + + /** + * Test the property 'catalogEntityChecklistId' + */ + @Test + public void catalogEntityChecklistIdTest() { + // TODO: test catalogEntityChecklistId + } + + /** + * Test the property 'catalogChecklistTemplateFieldId' + */ + @Test + public void catalogChecklistTemplateFieldIdTest() { + // TODO: test catalogChecklistTemplateFieldId + } + + /** + * Test the property 'fieldKey' + */ + @Test + public void fieldKeyTest() { + // TODO: test fieldKey + } + + /** + * Test the property 'checked' + */ + @Test + public void checkedTest() { + // TODO: test checked + } + + /** + * Test the property 'valueSnapshot' + */ + @Test + public void valueSnapshotTest() { + // TODO: test valueSnapshot + } + + /** + * Test the property 'completedByUserId' + */ + @Test + public void completedByUserIdTest() { + // TODO: test completedByUserId + } + + /** + * Test the property 'completedAt' + */ + @Test + public void completedAtTest() { + // TODO: test completedAt + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataTest.java new file mode 100644 index 00000000..e0847a16 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistFieldsInnerDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistChecklistFieldsInnerData + */ +public class CatalogEntityChecklistChecklistFieldsInnerDataTest { + private final CatalogEntityChecklistChecklistFieldsInnerData model = new CatalogEntityChecklistChecklistFieldsInnerData(); + + /** + * Model tests for CatalogEntityChecklistChecklistFieldsInnerData + */ + @Test + public void testCatalogEntityChecklistChecklistFieldsInnerData() { + // TODO: test CatalogEntityChecklistChecklistFieldsInnerData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerTest.java new file mode 100644 index 00000000..88873dca --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistFieldsInnerTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistFieldsInnerData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistChecklistFieldsInner + */ +public class CatalogEntityChecklistChecklistFieldsInnerTest { + private final CatalogEntityChecklistChecklistFieldsInner model = new CatalogEntityChecklistChecklistFieldsInner(); + + /** + * Model tests for CatalogEntityChecklistChecklistFieldsInner + */ + @Test + public void testCatalogEntityChecklistChecklistFieldsInner() { + // TODO: test CatalogEntityChecklistChecklistFieldsInner + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataAttributesTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataAttributesTest.java new file mode 100644 index 00000000..4c0ea2a3 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataAttributesTest.java @@ -0,0 +1,72 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistChecklistOwnersInnerDataAttributes + */ +public class CatalogEntityChecklistChecklistOwnersInnerDataAttributesTest { + private final CatalogEntityChecklistChecklistOwnersInnerDataAttributes model = new CatalogEntityChecklistChecklistOwnersInnerDataAttributes(); + + /** + * Model tests for CatalogEntityChecklistChecklistOwnersInnerDataAttributes + */ + @Test + public void testCatalogEntityChecklistChecklistOwnersInnerDataAttributes() { + // TODO: test CatalogEntityChecklistChecklistOwnersInnerDataAttributes + } + + /** + * Test the property 'catalogEntityChecklistId' + */ + @Test + public void catalogEntityChecklistIdTest() { + // TODO: test catalogEntityChecklistId + } + + /** + * Test the property 'ownerUserId' + */ + @Test + public void ownerUserIdTest() { + // TODO: test ownerUserId + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataTest.java new file mode 100644 index 00000000..07c52027 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistOwnersInnerDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistChecklistOwnersInnerData + */ +public class CatalogEntityChecklistChecklistOwnersInnerDataTest { + private final CatalogEntityChecklistChecklistOwnersInnerData model = new CatalogEntityChecklistChecklistOwnersInnerData(); + + /** + * Model tests for CatalogEntityChecklistChecklistOwnersInnerData + */ + @Test + public void testCatalogEntityChecklistChecklistOwnersInnerData() { + // TODO: test CatalogEntityChecklistChecklistOwnersInnerData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerTest.java new file mode 100644 index 00000000..dfdacb8d --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistChecklistOwnersInnerTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistOwnersInnerData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistChecklistOwnersInner + */ +public class CatalogEntityChecklistChecklistOwnersInnerTest { + private final CatalogEntityChecklistChecklistOwnersInner model = new CatalogEntityChecklistChecklistOwnersInner(); + + /** + * Model tests for CatalogEntityChecklistChecklistOwnersInner + */ + @Test + public void testCatalogEntityChecklistChecklistOwnersInner() { + // TODO: test CatalogEntityChecklistChecklistOwnersInner + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistListTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistListTest.java new file mode 100644 index 00000000..bb50c1b7 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistListTest.java @@ -0,0 +1,69 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistList + */ +public class CatalogEntityChecklistListTest { + private final CatalogEntityChecklistList model = new CatalogEntityChecklistList(); + + /** + * Model tests for CatalogEntityChecklistList + */ + @Test + public void testCatalogEntityChecklistList() { + // TODO: test CatalogEntityChecklistList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + // TODO: test links + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistResponseDataTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistResponseDataTest.java new file mode 100644 index 00000000..4a007948 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklist; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistResponseData + */ +public class CatalogEntityChecklistResponseDataTest { + private final CatalogEntityChecklistResponseData model = new CatalogEntityChecklistResponseData(); + + /** + * Model tests for CatalogEntityChecklistResponseData + */ + @Test + public void testCatalogEntityChecklistResponseData() { + // TODO: test CatalogEntityChecklistResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistResponseTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistResponseTest.java new file mode 100644 index 00000000..296ba514 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklistResponse + */ +public class CatalogEntityChecklistResponseTest { + private final CatalogEntityChecklistResponse model = new CatalogEntityChecklistResponse(); + + /** + * Model tests for CatalogEntityChecklistResponse + */ + @Test + public void testCatalogEntityChecklistResponse() { + // TODO: test CatalogEntityChecklistResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogEntityChecklistTest.java b/src/test/java/com/rootly/client/model/CatalogEntityChecklistTest.java new file mode 100644 index 00000000..212b92fc --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogEntityChecklistTest.java @@ -0,0 +1,133 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogEntityChecklistChecklistFieldsInner; +import com.rootly.client.model.CatalogEntityChecklistChecklistOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogEntityChecklist + */ +public class CatalogEntityChecklistTest { + private final CatalogEntityChecklist model = new CatalogEntityChecklist(); + + /** + * Model tests for CatalogEntityChecklist + */ + @Test + public void testCatalogEntityChecklist() { + // TODO: test CatalogEntityChecklist + } + + /** + * Test the property 'catalogChecklistTemplateId' + */ + @Test + public void catalogChecklistTemplateIdTest() { + // TODO: test catalogChecklistTemplateId + } + + /** + * Test the property 'auditableType' + */ + @Test + public void auditableTypeTest() { + // TODO: test auditableType + } + + /** + * Test the property 'auditableId' + */ + @Test + public void auditableIdTest() { + // TODO: test auditableId + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'startedAt' + */ + @Test + public void startedAtTest() { + // TODO: test startedAt + } + + /** + * Test the property 'completedAt' + */ + @Test + public void completedAtTest() { + // TODO: test completedAt + } + + /** + * Test the property 'completedByUserId' + */ + @Test + public void completedByUserIdTest() { + // TODO: test completedByUserId + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'checklistFields' + */ + @Test + public void checklistFieldsTest() { + // TODO: test checklistFields + } + + /** + * Test the property 'checklistOwners' + */ + @Test + public void checklistOwnersTest() { + // TODO: test checklistOwners + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogPropertyListTest.java b/src/test/java/com/rootly/client/model/CatalogPropertyListTest.java new file mode 100644 index 00000000..bbf0bf97 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogPropertyListTest.java @@ -0,0 +1,69 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogPropertyResponseData; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogPropertyList + */ +public class CatalogPropertyListTest { + private final CatalogPropertyList model = new CatalogPropertyList(); + + /** + * Model tests for CatalogPropertyList + */ + @Test + public void testCatalogPropertyList() { + // TODO: test CatalogPropertyList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + // TODO: test links + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogPropertyResponseDataTest.java b/src/test/java/com/rootly/client/model/CatalogPropertyResponseDataTest.java new file mode 100644 index 00000000..aba7d16c --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogPropertyResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogProperty; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogPropertyResponseData + */ +public class CatalogPropertyResponseDataTest { + private final CatalogPropertyResponseData model = new CatalogPropertyResponseData(); + + /** + * Model tests for CatalogPropertyResponseData + */ + @Test + public void testCatalogPropertyResponseData() { + // TODO: test CatalogPropertyResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogPropertyResponseTest.java b/src/test/java/com/rootly/client/model/CatalogPropertyResponseTest.java new file mode 100644 index 00000000..4016d5f3 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogPropertyResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CatalogPropertyResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogPropertyResponse + */ +public class CatalogPropertyResponseTest { + private final CatalogPropertyResponse model = new CatalogPropertyResponse(); + + /** + * Model tests for CatalogPropertyResponse + */ + @Test + public void testCatalogPropertyResponse() { + // TODO: test CatalogPropertyResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/CatalogPropertyTest.java b/src/test/java/com/rootly/client/model/CatalogPropertyTest.java new file mode 100644 index 00000000..4dc2edb7 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CatalogPropertyTest.java @@ -0,0 +1,129 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CatalogProperty + */ +public class CatalogPropertyTest { + private final CatalogProperty model = new CatalogProperty(); + + /** + * Model tests for CatalogProperty + */ + @Test + public void testCatalogProperty() { + // TODO: test CatalogProperty + } + + /** + * Test the property 'catalogId' + */ + @Test + public void catalogIdTest() { + // TODO: test catalogId + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'slug' + */ + @Test + public void slugTest() { + // TODO: test slug + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + + /** + * Test the property 'kindCatalogId' + */ + @Test + public void kindCatalogIdTest() { + // TODO: test kindCatalogId + } + + /** + * Test the property 'multiple' + */ + @Test + public void multipleTest() { + // TODO: test multiple + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'required' + */ + @Test + public void requiredTest() { + // TODO: test required + } + + /** + * Test the property 'catalogType' + */ + @Test + public void catalogTypeTest() { + // TODO: test catalogType + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStageTest.java b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStageTest.java new file mode 100644 index 00000000..f73d34bc --- /dev/null +++ b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStageTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + */ +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStageTest { + private final CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage model = new CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage(); + + /** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + */ + @Test + public void testCommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage() { + // TODO: test CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplateTest.java b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplateTest.java new file mode 100644 index 00000000..a2814974 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplateTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + */ +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplateTest { + private final CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate model = new CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate(); + + /** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + */ + @Test + public void testCommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate() { + // TODO: test CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesTest.java b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesTest.java new file mode 100644 index 00000000..7dc72a46 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesTest.java @@ -0,0 +1,107 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationStage; +import com.rootly.client.model.CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesCommunicationTemplate; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + */ +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributesTest { + private final CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes model = new CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes(); + + /** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + */ + @Test + public void testCommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes() { + // TODO: test CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes + } + + /** + * Test the property 'emailBody' + */ + @Test + public void emailBodyTest() { + // TODO: test emailBody + } + + /** + * Test the property 'emailSubject' + */ + @Test + public void emailSubjectTest() { + // TODO: test emailSubject + } + + /** + * Test the property 'slackContent' + */ + @Test + public void slackContentTest() { + // TODO: test slackContent + } + + /** + * Test the property 'smsContent' + */ + @Test + public void smsContentTest() { + // TODO: test smsContent + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + + /** + * Test the property 'communicationStage' + */ + @Test + public void communicationStageTest() { + // TODO: test communicationStage + } + + /** + * Test the property 'communicationTemplate' + */ + @Test + public void communicationTemplateTest() { + // TODO: test communicationTemplate + } + +} diff --git a/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataTest.java b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataTest.java new file mode 100644 index 00000000..a3d0f3ea --- /dev/null +++ b/src/test/java/com/rootly/client/model/CommunicationsTemplateCommunicationTemplateStagesInnerDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CommunicationsTemplateCommunicationTemplateStagesInnerDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerData + */ +public class CommunicationsTemplateCommunicationTemplateStagesInnerDataTest { + private final CommunicationsTemplateCommunicationTemplateStagesInnerData model = new CommunicationsTemplateCommunicationTemplateStagesInnerData(); + + /** + * Model tests for CommunicationsTemplateCommunicationTemplateStagesInnerData + */ + @Test + public void testCommunicationsTemplateCommunicationTemplateStagesInnerData() { + // TODO: test CommunicationsTemplateCommunicationTemplateStagesInnerData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataParametersInnerTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataParametersInnerTest.java new file mode 100644 index 00000000..73c6c512 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataParametersInnerTest.java @@ -0,0 +1,82 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorActionRequestActionMetadataParametersInner + */ +public class CreateEdgeConnectorActionRequestActionMetadataParametersInnerTest { + private final CreateEdgeConnectorActionRequestActionMetadataParametersInner model = new CreateEdgeConnectorActionRequestActionMetadataParametersInner(); + + /** + * Model tests for CreateEdgeConnectorActionRequestActionMetadataParametersInner + */ + @Test + public void testCreateEdgeConnectorActionRequestActionMetadataParametersInner() { + // TODO: test CreateEdgeConnectorActionRequestActionMetadataParametersInner + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'required' + */ + @Test + public void requiredTest() { + // TODO: test required + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'options' + */ + @Test + public void optionsTest() { + // TODO: test options + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataTest.java new file mode 100644 index 00000000..852711c1 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionMetadataTest.java @@ -0,0 +1,67 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorActionRequestActionMetadataParametersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorActionRequestActionMetadata + */ +public class CreateEdgeConnectorActionRequestActionMetadataTest { + private final CreateEdgeConnectorActionRequestActionMetadata model = new CreateEdgeConnectorActionRequestActionMetadata(); + + /** + * Model tests for CreateEdgeConnectorActionRequestActionMetadata + */ + @Test + public void testCreateEdgeConnectorActionRequestActionMetadata() { + // TODO: test CreateEdgeConnectorActionRequestActionMetadata + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'timeout' + */ + @Test + public void timeoutTest() { + // TODO: test timeout + } + + /** + * Test the property 'parameters' + */ + @Test + public void parametersTest() { + // TODO: test parameters + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionTest.java new file mode 100644 index 00000000..7f0eb417 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestActionTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorActionRequestActionMetadata; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorActionRequestAction + */ +public class CreateEdgeConnectorActionRequestActionTest { + private final CreateEdgeConnectorActionRequestAction model = new CreateEdgeConnectorActionRequestAction(); + + /** + * Model tests for CreateEdgeConnectorActionRequestAction + */ + @Test + public void testCreateEdgeConnectorActionRequestAction() { + // TODO: test CreateEdgeConnectorActionRequestAction + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'actionType' + */ + @Test + public void actionTypeTest() { + // TODO: test actionType + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestTest.java new file mode 100644 index 00000000..aa4de6a4 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorActionRequestTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorActionRequestAction; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorActionRequest + */ +public class CreateEdgeConnectorActionRequestTest { + private final CreateEdgeConnectorActionRequest model = new CreateEdgeConnectorActionRequest(); + + /** + * Model tests for CreateEdgeConnectorActionRequest + */ + @Test + public void testCreateEdgeConnectorActionRequest() { + // TODO: test CreateEdgeConnectorActionRequest + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestDataAttributesTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestDataAttributesTest.java new file mode 100644 index 00000000..b333daea --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestDataAttributesTest.java @@ -0,0 +1,74 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorRequestDataAttributes + */ +public class CreateEdgeConnectorRequestDataAttributesTest { + private final CreateEdgeConnectorRequestDataAttributes model = new CreateEdgeConnectorRequestDataAttributes(); + + /** + * Model tests for CreateEdgeConnectorRequestDataAttributes + */ + @Test + public void testCreateEdgeConnectorRequestDataAttributes() { + // TODO: test CreateEdgeConnectorRequestDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'subscriptions' + */ + @Test + public void subscriptionsTest() { + // TODO: test subscriptions + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestDataTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestDataTest.java new file mode 100644 index 00000000..23253c7d --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorRequestDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorRequestData + */ +public class CreateEdgeConnectorRequestDataTest { + private final CreateEdgeConnectorRequestData model = new CreateEdgeConnectorRequestData(); + + /** + * Model tests for CreateEdgeConnectorRequestData + */ + @Test + public void testCreateEdgeConnectorRequestData() { + // TODO: test CreateEdgeConnectorRequestData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestTest.java b/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestTest.java new file mode 100644 index 00000000..0746856c --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateEdgeConnectorRequestTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.CreateEdgeConnectorRequestData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateEdgeConnectorRequest + */ +public class CreateEdgeConnectorRequestTest { + private final CreateEdgeConnectorRequest model = new CreateEdgeConnectorRequest(); + + /** + * Model tests for CreateEdgeConnectorRequest + */ + @Test + public void testCreateEdgeConnectorRequest() { + // TODO: test CreateEdgeConnectorRequest + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateGithubIssueTaskParamsIssueTypeTest.java b/src/test/java/com/rootly/client/model/CreateGithubIssueTaskParamsIssueTypeTest.java new file mode 100644 index 00000000..5feb19e2 --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateGithubIssueTaskParamsIssueTypeTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateGithubIssueTaskParamsIssueType + */ +public class CreateGithubIssueTaskParamsIssueTypeTest { + private final CreateGithubIssueTaskParamsIssueType model = new CreateGithubIssueTaskParamsIssueType(); + + /** + * Model tests for CreateGithubIssueTaskParamsIssueType + */ + @Test + public void testCreateGithubIssueTaskParamsIssueType() { + // TODO: test CreateGithubIssueTaskParamsIssueType + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/com/rootly/client/model/CreateJsmopsAlertTaskParamsTest.java b/src/test/java/com/rootly/client/model/CreateJsmopsAlertTaskParamsTest.java new file mode 100644 index 00000000..241a52ad --- /dev/null +++ b/src/test/java/com/rootly/client/model/CreateJsmopsAlertTaskParamsTest.java @@ -0,0 +1,116 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for CreateJsmopsAlertTaskParams + */ +public class CreateJsmopsAlertTaskParamsTest { + private final CreateJsmopsAlertTaskParams model = new CreateJsmopsAlertTaskParams(); + + /** + * Model tests for CreateJsmopsAlertTaskParams + */ + @Test + public void testCreateJsmopsAlertTaskParams() { + // TODO: test CreateJsmopsAlertTaskParams + } + + /** + * Test the property 'taskType' + */ + @Test + public void taskTypeTest() { + // TODO: test taskType + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'teams' + */ + @Test + public void teamsTest() { + // TODO: test teams + } + + /** + * Test the property 'users' + */ + @Test + public void usersTest() { + // TODO: test users + } + + /** + * Test the property 'schedules' + */ + @Test + public void schedulesTest() { + // TODO: test schedules + } + + /** + * Test the property 'escalations' + */ + @Test + public void escalationsTest() { + // TODO: test escalations + } + + /** + * Test the property 'priority' + */ + @Test + public void priorityTest() { + // TODO: test priority + } + + /** + * Test the property 'details' + */ + @Test + public void detailsTest() { + // TODO: test details + } + +} diff --git a/src/test/java/com/rootly/client/model/EscalateAlertDataAttributesTest.java b/src/test/java/com/rootly/client/model/EscalateAlertDataAttributesTest.java new file mode 100644 index 00000000..943ef054 --- /dev/null +++ b/src/test/java/com/rootly/client/model/EscalateAlertDataAttributesTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EscalateAlertDataAttributes + */ +public class EscalateAlertDataAttributesTest { + private final EscalateAlertDataAttributes model = new EscalateAlertDataAttributes(); + + /** + * Model tests for EscalateAlertDataAttributes + */ + @Test + public void testEscalateAlertDataAttributes() { + // TODO: test EscalateAlertDataAttributes + } + + /** + * Test the property 'escalationPolicyId' + */ + @Test + public void escalationPolicyIdTest() { + // TODO: test escalationPolicyId + } + + /** + * Test the property 'escalationPolicyLevel' + */ + @Test + public void escalationPolicyLevelTest() { + // TODO: test escalationPolicyLevel + } + +} diff --git a/src/test/java/com/rootly/client/model/EscalateAlertDataTest.java b/src/test/java/com/rootly/client/model/EscalateAlertDataTest.java new file mode 100644 index 00000000..da1f081d --- /dev/null +++ b/src/test/java/com/rootly/client/model/EscalateAlertDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.EscalateAlertDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EscalateAlertData + */ +public class EscalateAlertDataTest { + private final EscalateAlertData model = new EscalateAlertData(); + + /** + * Model tests for EscalateAlertData + */ + @Test + public void testEscalateAlertData() { + // TODO: test EscalateAlertData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/EscalateAlertTest.java b/src/test/java/com/rootly/client/model/EscalateAlertTest.java new file mode 100644 index 00000000..d1ad8901 --- /dev/null +++ b/src/test/java/com/rootly/client/model/EscalateAlertTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.EscalateAlertData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EscalateAlert + */ +public class EscalateAlertTest { + private final EscalateAlert model = new EscalateAlert(); + + /** + * Model tests for EscalateAlert + */ + @Test + public void testEscalateAlert() { + // TODO: test EscalateAlert + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/IncidentZoomMeetingGlobalDialInNumbersInnerTest.java b/src/test/java/com/rootly/client/model/IncidentZoomMeetingGlobalDialInNumbersInnerTest.java new file mode 100644 index 00000000..7baa12c4 --- /dev/null +++ b/src/test/java/com/rootly/client/model/IncidentZoomMeetingGlobalDialInNumbersInnerTest.java @@ -0,0 +1,80 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for IncidentZoomMeetingGlobalDialInNumbersInner + */ +public class IncidentZoomMeetingGlobalDialInNumbersInnerTest { + private final IncidentZoomMeetingGlobalDialInNumbersInner model = new IncidentZoomMeetingGlobalDialInNumbersInner(); + + /** + * Model tests for IncidentZoomMeetingGlobalDialInNumbersInner + */ + @Test + public void testIncidentZoomMeetingGlobalDialInNumbersInner() { + // TODO: test IncidentZoomMeetingGlobalDialInNumbersInner + } + + /** + * Test the property 'country' + */ + @Test + public void countryTest() { + // TODO: test country + } + + /** + * Test the property 'countryName' + */ + @Test + public void countryNameTest() { + // TODO: test countryName + } + + /** + * Test the property 'city' + */ + @Test + public void cityTest() { + // TODO: test city + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/src/test/java/com/rootly/client/model/MeetingRecordingListDataInnerTest.java b/src/test/java/com/rootly/client/model/MeetingRecordingListDataInnerTest.java new file mode 100644 index 00000000..a2104482 --- /dev/null +++ b/src/test/java/com/rootly/client/model/MeetingRecordingListDataInnerTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.MeetingRecording; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MeetingRecordingListDataInner + */ +public class MeetingRecordingListDataInnerTest { + private final MeetingRecordingListDataInner model = new MeetingRecordingListDataInner(); + + /** + * Model tests for MeetingRecordingListDataInner + */ + @Test + public void testMeetingRecordingListDataInner() { + // TODO: test MeetingRecordingListDataInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/MeetingRecordingListTest.java b/src/test/java/com/rootly/client/model/MeetingRecordingListTest.java new file mode 100644 index 00000000..5e0ab4ae --- /dev/null +++ b/src/test/java/com/rootly/client/model/MeetingRecordingListTest.java @@ -0,0 +1,60 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.MeetingRecordingListDataInner; +import com.rootly.client.model.Meta; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MeetingRecordingList + */ +public class MeetingRecordingListTest { + private final MeetingRecordingList model = new MeetingRecordingList(); + + /** + * Model tests for MeetingRecordingList + */ + @Test + public void testMeetingRecordingList() { + // TODO: test MeetingRecordingList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/MeetingRecordingTest.java b/src/test/java/com/rootly/client/model/MeetingRecordingTest.java new file mode 100644 index 00000000..6d1d266f --- /dev/null +++ b/src/test/java/com/rootly/client/model/MeetingRecordingTest.java @@ -0,0 +1,139 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MeetingRecording + */ +public class MeetingRecordingTest { + private final MeetingRecording model = new MeetingRecording(); + + /** + * Model tests for MeetingRecording + */ + @Test + public void testMeetingRecording() { + // TODO: test MeetingRecording + } + + /** + * Test the property 'platform' + */ + @Test + public void platformTest() { + // TODO: test platform + } + + /** + * Test the property 'sessionNumber' + */ + @Test + public void sessionNumberTest() { + // TODO: test sessionNumber + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'startedAt' + */ + @Test + public void startedAtTest() { + // TODO: test startedAt + } + + /** + * Test the property 'endedAt' + */ + @Test + public void endedAtTest() { + // TODO: test endedAt + } + + /** + * Test the property 'durationMinutes' + */ + @Test + public void durationMinutesTest() { + // TODO: test durationMinutes + } + + /** + * Test the property 'speakerCount' + */ + @Test + public void speakerCountTest() { + // TODO: test speakerCount + } + + /** + * Test the property 'wordCount' + */ + @Test + public void wordCountTest() { + // TODO: test wordCount + } + + /** + * Test the property 'transcriptSummary' + */ + @Test + public void transcriptSummaryTest() { + // TODO: test transcriptSummary + } + + /** + * Test the property 'hasVideo' + */ + @Test + public void hasVideoTest() { + // TODO: test hasVideo + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/NewApiKeyDataAttributesTest.java b/src/test/java/com/rootly/client/model/NewApiKeyDataAttributesTest.java new file mode 100644 index 00000000..dbc28b07 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewApiKeyDataAttributesTest.java @@ -0,0 +1,98 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewApiKeyDataAttributes + */ +public class NewApiKeyDataAttributesTest { + private final NewApiKeyDataAttributes model = new NewApiKeyDataAttributes(); + + /** + * Model tests for NewApiKeyDataAttributes + */ + @Test + public void testNewApiKeyDataAttributes() { + // TODO: test NewApiKeyDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + + /** + * Test the property 'groupId' + */ + @Test + public void groupIdTest() { + // TODO: test groupId + } + + /** + * Test the property 'roleId' + */ + @Test + public void roleIdTest() { + // TODO: test roleId + } + + /** + * Test the property 'onCallRoleId' + */ + @Test + public void onCallRoleIdTest() { + // TODO: test onCallRoleId + } + +} diff --git a/src/test/java/com/rootly/client/model/NewApiKeyDataTest.java b/src/test/java/com/rootly/client/model/NewApiKeyDataTest.java new file mode 100644 index 00000000..6cca853f --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewApiKeyDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewApiKeyDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewApiKeyData + */ +public class NewApiKeyDataTest { + private final NewApiKeyData model = new NewApiKeyData(); + + /** + * Model tests for NewApiKeyData + */ + @Test + public void testNewApiKeyData() { + // TODO: test NewApiKeyData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/NewApiKeyTest.java b/src/test/java/com/rootly/client/model/NewApiKeyTest.java new file mode 100644 index 00000000..ae835089 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewApiKeyTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewApiKeyData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewApiKey + */ +public class NewApiKeyTest { + private final NewApiKey model = new NewApiKey(); + + /** + * Model tests for NewApiKey + */ + @Test + public void testNewApiKey() { + // TODO: test NewApiKey + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesFieldsInnerTest.java b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesFieldsInnerTest.java new file mode 100644 index 00000000..239609e6 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesFieldsInnerTest.java @@ -0,0 +1,66 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.BuiltinField; +import com.rootly.client.model.CustomField; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogChecklistTemplateDataAttributesFieldsInner + */ +public class NewCatalogChecklistTemplateDataAttributesFieldsInnerTest { + private final NewCatalogChecklistTemplateDataAttributesFieldsInner model = new NewCatalogChecklistTemplateDataAttributesFieldsInner(); + + /** + * Model tests for NewCatalogChecklistTemplateDataAttributesFieldsInner + */ + @Test + public void testNewCatalogChecklistTemplateDataAttributesFieldsInner() { + // TODO: test NewCatalogChecklistTemplateDataAttributesFieldsInner + } + + /** + * Test the property 'fieldSource' + */ + @Test + public void fieldSourceTest() { + // TODO: test fieldSource + } + + /** + * Test the property 'fieldKey' + */ + @Test + public void fieldKeyTest() { + // TODO: test fieldKey + } + + /** + * Test the property 'catalogPropertyId' + */ + @Test + public void catalogPropertyIdTest() { + // TODO: test catalogPropertyId + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesOwnersInnerTest.java b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesOwnersInnerTest.java new file mode 100644 index 00000000..9994b360 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesOwnersInnerTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogChecklistTemplateDataAttributesOwnersInner + */ +public class NewCatalogChecklistTemplateDataAttributesOwnersInnerTest { + private final NewCatalogChecklistTemplateDataAttributesOwnersInner model = new NewCatalogChecklistTemplateDataAttributesOwnersInner(); + + /** + * Model tests for NewCatalogChecklistTemplateDataAttributesOwnersInner + */ + @Test + public void testNewCatalogChecklistTemplateDataAttributesOwnersInner() { + // TODO: test NewCatalogChecklistTemplateDataAttributesOwnersInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesTest.java b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesTest.java new file mode 100644 index 00000000..52b24e62 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataAttributesTest.java @@ -0,0 +1,101 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesFieldsInner; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogChecklistTemplateDataAttributes + */ +public class NewCatalogChecklistTemplateDataAttributesTest { + private final NewCatalogChecklistTemplateDataAttributes model = new NewCatalogChecklistTemplateDataAttributes(); + + /** + * Model tests for NewCatalogChecklistTemplateDataAttributes + */ + @Test + public void testNewCatalogChecklistTemplateDataAttributes() { + // TODO: test NewCatalogChecklistTemplateDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'catalogType' + */ + @Test + public void catalogTypeTest() { + // TODO: test catalogType + } + + /** + * Test the property 'scopeType' + */ + @Test + public void scopeTypeTest() { + // TODO: test scopeType + } + + /** + * Test the property 'scopeId' + */ + @Test + public void scopeIdTest() { + // TODO: test scopeId + } + + /** + * Test the property 'fields' + */ + @Test + public void fieldsTest() { + // TODO: test fields + } + + /** + * Test the property 'owners' + */ + @Test + public void ownersTest() { + // TODO: test owners + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataTest.java b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataTest.java new file mode 100644 index 00000000..6b280ef1 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogChecklistTemplateData + */ +public class NewCatalogChecklistTemplateDataTest { + private final NewCatalogChecklistTemplateData model = new NewCatalogChecklistTemplateData(); + + /** + * Model tests for NewCatalogChecklistTemplateData + */ + @Test + public void testNewCatalogChecklistTemplateData() { + // TODO: test NewCatalogChecklistTemplateData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateTest.java b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateTest.java new file mode 100644 index 00000000..2e4ba912 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogChecklistTemplateTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogChecklistTemplate + */ +public class NewCatalogChecklistTemplateTest { + private final NewCatalogChecklistTemplate model = new NewCatalogChecklistTemplate(); + + /** + * Model tests for NewCatalogChecklistTemplate + */ + @Test + public void testNewCatalogChecklistTemplate() { + // TODO: test NewCatalogChecklistTemplate + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogEntityDataAttributesPropertiesInnerTest.java b/src/test/java/com/rootly/client/model/NewCatalogEntityDataAttributesPropertiesInnerTest.java new file mode 100644 index 00000000..bb48479b --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogEntityDataAttributesPropertiesInnerTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogEntityDataAttributesPropertiesInner + */ +public class NewCatalogEntityDataAttributesPropertiesInnerTest { + private final NewCatalogEntityDataAttributesPropertiesInner model = new NewCatalogEntityDataAttributesPropertiesInner(); + + /** + * Model tests for NewCatalogEntityDataAttributesPropertiesInner + */ + @Test + public void testNewCatalogEntityDataAttributesPropertiesInner() { + // TODO: test NewCatalogEntityDataAttributesPropertiesInner + } + + /** + * Test the property 'catalogPropertyId' + */ + @Test + public void catalogPropertyIdTest() { + // TODO: test catalogPropertyId + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogPropertyDataAttributesTest.java b/src/test/java/com/rootly/client/model/NewCatalogPropertyDataAttributesTest.java new file mode 100644 index 00000000..6ea35a67 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogPropertyDataAttributesTest.java @@ -0,0 +1,97 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogPropertyDataAttributes + */ +public class NewCatalogPropertyDataAttributesTest { + private final NewCatalogPropertyDataAttributes model = new NewCatalogPropertyDataAttributes(); + + /** + * Model tests for NewCatalogPropertyDataAttributes + */ + @Test + public void testNewCatalogPropertyDataAttributes() { + // TODO: test NewCatalogPropertyDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + + /** + * Test the property 'kindCatalogId' + */ + @Test + public void kindCatalogIdTest() { + // TODO: test kindCatalogId + } + + /** + * Test the property 'multiple' + */ + @Test + public void multipleTest() { + // TODO: test multiple + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'required' + */ + @Test + public void requiredTest() { + // TODO: test required + } + + /** + * Test the property 'catalogType' + */ + @Test + public void catalogTypeTest() { + // TODO: test catalogType + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogPropertyDataTest.java b/src/test/java/com/rootly/client/model/NewCatalogPropertyDataTest.java new file mode 100644 index 00000000..2ee25d7a --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogPropertyDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogPropertyDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogPropertyData + */ +public class NewCatalogPropertyDataTest { + private final NewCatalogPropertyData model = new NewCatalogPropertyData(); + + /** + * Model tests for NewCatalogPropertyData + */ + @Test + public void testNewCatalogPropertyData() { + // TODO: test NewCatalogPropertyData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCatalogPropertyTest.java b/src/test/java/com/rootly/client/model/NewCatalogPropertyTest.java new file mode 100644 index 00000000..4b1ef842 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCatalogPropertyTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogPropertyData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCatalogProperty + */ +public class NewCatalogPropertyTest { + private final NewCatalogProperty model = new NewCatalogProperty(); + + /** + * Model tests for NewCatalogProperty + */ + @Test + public void testNewCatalogProperty() { + // TODO: test NewCatalogProperty + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/NewCauseDataAttributesPropertiesInnerTest.java b/src/test/java/com/rootly/client/model/NewCauseDataAttributesPropertiesInnerTest.java new file mode 100644 index 00000000..ec0dbb65 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewCauseDataAttributesPropertiesInnerTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewCauseDataAttributesPropertiesInner + */ +public class NewCauseDataAttributesPropertiesInnerTest { + private final NewCauseDataAttributesPropertiesInner model = new NewCauseDataAttributesPropertiesInner(); + + /** + * Model tests for NewCauseDataAttributesPropertiesInner + */ + @Test + public void testNewCauseDataAttributesPropertiesInner() { + // TODO: test NewCauseDataAttributesPropertiesInner + } + + /** + * Test the property 'catalogPropertyId' + */ + @Test + public void catalogPropertyIdTest() { + // TODO: test catalogPropertyId + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1Test.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1Test.java new file mode 100644 index 00000000..b7ad5027 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf1Test.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf1Test { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf1(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf1() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf1 + } + + /** + * Test the property 'ruleType' + */ + @Test + public void ruleTypeTest() { + // TODO: test ruleType + } + + /** + * Test the property 'withinWorkingHour' + */ + @Test + public void withinWorkingHourTest() { + // TODO: test withinWorkingHour + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2Test.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2Test.java new file mode 100644 index 00000000..78487e57 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf2Test.java @@ -0,0 +1,83 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf2Test { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf2(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf2() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf2 + } + + /** + * Test the property 'ruleType' + */ + @Test + public void ruleTypeTest() { + // TODO: test ruleType + } + + /** + * Test the property 'jsonPath' + */ + @Test + public void jsonPathTest() { + // TODO: test jsonPath + } + + /** + * Test the property 'operator' + */ + @Test + public void operatorTest() { + // TODO: test operator + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + + /** + * Test the property 'values' + */ + @Test + public void valuesTest() { + // TODO: test values + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3Test.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3Test.java new file mode 100644 index 00000000..7621f4be --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf3Test.java @@ -0,0 +1,82 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf3Test { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf3(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf3() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf3 + } + + /** + * Test the property 'ruleType' + */ + @Test + public void ruleTypeTest() { + // TODO: test ruleType + } + + /** + * Test the property 'fieldableType' + */ + @Test + public void fieldableTypeTest() { + // TODO: test fieldableType + } + + /** + * Test the property 'fieldableId' + */ + @Test + public void fieldableIdTest() { + // TODO: test fieldableId + } + + /** + * Test the property 'operator' + */ + @Test + public void operatorTest() { + // TODO: test operator + } + + /** + * Test the property 'values' + */ + @Test + public void valuesTest() { + // TODO: test values + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4Test.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4Test.java new file mode 100644 index 00000000..dcb9dc7c --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf4Test.java @@ -0,0 +1,58 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf4Test { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf4(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf4() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf4 + } + + /** + * Test the property 'ruleType' + */ + @Test + public void ruleTypeTest() { + // TODO: test ruleType + } + + /** + * Test the property 'serviceIds' + */ + @Test + public void serviceIdsTest() { + // TODO: test serviceIds + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5Test.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5Test.java new file mode 100644 index 00000000..f1ec982d --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5Test.java @@ -0,0 +1,67 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf5Test { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf5(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf5() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf5 + } + + /** + * Test the property 'ruleType' + */ + @Test + public void ruleTypeTest() { + // TODO: test ruleType + } + + /** + * Test the property 'timeZone' + */ + @Test + public void timeZoneTest() { + // TODO: test timeZone + } + + /** + * Test the property 'timeBlocks' + */ + @Test + public void timeBlocksTest() { + // TODO: test timeBlocks + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInnerTest.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInnerTest.java new file mode 100644 index 00000000..dea54ad5 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInnerTest.java @@ -0,0 +1,129 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInnerTest { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf5TimeBlocksInner + } + + /** + * Test the property 'monday' + */ + @Test + public void mondayTest() { + // TODO: test monday + } + + /** + * Test the property 'tuesday' + */ + @Test + public void tuesdayTest() { + // TODO: test tuesday + } + + /** + * Test the property 'wednesday' + */ + @Test + public void wednesdayTest() { + // TODO: test wednesday + } + + /** + * Test the property 'thursday' + */ + @Test + public void thursdayTest() { + // TODO: test thursday + } + + /** + * Test the property 'friday' + */ + @Test + public void fridayTest() { + // TODO: test friday + } + + /** + * Test the property 'saturday' + */ + @Test + public void saturdayTest() { + // TODO: test saturday + } + + /** + * Test the property 'sunday' + */ + @Test + public void sundayTest() { + // TODO: test sunday + } + + /** + * Test the property 'startTime' + */ + @Test + public void startTimeTest() { + // TODO: test startTime + } + + /** + * Test the property 'endTime' + */ + @Test + public void endTimeTest() { + // TODO: test endTime + } + + /** + * Test the property 'allDay' + */ + @Test + public void allDayTest() { + // TODO: test allDay + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + +} diff --git a/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOfTest.java b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOfTest.java new file mode 100644 index 00000000..cf158d5a --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewEscalationPolicyPathDataAttributesRulesInnerOneOfTest.java @@ -0,0 +1,58 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf + */ +public class NewEscalationPolicyPathDataAttributesRulesInnerOneOfTest { + private final NewEscalationPolicyPathDataAttributesRulesInnerOneOf model = new NewEscalationPolicyPathDataAttributesRulesInnerOneOf(); + + /** + * Model tests for NewEscalationPolicyPathDataAttributesRulesInnerOneOf + */ + @Test + public void testNewEscalationPolicyPathDataAttributesRulesInnerOneOf() { + // TODO: test NewEscalationPolicyPathDataAttributesRulesInnerOneOf + } + + /** + * Test the property 'ruleType' + */ + @Test + public void ruleTypeTest() { + // TODO: test ruleType + } + + /** + * Test the property 'urgencyIds' + */ + @Test + public void urgencyIdsTest() { + // TODO: test urgencyIds + } + +} diff --git a/src/test/java/com/rootly/client/model/NewOnCallPayReportDataAttributesTest.java b/src/test/java/com/rootly/client/model/NewOnCallPayReportDataAttributesTest.java new file mode 100644 index 00000000..68f11bac --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewOnCallPayReportDataAttributesTest.java @@ -0,0 +1,67 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewOnCallPayReportDataAttributes + */ +public class NewOnCallPayReportDataAttributesTest { + private final NewOnCallPayReportDataAttributes model = new NewOnCallPayReportDataAttributes(); + + /** + * Model tests for NewOnCallPayReportDataAttributes + */ + @Test + public void testNewOnCallPayReportDataAttributes() { + // TODO: test NewOnCallPayReportDataAttributes + } + + /** + * Test the property 'startDate' + */ + @Test + public void startDateTest() { + // TODO: test startDate + } + + /** + * Test the property 'endDate' + */ + @Test + public void endDateTest() { + // TODO: test endDate + } + + /** + * Test the property 'scheduleIds' + */ + @Test + public void scheduleIdsTest() { + // TODO: test scheduleIds + } + +} diff --git a/src/test/java/com/rootly/client/model/NewOnCallPayReportDataTest.java b/src/test/java/com/rootly/client/model/NewOnCallPayReportDataTest.java new file mode 100644 index 00000000..5eca3364 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewOnCallPayReportDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewOnCallPayReportDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewOnCallPayReportData + */ +public class NewOnCallPayReportDataTest { + private final NewOnCallPayReportData model = new NewOnCallPayReportData(); + + /** + * Model tests for NewOnCallPayReportData + */ + @Test + public void testNewOnCallPayReportData() { + // TODO: test NewOnCallPayReportData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/NewOnCallPayReportTest.java b/src/test/java/com/rootly/client/model/NewOnCallPayReportTest.java new file mode 100644 index 00000000..e91cff53 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewOnCallPayReportTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewOnCallPayReportData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewOnCallPayReport + */ +public class NewOnCallPayReportTest { + private final NewOnCallPayReport model = new NewOnCallPayReport(); + + /** + * Model tests for NewOnCallPayReport + */ + @Test + public void testNewOnCallPayReport() { + // TODO: test NewOnCallPayReport + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/NewSlaDataAttributesConditionsInnerTest.java b/src/test/java/com/rootly/client/model/NewSlaDataAttributesConditionsInnerTest.java new file mode 100644 index 00000000..a02a3645 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewSlaDataAttributesConditionsInnerTest.java @@ -0,0 +1,92 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewSlaDataAttributesConditionsInner + */ +public class NewSlaDataAttributesConditionsInnerTest { + private final NewSlaDataAttributesConditionsInner model = new NewSlaDataAttributesConditionsInner(); + + /** + * Model tests for NewSlaDataAttributesConditionsInner + */ + @Test + public void testNewSlaDataAttributesConditionsInner() { + // TODO: test NewSlaDataAttributesConditionsInner + } + + /** + * Test the property 'conditionableType' + */ + @Test + public void conditionableTypeTest() { + // TODO: test conditionableType + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property 'operator' + */ + @Test + public void operatorTest() { + // TODO: test operator + } + + /** + * Test the property 'values' + */ + @Test + public void valuesTest() { + // TODO: test values + } + + /** + * Test the property 'formFieldId' + */ + @Test + public void formFieldIdTest() { + // TODO: test formFieldId + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + +} diff --git a/src/test/java/com/rootly/client/model/NewSlaDataAttributesNotificationConfigurationsInnerTest.java b/src/test/java/com/rootly/client/model/NewSlaDataAttributesNotificationConfigurationsInnerTest.java new file mode 100644 index 00000000..00d11a8a --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewSlaDataAttributesNotificationConfigurationsInnerTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewSlaDataAttributesNotificationConfigurationsInner + */ +public class NewSlaDataAttributesNotificationConfigurationsInnerTest { + private final NewSlaDataAttributesNotificationConfigurationsInner model = new NewSlaDataAttributesNotificationConfigurationsInner(); + + /** + * Model tests for NewSlaDataAttributesNotificationConfigurationsInner + */ + @Test + public void testNewSlaDataAttributesNotificationConfigurationsInner() { + // TODO: test NewSlaDataAttributesNotificationConfigurationsInner + } + + /** + * Test the property 'offsetType' + */ + @Test + public void offsetTypeTest() { + // TODO: test offsetType + } + + /** + * Test the property 'offsetDays' + */ + @Test + public void offsetDaysTest() { + // TODO: test offsetDays + } + +} diff --git a/src/test/java/com/rootly/client/model/NewSlaDataAttributesTest.java b/src/test/java/com/rootly/client/model/NewSlaDataAttributesTest.java new file mode 100644 index 00000000..67dc46f5 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewSlaDataAttributesTest.java @@ -0,0 +1,174 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaDataAttributesConditionsInner; +import com.rootly.client.model.NewSlaDataAttributesNotificationConfigurationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewSlaDataAttributes + */ +public class NewSlaDataAttributesTest { + private final NewSlaDataAttributes model = new NewSlaDataAttributes(); + + /** + * Model tests for NewSlaDataAttributes + */ + @Test + public void testNewSlaDataAttributes() { + // TODO: test NewSlaDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'conditionMatchType' + */ + @Test + public void conditionMatchTypeTest() { + // TODO: test conditionMatchType + } + + /** + * Test the property 'managerRoleId' + */ + @Test + public void managerRoleIdTest() { + // TODO: test managerRoleId + } + + /** + * Test the property 'managerUserId' + */ + @Test + public void managerUserIdTest() { + // TODO: test managerUserId + } + + /** + * Test the property 'assignmentDeadlineDays' + */ + @Test + public void assignmentDeadlineDaysTest() { + // TODO: test assignmentDeadlineDays + } + + /** + * Test the property 'assignmentDeadlineParentStatus' + */ + @Test + public void assignmentDeadlineParentStatusTest() { + // TODO: test assignmentDeadlineParentStatus + } + + /** + * Test the property 'assignmentDeadlineSubStatusId' + */ + @Test + public void assignmentDeadlineSubStatusIdTest() { + // TODO: test assignmentDeadlineSubStatusId + } + + /** + * Test the property 'assignmentSkipWeekends' + */ + @Test + public void assignmentSkipWeekendsTest() { + // TODO: test assignmentSkipWeekends + } + + /** + * Test the property 'completionDeadlineDays' + */ + @Test + public void completionDeadlineDaysTest() { + // TODO: test completionDeadlineDays + } + + /** + * Test the property 'completionDeadlineParentStatus' + */ + @Test + public void completionDeadlineParentStatusTest() { + // TODO: test completionDeadlineParentStatus + } + + /** + * Test the property 'completionDeadlineSubStatusId' + */ + @Test + public void completionDeadlineSubStatusIdTest() { + // TODO: test completionDeadlineSubStatusId + } + + /** + * Test the property 'completionSkipWeekends' + */ + @Test + public void completionSkipWeekendsTest() { + // TODO: test completionSkipWeekends + } + + /** + * Test the property 'conditions' + */ + @Test + public void conditionsTest() { + // TODO: test conditions + } + + /** + * Test the property 'notificationConfigurations' + */ + @Test + public void notificationConfigurationsTest() { + // TODO: test notificationConfigurations + } + +} diff --git a/src/test/java/com/rootly/client/model/NewSlaDataTest.java b/src/test/java/com/rootly/client/model/NewSlaDataTest.java new file mode 100644 index 00000000..87ec8ba8 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewSlaDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewSlaData + */ +public class NewSlaDataTest { + private final NewSlaData model = new NewSlaData(); + + /** + * Model tests for NewSlaData + */ + @Test + public void testNewSlaData() { + // TODO: test NewSlaData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/NewSlaTest.java b/src/test/java/com/rootly/client/model/NewSlaTest.java new file mode 100644 index 00000000..87a4afa7 --- /dev/null +++ b/src/test/java/com/rootly/client/model/NewSlaTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NewSla + */ +public class NewSlaTest { + private final NewSla model = new NewSla(); + + /** + * Model tests for NewSla + */ + @Test + public void testNewSla() { + // TODO: test NewSla + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/OnCallPayReportListTest.java b/src/test/java/com/rootly/client/model/OnCallPayReportListTest.java new file mode 100644 index 00000000..d0c888a0 --- /dev/null +++ b/src/test/java/com/rootly/client/model/OnCallPayReportListTest.java @@ -0,0 +1,69 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import com.rootly.client.model.OnCallPayReportResponseData; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OnCallPayReportList + */ +public class OnCallPayReportListTest { + private final OnCallPayReportList model = new OnCallPayReportList(); + + /** + * Model tests for OnCallPayReportList + */ + @Test + public void testOnCallPayReportList() { + // TODO: test OnCallPayReportList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + // TODO: test links + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/OnCallPayReportResponseDataTest.java b/src/test/java/com/rootly/client/model/OnCallPayReportResponseDataTest.java new file mode 100644 index 00000000..06e1aaad --- /dev/null +++ b/src/test/java/com/rootly/client/model/OnCallPayReportResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.OnCallPayReport; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OnCallPayReportResponseData + */ +public class OnCallPayReportResponseDataTest { + private final OnCallPayReportResponseData model = new OnCallPayReportResponseData(); + + /** + * Model tests for OnCallPayReportResponseData + */ + @Test + public void testOnCallPayReportResponseData() { + // TODO: test OnCallPayReportResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/OnCallPayReportResponseTest.java b/src/test/java/com/rootly/client/model/OnCallPayReportResponseTest.java new file mode 100644 index 00000000..666ad2dc --- /dev/null +++ b/src/test/java/com/rootly/client/model/OnCallPayReportResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.OnCallPayReportResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OnCallPayReportResponse + */ +public class OnCallPayReportResponseTest { + private final OnCallPayReportResponse model = new OnCallPayReportResponse(); + + /** + * Model tests for OnCallPayReportResponse + */ + @Test + public void testOnCallPayReportResponse() { + // TODO: test OnCallPayReportResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/OnCallPayReportTest.java b/src/test/java/com/rootly/client/model/OnCallPayReportTest.java new file mode 100644 index 00000000..20812c09 --- /dev/null +++ b/src/test/java/com/rootly/client/model/OnCallPayReportTest.java @@ -0,0 +1,204 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.net.URI; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OnCallPayReport + */ +public class OnCallPayReportTest { + private final OnCallPayReport model = new OnCallPayReport(); + + /** + * Model tests for OnCallPayReport + */ + @Test + public void testOnCallPayReport() { + // TODO: test OnCallPayReport + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'startDate' + */ + @Test + public void startDateTest() { + // TODO: test startDate + } + + /** + * Test the property 'endDate' + */ + @Test + public void endDateTest() { + // TODO: test endDate + } + + /** + * Test the property 'totalDuration' + */ + @Test + public void totalDurationTest() { + // TODO: test totalDuration + } + + /** + * Test the property 'usersCount' + */ + @Test + public void usersCountTest() { + // TODO: test usersCount + } + + /** + * Test the property 'currency' + */ + @Test + public void currencyTest() { + // TODO: test currency + } + + /** + * Test the property 'payType' + */ + @Test + public void payTypeTest() { + // TODO: test payType + } + + /** + * Test the property 'hourlyRateCents' + */ + @Test + public void hourlyRateCentsTest() { + // TODO: test hourlyRateCents + } + + /** + * Test the property 'dailyRateCents' + */ + @Test + public void dailyRateCentsTest() { + // TODO: test dailyRateCents + } + + /** + * Test the property 'totalPayCents' + */ + @Test + public void totalPayCentsTest() { + // TODO: test totalPayCents + } + + /** + * Test the property 'includeShadow' + */ + @Test + public void includeShadowTest() { + // TODO: test includeShadow + } + + /** + * Test the property 'showIndividualShiftData' + */ + @Test + public void showIndividualShiftDataTest() { + // TODO: test showIndividualShiftData + } + + /** + * Test the property 'hasSingleRate' + */ + @Test + public void hasSingleRateTest() { + // TODO: test hasSingleRate + } + + /** + * Test the property 'enabledGranularTimeBreakdown' + */ + @Test + public void enabledGranularTimeBreakdownTest() { + // TODO: test enabledGranularTimeBreakdown + } + + /** + * Test the property 'lastGeneratedAt' + */ + @Test + public void lastGeneratedAtTest() { + // TODO: test lastGeneratedAt + } + + /** + * Test the property 'timeZone' + */ + @Test + public void timeZoneTest() { + // TODO: test timeZone + } + + /** + * Test the property 'csvFileUrl' + */ + @Test + public void csvFileUrlTest() { + // TODO: test csvFileUrl + } + + /** + * Test the property 'xlsxFileUrl' + */ + @Test + public void xlsxFileUrlTest() { + // TODO: test xlsxFileUrl + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/PageJsmopsOnCallRespondersTaskParamsTest.java b/src/test/java/com/rootly/client/model/PageJsmopsOnCallRespondersTaskParamsTest.java new file mode 100644 index 00000000..630d2664 --- /dev/null +++ b/src/test/java/com/rootly/client/model/PageJsmopsOnCallRespondersTaskParamsTest.java @@ -0,0 +1,100 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PageJsmopsOnCallRespondersTaskParams + */ +public class PageJsmopsOnCallRespondersTaskParamsTest { + private final PageJsmopsOnCallRespondersTaskParams model = new PageJsmopsOnCallRespondersTaskParams(); + + /** + * Model tests for PageJsmopsOnCallRespondersTaskParams + */ + @Test + public void testPageJsmopsOnCallRespondersTaskParams() { + // TODO: test PageJsmopsOnCallRespondersTaskParams + } + + /** + * Test the property 'taskType' + */ + @Test + public void taskTypeTest() { + // TODO: test taskType + } + + /** + * Test the property 'title' + */ + @Test + public void titleTest() { + // TODO: test title + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'teams' + */ + @Test + public void teamsTest() { + // TODO: test teams + } + + /** + * Test the property 'users' + */ + @Test + public void usersTest() { + // TODO: test users + } + + /** + * Test the property 'priority' + */ + @Test + public void priorityTest() { + // TODO: test priority + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInnerTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInnerTest.java new file mode 100644 index 00000000..25292fa0 --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInnerTest.java @@ -0,0 +1,124 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + */ +public class PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInnerTest { + private final PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner model = new PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner(); + + /** + * Model tests for PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + */ + @Test + public void testPatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner() { + // TODO: test PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'destroy' + */ + @Test + public void destroyTest() { + // TODO: test destroy + } + + /** + * Test the property 'propertyFieldConditionType' + */ + @Test + public void propertyFieldConditionTypeTest() { + // TODO: test propertyFieldConditionType + } + + /** + * Test the property 'propertyFieldName' + */ + @Test + public void propertyFieldNameTest() { + // TODO: test propertyFieldName + } + + /** + * Test the property 'propertyFieldType' + */ + @Test + public void propertyFieldTypeTest() { + // TODO: test propertyFieldType + } + + /** + * Test the property 'propertyFieldValue' + */ + @Test + public void propertyFieldValueTest() { + // TODO: test propertyFieldValue + } + + /** + * Test the property 'propertyFieldValues' + */ + @Test + public void propertyFieldValuesTest() { + // TODO: test propertyFieldValues + } + + /** + * Test the property 'alertUrgencyIds' + */ + @Test + public void alertUrgencyIdsTest() { + // TODO: test alertUrgencyIds + } + + /** + * Test the property 'conditionableType' + */ + @Test + public void conditionableTypeTest() { + // TODO: test conditionableType + } + + /** + * Test the property 'conditionableId' + */ + @Test + public void conditionableIdTest() { + // TODO: test conditionableId + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerTest.java new file mode 100644 index 00000000..905ed75d --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerTest.java @@ -0,0 +1,76 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerConditionsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + */ +public class PatchAlertRouteDataAttributesRulesInnerConditionGroupsInnerTest { + private final PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner model = new PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner(); + + /** + * Model tests for PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + */ + @Test + public void testPatchAlertRouteDataAttributesRulesInnerConditionGroupsInner() { + // TODO: test PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'destroy' + */ + @Test + public void destroyTest() { + // TODO: test destroy + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'conditions' + */ + @Test + public void conditionsTest() { + // TODO: test conditions + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerDestinationsInnerTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerDestinationsInnerTest.java new file mode 100644 index 00000000..c93bfb93 --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerDestinationsInnerTest.java @@ -0,0 +1,73 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRouteDataAttributesRulesInnerDestinationsInner + */ +public class PatchAlertRouteDataAttributesRulesInnerDestinationsInnerTest { + private final PatchAlertRouteDataAttributesRulesInnerDestinationsInner model = new PatchAlertRouteDataAttributesRulesInnerDestinationsInner(); + + /** + * Model tests for PatchAlertRouteDataAttributesRulesInnerDestinationsInner + */ + @Test + public void testPatchAlertRouteDataAttributesRulesInnerDestinationsInner() { + // TODO: test PatchAlertRouteDataAttributesRulesInnerDestinationsInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'destroy' + */ + @Test + public void destroyTest() { + // TODO: test destroy + } + + /** + * Test the property 'targetType' + */ + @Test + public void targetTypeTest() { + // TODO: test targetType + } + + /** + * Test the property 'targetId' + */ + @Test + public void targetIdTest() { + // TODO: test targetId + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerTest.java new file mode 100644 index 00000000..891e147a --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesRulesInnerTest.java @@ -0,0 +1,101 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInnerConditionGroupsInner; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInnerDestinationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRouteDataAttributesRulesInner + */ +public class PatchAlertRouteDataAttributesRulesInnerTest { + private final PatchAlertRouteDataAttributesRulesInner model = new PatchAlertRouteDataAttributesRulesInner(); + + /** + * Model tests for PatchAlertRouteDataAttributesRulesInner + */ + @Test + public void testPatchAlertRouteDataAttributesRulesInner() { + // TODO: test PatchAlertRouteDataAttributesRulesInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'destroy' + */ + @Test + public void destroyTest() { + // TODO: test destroy + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'fallbackRule' + */ + @Test + public void fallbackRuleTest() { + // TODO: test fallbackRule + } + + /** + * Test the property 'destinations' + */ + @Test + public void destinationsTest() { + // TODO: test destinations + } + + /** + * Test the property 'conditionGroups' + */ + @Test + public void conditionGroupsTest() { + // TODO: test conditionGroups + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesTest.java new file mode 100644 index 00000000..98d95cfc --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteDataAttributesTest.java @@ -0,0 +1,84 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributesRulesInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRouteDataAttributes + */ +public class PatchAlertRouteDataAttributesTest { + private final PatchAlertRouteDataAttributes model = new PatchAlertRouteDataAttributes(); + + /** + * Model tests for PatchAlertRouteDataAttributes + */ + @Test + public void testPatchAlertRouteDataAttributes() { + // TODO: test PatchAlertRouteDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + + /** + * Test the property 'alertsSourceIds' + */ + @Test + public void alertsSourceIdsTest() { + // TODO: test alertsSourceIds + } + + /** + * Test the property 'owningTeamIds' + */ + @Test + public void owningTeamIdsTest() { + // TODO: test owningTeamIds + } + + /** + * Test the property 'rules' + */ + @Test + public void rulesTest() { + // TODO: test rules + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteDataTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteDataTest.java new file mode 100644 index 00000000..60c46803 --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRouteData + */ +public class PatchAlertRouteDataTest { + private final PatchAlertRouteData model = new PatchAlertRouteData(); + + /** + * Model tests for PatchAlertRouteData + */ + @Test + public void testPatchAlertRouteData() { + // TODO: test PatchAlertRouteData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/PatchAlertRouteTest.java b/src/test/java/com/rootly/client/model/PatchAlertRouteTest.java new file mode 100644 index 00000000..0c07f595 --- /dev/null +++ b/src/test/java/com/rootly/client/model/PatchAlertRouteTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.PatchAlertRouteData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PatchAlertRoute + */ +public class PatchAlertRouteTest { + private final PatchAlertRoute model = new PatchAlertRoute(); + + /** + * Model tests for PatchAlertRoute + */ + @Test + public void testPatchAlertRoute() { + // TODO: test PatchAlertRoute + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/RotateApiKeyDataAttributesTest.java b/src/test/java/com/rootly/client/model/RotateApiKeyDataAttributesTest.java new file mode 100644 index 00000000..11e1043a --- /dev/null +++ b/src/test/java/com/rootly/client/model/RotateApiKeyDataAttributesTest.java @@ -0,0 +1,58 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RotateApiKeyDataAttributes + */ +public class RotateApiKeyDataAttributesTest { + private final RotateApiKeyDataAttributes model = new RotateApiKeyDataAttributes(); + + /** + * Model tests for RotateApiKeyDataAttributes + */ + @Test + public void testRotateApiKeyDataAttributes() { + // TODO: test RotateApiKeyDataAttributes + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + + /** + * Test the property 'gracePeriodMinutes' + */ + @Test + public void gracePeriodMinutesTest() { + // TODO: test gracePeriodMinutes + } + +} diff --git a/src/test/java/com/rootly/client/model/RotateApiKeyDataTest.java b/src/test/java/com/rootly/client/model/RotateApiKeyDataTest.java new file mode 100644 index 00000000..477321ed --- /dev/null +++ b/src/test/java/com/rootly/client/model/RotateApiKeyDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.RotateApiKeyDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RotateApiKeyData + */ +public class RotateApiKeyDataTest { + private final RotateApiKeyData model = new RotateApiKeyData(); + + /** + * Model tests for RotateApiKeyData + */ + @Test + public void testRotateApiKeyData() { + // TODO: test RotateApiKeyData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/RotateApiKeyTest.java b/src/test/java/com/rootly/client/model/RotateApiKeyTest.java new file mode 100644 index 00000000..a1c87157 --- /dev/null +++ b/src/test/java/com/rootly/client/model/RotateApiKeyTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.RotateApiKeyData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for RotateApiKey + */ +public class RotateApiKeyTest { + private final RotateApiKey model = new RotateApiKey(); + + /** + * Model tests for RotateApiKey + */ + @Test + public void testRotateApiKey() { + // TODO: test RotateApiKey + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/SendMicrosoftTeamsChatMessageTaskParamsTest.java b/src/test/java/com/rootly/client/model/SendMicrosoftTeamsChatMessageTaskParamsTest.java new file mode 100644 index 00000000..323b6b1c --- /dev/null +++ b/src/test/java/com/rootly/client/model/SendMicrosoftTeamsChatMessageTaskParamsTest.java @@ -0,0 +1,67 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SendMicrosoftTeamsChatMessageTaskParams + */ +public class SendMicrosoftTeamsChatMessageTaskParamsTest { + private final SendMicrosoftTeamsChatMessageTaskParams model = new SendMicrosoftTeamsChatMessageTaskParams(); + + /** + * Model tests for SendMicrosoftTeamsChatMessageTaskParams + */ + @Test + public void testSendMicrosoftTeamsChatMessageTaskParams() { + // TODO: test SendMicrosoftTeamsChatMessageTaskParams + } + + /** + * Test the property 'taskType' + */ + @Test + public void taskTypeTest() { + // TODO: test taskType + } + + /** + * Test the property 'chats' + */ + @Test + public void chatsTest() { + // TODO: test chats + } + + /** + * Test the property 'text' + */ + @Test + public void textTest() { + // TODO: test text + } + +} diff --git a/src/test/java/com/rootly/client/model/SlaConditionsInnerTest.java b/src/test/java/com/rootly/client/model/SlaConditionsInnerTest.java new file mode 100644 index 00000000..8f51d933 --- /dev/null +++ b/src/test/java/com/rootly/client/model/SlaConditionsInnerTest.java @@ -0,0 +1,100 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SlaConditionsInner + */ +public class SlaConditionsInnerTest { + private final SlaConditionsInner model = new SlaConditionsInner(); + + /** + * Model tests for SlaConditionsInner + */ + @Test + public void testSlaConditionsInner() { + // TODO: test SlaConditionsInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'conditionableType' + */ + @Test + public void conditionableTypeTest() { + // TODO: test conditionableType + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property 'operator' + */ + @Test + public void operatorTest() { + // TODO: test operator + } + + /** + * Test the property 'values' + */ + @Test + public void valuesTest() { + // TODO: test values + } + + /** + * Test the property 'formFieldId' + */ + @Test + public void formFieldIdTest() { + // TODO: test formFieldId + } + +} diff --git a/src/test/java/com/rootly/client/model/SlaListTest.java b/src/test/java/com/rootly/client/model/SlaListTest.java new file mode 100644 index 00000000..a2dea984 --- /dev/null +++ b/src/test/java/com/rootly/client/model/SlaListTest.java @@ -0,0 +1,69 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.Links; +import com.rootly.client.model.Meta; +import com.rootly.client.model.SlaResponseData; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SlaList + */ +public class SlaListTest { + private final SlaList model = new SlaList(); + + /** + * Model tests for SlaList + */ + @Test + public void testSlaList() { + // TODO: test SlaList + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'links' + */ + @Test + public void linksTest() { + // TODO: test links + } + + /** + * Test the property 'meta' + */ + @Test + public void metaTest() { + // TODO: test meta + } + +} diff --git a/src/test/java/com/rootly/client/model/SlaNotificationConfigurationsInnerTest.java b/src/test/java/com/rootly/client/model/SlaNotificationConfigurationsInnerTest.java new file mode 100644 index 00000000..898dd2ef --- /dev/null +++ b/src/test/java/com/rootly/client/model/SlaNotificationConfigurationsInnerTest.java @@ -0,0 +1,81 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SlaNotificationConfigurationsInner + */ +public class SlaNotificationConfigurationsInnerTest { + private final SlaNotificationConfigurationsInner model = new SlaNotificationConfigurationsInner(); + + /** + * Model tests for SlaNotificationConfigurationsInner + */ + @Test + public void testSlaNotificationConfigurationsInner() { + // TODO: test SlaNotificationConfigurationsInner + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'offsetType' + */ + @Test + public void offsetTypeTest() { + // TODO: test offsetType + } + + /** + * Test the property 'offsetDays' + */ + @Test + public void offsetDaysTest() { + // TODO: test offsetDays + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/SlaResponseDataTest.java b/src/test/java/com/rootly/client/model/SlaResponseDataTest.java new file mode 100644 index 00000000..54f56a68 --- /dev/null +++ b/src/test/java/com/rootly/client/model/SlaResponseDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.Sla; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SlaResponseData + */ +public class SlaResponseDataTest { + private final SlaResponseData model = new SlaResponseData(); + + /** + * Model tests for SlaResponseData + */ + @Test + public void testSlaResponseData() { + // TODO: test SlaResponseData + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/SlaResponseTest.java b/src/test/java/com/rootly/client/model/SlaResponseTest.java new file mode 100644 index 00000000..ab764c08 --- /dev/null +++ b/src/test/java/com/rootly/client/model/SlaResponseTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SlaResponseData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SlaResponse + */ +public class SlaResponseTest { + private final SlaResponse model = new SlaResponse(); + + /** + * Model tests for SlaResponse + */ + @Test + public void testSlaResponse() { + // TODO: test SlaResponse + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/SlaTest.java b/src/test/java/com/rootly/client/model/SlaTest.java new file mode 100644 index 00000000..f5578c8c --- /dev/null +++ b/src/test/java/com/rootly/client/model/SlaTest.java @@ -0,0 +1,206 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SlaConditionsInner; +import com.rootly.client.model.SlaNotificationConfigurationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Sla + */ +public class SlaTest { + private final Sla model = new Sla(); + + /** + * Model tests for Sla + */ + @Test + public void testSla() { + // TODO: test Sla + } + + /** + * Test the property 'slug' + */ + @Test + public void slugTest() { + // TODO: test slug + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'entityType' + */ + @Test + public void entityTypeTest() { + // TODO: test entityType + } + + /** + * Test the property 'conditionMatchType' + */ + @Test + public void conditionMatchTypeTest() { + // TODO: test conditionMatchType + } + + /** + * Test the property 'managerRoleId' + */ + @Test + public void managerRoleIdTest() { + // TODO: test managerRoleId + } + + /** + * Test the property 'managerUserId' + */ + @Test + public void managerUserIdTest() { + // TODO: test managerUserId + } + + /** + * Test the property 'assignmentDeadlineDays' + */ + @Test + public void assignmentDeadlineDaysTest() { + // TODO: test assignmentDeadlineDays + } + + /** + * Test the property 'assignmentDeadlineParentStatus' + */ + @Test + public void assignmentDeadlineParentStatusTest() { + // TODO: test assignmentDeadlineParentStatus + } + + /** + * Test the property 'assignmentDeadlineSubStatusId' + */ + @Test + public void assignmentDeadlineSubStatusIdTest() { + // TODO: test assignmentDeadlineSubStatusId + } + + /** + * Test the property 'assignmentSkipWeekends' + */ + @Test + public void assignmentSkipWeekendsTest() { + // TODO: test assignmentSkipWeekends + } + + /** + * Test the property 'completionDeadlineDays' + */ + @Test + public void completionDeadlineDaysTest() { + // TODO: test completionDeadlineDays + } + + /** + * Test the property 'completionDeadlineParentStatus' + */ + @Test + public void completionDeadlineParentStatusTest() { + // TODO: test completionDeadlineParentStatus + } + + /** + * Test the property 'completionDeadlineSubStatusId' + */ + @Test + public void completionDeadlineSubStatusIdTest() { + // TODO: test completionDeadlineSubStatusId + } + + /** + * Test the property 'completionSkipWeekends' + */ + @Test + public void completionSkipWeekendsTest() { + // TODO: test completionSkipWeekends + } + + /** + * Test the property 'conditions' + */ + @Test + public void conditionsTest() { + // TODO: test conditions + } + + /** + * Test the property 'notificationConfigurations' + */ + @Test + public void notificationConfigurationsTest() { + // TODO: test notificationConfigurations + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/com/rootly/client/model/SnoozeAlertDataAttributesTest.java b/src/test/java/com/rootly/client/model/SnoozeAlertDataAttributesTest.java new file mode 100644 index 00000000..c529f41e --- /dev/null +++ b/src/test/java/com/rootly/client/model/SnoozeAlertDataAttributesTest.java @@ -0,0 +1,48 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SnoozeAlertDataAttributes + */ +public class SnoozeAlertDataAttributesTest { + private final SnoozeAlertDataAttributes model = new SnoozeAlertDataAttributes(); + + /** + * Model tests for SnoozeAlertDataAttributes + */ + @Test + public void testSnoozeAlertDataAttributes() { + // TODO: test SnoozeAlertDataAttributes + } + + /** + * Test the property 'delayMinutes' + */ + @Test + public void delayMinutesTest() { + // TODO: test delayMinutes + } + +} diff --git a/src/test/java/com/rootly/client/model/SnoozeAlertDataTest.java b/src/test/java/com/rootly/client/model/SnoozeAlertDataTest.java new file mode 100644 index 00000000..c7a2c779 --- /dev/null +++ b/src/test/java/com/rootly/client/model/SnoozeAlertDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SnoozeAlertDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SnoozeAlertData + */ +public class SnoozeAlertDataTest { + private final SnoozeAlertData model = new SnoozeAlertData(); + + /** + * Model tests for SnoozeAlertData + */ + @Test + public void testSnoozeAlertData() { + // TODO: test SnoozeAlertData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/SnoozeAlertTest.java b/src/test/java/com/rootly/client/model/SnoozeAlertTest.java new file mode 100644 index 00000000..a03cc404 --- /dev/null +++ b/src/test/java/com/rootly/client/model/SnoozeAlertTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.SnoozeAlertData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SnoozeAlert + */ +public class SnoozeAlertTest { + private final SnoozeAlert model = new SnoozeAlert(); + + /** + * Model tests for SnoozeAlert + */ + @Test + public void testSnoozeAlert() { + // TODO: test SnoozeAlert + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateApiKeyDataAttributesTest.java b/src/test/java/com/rootly/client/model/UpdateApiKeyDataAttributesTest.java new file mode 100644 index 00000000..6dcbfd60 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateApiKeyDataAttributesTest.java @@ -0,0 +1,66 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateApiKeyDataAttributes + */ +public class UpdateApiKeyDataAttributesTest { + private final UpdateApiKeyDataAttributes model = new UpdateApiKeyDataAttributes(); + + /** + * Model tests for UpdateApiKeyDataAttributes + */ + @Test + public void testUpdateApiKeyDataAttributes() { + // TODO: test UpdateApiKeyDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'expiresAt' + */ + @Test + public void expiresAtTest() { + // TODO: test expiresAt + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateApiKeyDataTest.java b/src/test/java/com/rootly/client/model/UpdateApiKeyDataTest.java new file mode 100644 index 00000000..d5957110 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateApiKeyDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateApiKeyDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateApiKeyData + */ +public class UpdateApiKeyDataTest { + private final UpdateApiKeyData model = new UpdateApiKeyData(); + + /** + * Model tests for UpdateApiKeyData + */ + @Test + public void testUpdateApiKeyData() { + // TODO: test UpdateApiKeyData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateApiKeyTest.java b/src/test/java/com/rootly/client/model/UpdateApiKeyTest.java new file mode 100644 index 00000000..01f95b6a --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateApiKeyTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateApiKeyData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateApiKey + */ +public class UpdateApiKeyTest { + private final UpdateApiKey model = new UpdateApiKey(); + + /** + * Model tests for UpdateApiKey + */ + @Test + public void testUpdateApiKey() { + // TODO: test UpdateApiKey + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataAttributesTest.java b/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataAttributesTest.java new file mode 100644 index 00000000..0f0220e7 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataAttributesTest.java @@ -0,0 +1,77 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesFieldsInner; +import com.rootly.client.model.NewCatalogChecklistTemplateDataAttributesOwnersInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateCatalogChecklistTemplateDataAttributes + */ +public class UpdateCatalogChecklistTemplateDataAttributesTest { + private final UpdateCatalogChecklistTemplateDataAttributes model = new UpdateCatalogChecklistTemplateDataAttributes(); + + /** + * Model tests for UpdateCatalogChecklistTemplateDataAttributes + */ + @Test + public void testUpdateCatalogChecklistTemplateDataAttributes() { + // TODO: test UpdateCatalogChecklistTemplateDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'fields' + */ + @Test + public void fieldsTest() { + // TODO: test fields + } + + /** + * Test the property 'owners' + */ + @Test + public void ownersTest() { + // TODO: test owners + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataTest.java b/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataTest.java new file mode 100644 index 00000000..63cae73f --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogChecklistTemplateDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateCatalogChecklistTemplateData + */ +public class UpdateCatalogChecklistTemplateDataTest { + private final UpdateCatalogChecklistTemplateData model = new UpdateCatalogChecklistTemplateData(); + + /** + * Model tests for UpdateCatalogChecklistTemplateData + */ + @Test + public void testUpdateCatalogChecklistTemplateData() { + // TODO: test UpdateCatalogChecklistTemplateData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateTest.java b/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateTest.java new file mode 100644 index 00000000..34d4e0eb --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateCatalogChecklistTemplateTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogChecklistTemplateData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateCatalogChecklistTemplate + */ +public class UpdateCatalogChecklistTemplateTest { + private final UpdateCatalogChecklistTemplate model = new UpdateCatalogChecklistTemplate(); + + /** + * Model tests for UpdateCatalogChecklistTemplate + */ + @Test + public void testUpdateCatalogChecklistTemplate() { + // TODO: test UpdateCatalogChecklistTemplate + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateCatalogPropertyDataAttributesTest.java b/src/test/java/com/rootly/client/model/UpdateCatalogPropertyDataAttributesTest.java new file mode 100644 index 00000000..53c2bbae --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateCatalogPropertyDataAttributesTest.java @@ -0,0 +1,89 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateCatalogPropertyDataAttributes + */ +public class UpdateCatalogPropertyDataAttributesTest { + private final UpdateCatalogPropertyDataAttributes model = new UpdateCatalogPropertyDataAttributes(); + + /** + * Model tests for UpdateCatalogPropertyDataAttributes + */ + @Test + public void testUpdateCatalogPropertyDataAttributes() { + // TODO: test UpdateCatalogPropertyDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + + /** + * Test the property 'kindCatalogId' + */ + @Test + public void kindCatalogIdTest() { + // TODO: test kindCatalogId + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'required' + */ + @Test + public void requiredTest() { + // TODO: test required + } + + /** + * Test the property 'catalogType' + */ + @Test + public void catalogTypeTest() { + // TODO: test catalogType + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateCatalogPropertyDataTest.java b/src/test/java/com/rootly/client/model/UpdateCatalogPropertyDataTest.java new file mode 100644 index 00000000..2d575e5e --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateCatalogPropertyDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogPropertyDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateCatalogPropertyData + */ +public class UpdateCatalogPropertyDataTest { + private final UpdateCatalogPropertyData model = new UpdateCatalogPropertyData(); + + /** + * Model tests for UpdateCatalogPropertyData + */ + @Test + public void testUpdateCatalogPropertyData() { + // TODO: test UpdateCatalogPropertyData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateCatalogPropertyTest.java b/src/test/java/com/rootly/client/model/UpdateCatalogPropertyTest.java new file mode 100644 index 00000000..1505c0b0 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateCatalogPropertyTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateCatalogPropertyData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateCatalogProperty + */ +public class UpdateCatalogPropertyTest { + private final UpdateCatalogProperty model = new UpdateCatalogProperty(); + + /** + * Model tests for UpdateCatalogProperty + */ + @Test + public void testUpdateCatalogProperty() { + // TODO: test UpdateCatalogProperty + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestActionTest.java b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestActionTest.java new file mode 100644 index 00000000..fd61ed39 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestActionTest.java @@ -0,0 +1,64 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateEdgeConnectorActionRequestAction + */ +public class UpdateEdgeConnectorActionRequestActionTest { + private final UpdateEdgeConnectorActionRequestAction model = new UpdateEdgeConnectorActionRequestAction(); + + /** + * Model tests for UpdateEdgeConnectorActionRequestAction + */ + @Test + public void testUpdateEdgeConnectorActionRequestAction() { + // TODO: test UpdateEdgeConnectorActionRequestAction + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'actionType' + */ + @Test + public void actionTypeTest() { + // TODO: test actionType + } + + /** + * Test the property 'metadata' + */ + @Test + public void metadataTest() { + // TODO: test metadata + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestTest.java b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestTest.java new file mode 100644 index 00000000..ee48d26c --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorActionRequestTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateEdgeConnectorActionRequestAction; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateEdgeConnectorActionRequest + */ +public class UpdateEdgeConnectorActionRequestTest { + private final UpdateEdgeConnectorActionRequest model = new UpdateEdgeConnectorActionRequest(); + + /** + * Model tests for UpdateEdgeConnectorActionRequest + */ + @Test + public void testUpdateEdgeConnectorActionRequest() { + // TODO: test UpdateEdgeConnectorActionRequest + } + + /** + * Test the property 'action' + */ + @Test + public void actionTest() { + // TODO: test action + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataAttributesTest.java b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataAttributesTest.java new file mode 100644 index 00000000..f60b215f --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataAttributesTest.java @@ -0,0 +1,74 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateEdgeConnectorRequestDataAttributes + */ +public class UpdateEdgeConnectorRequestDataAttributesTest { + private final UpdateEdgeConnectorRequestDataAttributes model = new UpdateEdgeConnectorRequestDataAttributes(); + + /** + * Model tests for UpdateEdgeConnectorRequestDataAttributes + */ + @Test + public void testUpdateEdgeConnectorRequestDataAttributes() { + // TODO: test UpdateEdgeConnectorRequestDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'subscriptions' + */ + @Test + public void subscriptionsTest() { + // TODO: test subscriptions + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataTest.java b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataTest.java new file mode 100644 index 00000000..11006fd6 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestDataTest.java @@ -0,0 +1,65 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateEdgeConnectorRequestDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateEdgeConnectorRequestData + */ +public class UpdateEdgeConnectorRequestDataTest { + private final UpdateEdgeConnectorRequestData model = new UpdateEdgeConnectorRequestData(); + + /** + * Model tests for UpdateEdgeConnectorRequestData + */ + @Test + public void testUpdateEdgeConnectorRequestData() { + // TODO: test UpdateEdgeConnectorRequestData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestTest.java b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestTest.java new file mode 100644 index 00000000..3571183b --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateEdgeConnectorRequestTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateEdgeConnectorRequestData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateEdgeConnectorRequest + */ +public class UpdateEdgeConnectorRequestTest { + private final UpdateEdgeConnectorRequest model = new UpdateEdgeConnectorRequest(); + + /** + * Model tests for UpdateEdgeConnectorRequest + */ + @Test + public void testUpdateEdgeConnectorRequest() { + // TODO: test UpdateEdgeConnectorRequest + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateGithubIssueTaskParamsRepositoryTest.java b/src/test/java/com/rootly/client/model/UpdateGithubIssueTaskParamsRepositoryTest.java new file mode 100644 index 00000000..bca25beb --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateGithubIssueTaskParamsRepositoryTest.java @@ -0,0 +1,56 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateGithubIssueTaskParamsRepository + */ +public class UpdateGithubIssueTaskParamsRepositoryTest { + private final UpdateGithubIssueTaskParamsRepository model = new UpdateGithubIssueTaskParamsRepository(); + + /** + * Model tests for UpdateGithubIssueTaskParamsRepository + */ + @Test + public void testUpdateGithubIssueTaskParamsRepository() { + // TODO: test UpdateGithubIssueTaskParamsRepository + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateOnCallPayReportDataAttributesTest.java b/src/test/java/com/rootly/client/model/UpdateOnCallPayReportDataAttributesTest.java new file mode 100644 index 00000000..0591b208 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateOnCallPayReportDataAttributesTest.java @@ -0,0 +1,67 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateOnCallPayReportDataAttributes + */ +public class UpdateOnCallPayReportDataAttributesTest { + private final UpdateOnCallPayReportDataAttributes model = new UpdateOnCallPayReportDataAttributes(); + + /** + * Model tests for UpdateOnCallPayReportDataAttributes + */ + @Test + public void testUpdateOnCallPayReportDataAttributes() { + // TODO: test UpdateOnCallPayReportDataAttributes + } + + /** + * Test the property 'startDate' + */ + @Test + public void startDateTest() { + // TODO: test startDate + } + + /** + * Test the property 'endDate' + */ + @Test + public void endDateTest() { + // TODO: test endDate + } + + /** + * Test the property 'scheduleIds' + */ + @Test + public void scheduleIdsTest() { + // TODO: test scheduleIds + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateOnCallPayReportDataTest.java b/src/test/java/com/rootly/client/model/UpdateOnCallPayReportDataTest.java new file mode 100644 index 00000000..a34d7731 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateOnCallPayReportDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateOnCallPayReportDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateOnCallPayReportData + */ +public class UpdateOnCallPayReportDataTest { + private final UpdateOnCallPayReportData model = new UpdateOnCallPayReportData(); + + /** + * Model tests for UpdateOnCallPayReportData + */ + @Test + public void testUpdateOnCallPayReportData() { + // TODO: test UpdateOnCallPayReportData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateOnCallPayReportTest.java b/src/test/java/com/rootly/client/model/UpdateOnCallPayReportTest.java new file mode 100644 index 00000000..79ca3ba6 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateOnCallPayReportTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateOnCallPayReportData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateOnCallPayReport + */ +public class UpdateOnCallPayReportTest { + private final UpdateOnCallPayReport model = new UpdateOnCallPayReport(); + + /** + * Model tests for UpdateOnCallPayReport + */ + @Test + public void testUpdateOnCallPayReport() { + // TODO: test UpdateOnCallPayReport + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateSlaDataAttributesTest.java b/src/test/java/com/rootly/client/model/UpdateSlaDataAttributesTest.java new file mode 100644 index 00000000..c2df3d48 --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateSlaDataAttributesTest.java @@ -0,0 +1,174 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.NewSlaDataAttributesConditionsInner; +import com.rootly.client.model.NewSlaDataAttributesNotificationConfigurationsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateSlaDataAttributes + */ +public class UpdateSlaDataAttributesTest { + private final UpdateSlaDataAttributes model = new UpdateSlaDataAttributes(); + + /** + * Model tests for UpdateSlaDataAttributes + */ + @Test + public void testUpdateSlaDataAttributes() { + // TODO: test UpdateSlaDataAttributes + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'position' + */ + @Test + public void positionTest() { + // TODO: test position + } + + /** + * Test the property 'conditionMatchType' + */ + @Test + public void conditionMatchTypeTest() { + // TODO: test conditionMatchType + } + + /** + * Test the property 'managerRoleId' + */ + @Test + public void managerRoleIdTest() { + // TODO: test managerRoleId + } + + /** + * Test the property 'managerUserId' + */ + @Test + public void managerUserIdTest() { + // TODO: test managerUserId + } + + /** + * Test the property 'assignmentDeadlineDays' + */ + @Test + public void assignmentDeadlineDaysTest() { + // TODO: test assignmentDeadlineDays + } + + /** + * Test the property 'assignmentDeadlineParentStatus' + */ + @Test + public void assignmentDeadlineParentStatusTest() { + // TODO: test assignmentDeadlineParentStatus + } + + /** + * Test the property 'assignmentDeadlineSubStatusId' + */ + @Test + public void assignmentDeadlineSubStatusIdTest() { + // TODO: test assignmentDeadlineSubStatusId + } + + /** + * Test the property 'assignmentSkipWeekends' + */ + @Test + public void assignmentSkipWeekendsTest() { + // TODO: test assignmentSkipWeekends + } + + /** + * Test the property 'completionDeadlineDays' + */ + @Test + public void completionDeadlineDaysTest() { + // TODO: test completionDeadlineDays + } + + /** + * Test the property 'completionDeadlineParentStatus' + */ + @Test + public void completionDeadlineParentStatusTest() { + // TODO: test completionDeadlineParentStatus + } + + /** + * Test the property 'completionDeadlineSubStatusId' + */ + @Test + public void completionDeadlineSubStatusIdTest() { + // TODO: test completionDeadlineSubStatusId + } + + /** + * Test the property 'completionSkipWeekends' + */ + @Test + public void completionSkipWeekendsTest() { + // TODO: test completionSkipWeekends + } + + /** + * Test the property 'conditions' + */ + @Test + public void conditionsTest() { + // TODO: test conditions + } + + /** + * Test the property 'notificationConfigurations' + */ + @Test + public void notificationConfigurationsTest() { + // TODO: test notificationConfigurations + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateSlaDataTest.java b/src/test/java/com/rootly/client/model/UpdateSlaDataTest.java new file mode 100644 index 00000000..684cef6f --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateSlaDataTest.java @@ -0,0 +1,57 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateSlaDataAttributes; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateSlaData + */ +public class UpdateSlaDataTest { + private final UpdateSlaData model = new UpdateSlaData(); + + /** + * Model tests for UpdateSlaData + */ + @Test + public void testUpdateSlaData() { + // TODO: test UpdateSlaData + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'attributes' + */ + @Test + public void attributesTest() { + // TODO: test attributes + } + +} diff --git a/src/test/java/com/rootly/client/model/UpdateSlaTest.java b/src/test/java/com/rootly/client/model/UpdateSlaTest.java new file mode 100644 index 00000000..41e38b6f --- /dev/null +++ b/src/test/java/com/rootly/client/model/UpdateSlaTest.java @@ -0,0 +1,49 @@ +/* + * Rootly API v1 + * # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ```
# Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ``` + * + * The version of the OpenAPI document: v1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.rootly.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.rootly.client.model.UpdateSlaData; +import java.io.IOException; +import java.util.Arrays; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for UpdateSla + */ +public class UpdateSlaTest { + private final UpdateSla model = new UpdateSla(); + + /** + * Model tests for UpdateSla + */ + @Test + public void testUpdateSla() { + // TODO: test UpdateSla + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + +}