From a46f35d098f6e8364411bb1d910910e6198ecf71 Mon Sep 17 00:00:00 2001 From: totvslabs Date: Thu, 10 Aug 2023 17:30:48 +0000 Subject: [PATCH] Update from https://github.com/totvslabs/alert-manager/commit/314be2d3dbf3c1ea0e7715c6de23e6fb90f34cd3 --- README.md | 62 +- api/openapi.yaml | 624 ++++++++++++-- docs/ChannelsApi.md | 414 +++++++++ docs/DocsApi.md | 134 +++ docs/EventSchema.md | 23 + docs/EventsApi.md | 272 ++++++ docs/HealthCheckApi.md | 71 ++ docs/NotificationsApi.md | 140 +++ docs/PaginationSchema.md | 16 + docs/PoliciesApi.md | 346 ++++++++ docs/PolicyChannelSchema.md | 22 + docs/PolicySchema.md | 28 + docs/WelcomeApi.md | 71 ++ pom.xml | 1 - .../org/openapitools/client/ApiClient.java | 11 +- .../org/openapitools/client/ApiException.java | 5 +- .../openapitools/client/Configuration.java | 2 +- .../java/org/openapitools/client/JSON.java | 5 +- .../java/org/openapitools/client/Pair.java | 2 +- .../org/openapitools/client/StringUtil.java | 2 +- .../openapitools/client/api/ChannelsApi.java | 796 ++++++++++++++++++ .../org/openapitools/client/api/DocsApi.java | 290 +++++++ .../openapitools/client/api/EventsApi.java | 542 ++++++++++++ .../client/api/HealthCheckApi.java | 182 ++++ .../client/api/NotificationsApi.java | 312 +++++++ .../openapitools/client/api/PoliciesApi.java | 679 +++++++++++++++ .../openapitools/client/api/WelcomeApi.java | 182 ++++ .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/HttpBearerAuth.java | 2 +- .../client/model/AbstractOpenApiSchema.java | 5 +- .../client/model/EventSchema.java | 524 ++++++++++++ .../client/model/PaginationSchema.java | 317 +++++++ .../client/model/PolicyChannelSchema.java | 497 +++++++++++ .../client/model/PolicySchema.java | 666 +++++++++++++++ .../client/api/ChannelsApiTest.java | 95 +++ .../openapitools/client/api/DocsApiTest.java | 51 ++ .../client/api/EventsApiTest.java | 73 ++ .../client/api/HealthCheckApiTest.java | 42 + .../client/api/NotificationsApiTest.java | 54 ++ .../client/api/PoliciesApiTest.java | 85 ++ .../client/api/WelcomeApiTest.java | 42 + .../client/model/EventSchemaTest.java | 128 +++ .../client/model/PaginationSchemaTest.java | 73 ++ .../client/model/PolicyChannelSchemaTest.java | 121 +++ .../client/model/PolicySchemaTest.java | 168 ++++ 45 files changed, 8096 insertions(+), 83 deletions(-) create mode 100644 docs/ChannelsApi.md create mode 100644 docs/DocsApi.md create mode 100644 docs/EventSchema.md create mode 100644 docs/EventsApi.md create mode 100644 docs/HealthCheckApi.md create mode 100644 docs/NotificationsApi.md create mode 100644 docs/PaginationSchema.md create mode 100644 docs/PoliciesApi.md create mode 100644 docs/PolicyChannelSchema.md create mode 100644 docs/PolicySchema.md create mode 100644 docs/WelcomeApi.md create mode 100644 src/main/java/org/openapitools/client/api/ChannelsApi.java create mode 100644 src/main/java/org/openapitools/client/api/DocsApi.java create mode 100644 src/main/java/org/openapitools/client/api/EventsApi.java create mode 100644 src/main/java/org/openapitools/client/api/HealthCheckApi.java create mode 100644 src/main/java/org/openapitools/client/api/NotificationsApi.java create mode 100644 src/main/java/org/openapitools/client/api/PoliciesApi.java create mode 100644 src/main/java/org/openapitools/client/api/WelcomeApi.java create mode 100644 src/main/java/org/openapitools/client/model/EventSchema.java create mode 100644 src/main/java/org/openapitools/client/model/PaginationSchema.java create mode 100644 src/main/java/org/openapitools/client/model/PolicyChannelSchema.java create mode 100644 src/main/java/org/openapitools/client/model/PolicySchema.java create mode 100644 src/test/java/org/openapitools/client/api/ChannelsApiTest.java create mode 100644 src/test/java/org/openapitools/client/api/DocsApiTest.java create mode 100644 src/test/java/org/openapitools/client/api/EventsApiTest.java create mode 100644 src/test/java/org/openapitools/client/api/HealthCheckApiTest.java create mode 100644 src/test/java/org/openapitools/client/api/NotificationsApiTest.java create mode 100644 src/test/java/org/openapitools/client/api/PoliciesApiTest.java create mode 100644 src/test/java/org/openapitools/client/api/WelcomeApiTest.java create mode 100644 src/test/java/org/openapitools/client/model/EventSchemaTest.java create mode 100644 src/test/java/org/openapitools/client/model/PaginationSchemaTest.java create mode 100644 src/test/java/org/openapitools/client/model/PolicyChannelSchemaTest.java create mode 100644 src/test/java/org/openapitools/client/model/PolicySchemaTest.java diff --git a/README.md b/README.md index f74b4f1..3f30b92 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ alertmanager - API version: 1.0.0 - - Build date: 2023-06-02T15:01:33.240562Z[Etc/UTC] + - Build date: 2023-08-10T17:30:44.416597Z[Etc/UTC] No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) @@ -83,21 +83,28 @@ Please follow the [installation](#installation) instruction and execute the foll import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; -import org.openapitools.client.api.DefaultApi; +import org.openapitools.client.api.ChannelsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://localhost"); - - DefaultApi apiInstance = new DefaultApi(defaultClient); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); String id = "id_example"; // String | try { - String result = apiInstance.deleteClientAppGetDelete(id); + PolicyChannelSchema result = apiInstance.deletePolicyChannelsDelete(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#deleteClientAppGetDelete"); + System.err.println("Exception when calling ChannelsApi#deletePolicyChannelsDelete"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -114,25 +121,48 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DefaultApi* | [**deleteClientAppGetDelete**](docs/DefaultApi.md#deleteClientAppGetDelete) | **DELETE** /client_apps/{id} | -*DefaultApi* | [**getClientAppGet**](docs/DefaultApi.md#getClientAppGet) | **GET** /client_apps/{id} | -*DefaultApi* | [**getClientAppGetAll**](docs/DefaultApi.md#getClientAppGetAll) | **GET** /client_apps | -*DefaultApi* | [**getDocs**](docs/DefaultApi.md#getDocs) | **GET** /docs | -*DefaultApi* | [**getHealthCheck**](docs/DefaultApi.md#getHealthCheck) | **GET** /health_check | -*DefaultApi* | [**getSwaggerJson**](docs/DefaultApi.md#getSwaggerJson) | **GET** /docs/swagger.json | -*DefaultApi* | [**postClientAppPost**](docs/DefaultApi.md#postClientAppPost) | **POST** /client_apps/{id} | -*DefaultApi* | [**putClientAppPut**](docs/DefaultApi.md#putClientAppPut) | **PUT** /client_apps | +*ChannelsApi* | [**deletePolicyChannelsDelete**](docs/ChannelsApi.md#deletePolicyChannelsDelete) | **DELETE** /channels/{id} | +*ChannelsApi* | [**getPolicyChannelsGet**](docs/ChannelsApi.md#getPolicyChannelsGet) | **GET** /channels/{id} | +*ChannelsApi* | [**getPolicyChannelsGetAll**](docs/ChannelsApi.md#getPolicyChannelsGetAll) | **GET** /channels | +*ChannelsApi* | [**postPolicyChannelsPost**](docs/ChannelsApi.md#postPolicyChannelsPost) | **POST** /channels | +*ChannelsApi* | [**postPolicyChannelsTest**](docs/ChannelsApi.md#postPolicyChannelsTest) | **POST** /channels/test | +*ChannelsApi* | [**putPolicyChannelsPut**](docs/ChannelsApi.md#putPolicyChannelsPut) | **PUT** /channels/{id} | +*DocsApi* | [**getSwaggerJson**](docs/DocsApi.md#getSwaggerJson) | **GET** /docs/swagger.json | +*DocsApi* | [**getSwaggerYml**](docs/DocsApi.md#getSwaggerYml) | **GET** /docs/swagger.yml | +*EventsApi* | [**getEventsGet**](docs/EventsApi.md#getEventsGet) | **GET** /events/{id} | +*EventsApi* | [**getEventsGetAll**](docs/EventsApi.md#getEventsGetAll) | **GET** /events | +*EventsApi* | [**getEventsParametersGet**](docs/EventsApi.md#getEventsParametersGet) | **GET** /events/parameters | +*EventsApi* | [**postEventsPost**](docs/EventsApi.md#postEventsPost) | **POST** /events | +*HealthCheckApi* | [**getHealthCheck**](docs/HealthCheckApi.md#getHealthCheck) | **GET** /health_check | +*NotificationsApi* | [**getNotificationLogGet**](docs/NotificationsApi.md#getNotificationLogGet) | **GET** /notifications/{id} | +*NotificationsApi* | [**getNotificationLogGetAll**](docs/NotificationsApi.md#getNotificationLogGetAll) | **GET** /notifications | +*PoliciesApi* | [**deletePoliciesDelete**](docs/PoliciesApi.md#deletePoliciesDelete) | **DELETE** /policies/{id} | +*PoliciesApi* | [**getPoliciesGet**](docs/PoliciesApi.md#getPoliciesGet) | **GET** /policies/{id} | +*PoliciesApi* | [**getPoliciesGetAll**](docs/PoliciesApi.md#getPoliciesGetAll) | **GET** /policies | +*PoliciesApi* | [**postPoliciesPost**](docs/PoliciesApi.md#postPoliciesPost) | **POST** /policies | +*PoliciesApi* | [**putPoliciesPut**](docs/PoliciesApi.md#putPoliciesPut) | **PUT** /policies/{id} | +*WelcomeApi* | [**getWelcome**](docs/WelcomeApi.md#getWelcome) | **GET** / | ## Documentation for Models - - [ClientAppSchema](docs/ClientAppSchema.md) + - [EventSchema](docs/EventSchema.md) + - [PaginationSchema](docs/PaginationSchema.md) + - [PolicyChannelSchema](docs/PolicyChannelSchema.md) + - [PolicySchema](docs/PolicySchema.md) ## Documentation for Authorization -Endpoints do not require authorization. + +Authentication schemes defined for the API: + +### auth_token + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header ## Recommendation diff --git a/api/openapi.yaml b/api/openapi.yaml index 4965d7e..33c3c09 100755 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -4,7 +4,177 @@ info: version: 1.0.0 servers: - url: / +security: +- auth_token: [] paths: + /: + get: + operationId: get_welcome + responses: + "200": + content: {} + description: A successful response + tags: + - welcome + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-accepts: application/json + /channels: + get: + operationId: get_policy_channels_get_all + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginationSchema' + description: A successful response + tags: + - channels + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-accepts: application/json + post: + operationId: post_policy_channels_post + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + description: A successful response + tags: + - channels + x-codegen-request-body-name: requestBody + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-content-type: '*/*' + x-accepts: application/json + /channels/test: + post: + operationId: post_policy_channels_test + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + description: A successful response + tags: + - channels + x-codegen-request-body-name: requestBody + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-content-type: '*/*' + x-accepts: application/json + /channels/{id}: + delete: + operationId: delete_policy_channels_delete + parameters: + - explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + description: A successful response + tags: + - channels + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-accepts: application/json + get: + operationId: get_policy_channels_get + parameters: + - explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + description: A successful response + tags: + - channels + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-accepts: application/json + put: + operationId: put_policy_channels_put + parameters: + - explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + description: A successful response + tags: + - channels + x-codegen-request-body-name: requestBody + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-content-type: '*/*' + x-accepts: application/json /docs/swagger.json: get: operationId: get_swagger_json @@ -12,24 +182,117 @@ paths: "200": content: {} description: A successful response + tags: + - docs x-google-backend: address: alertmanager - protocol: h2 + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 x-accepts: application/json - /docs: + /docs/swagger.yml: get: - operationId: get_docs + operationId: get_swagger_yml responses: "200": content: {} description: A successful response + tags: + - docs + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-accepts: application/json + /events: + get: + operationId: get_events_get_all + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PaginationSchema' + description: A successful response + tags: + - events + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-accepts: application/json + post: + operationId: post_events_post + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/EventSchema' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventSchema' + description: A successful response + tags: + - events + x-codegen-request-body-name: requestBody + x-google-backend: + address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS + protocol: h2 + x-content-type: '*/*' + x-accepts: application/json + /events/parameters: + get: + operationId: get_events_parameters_get + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/EventSchema' + type: array + description: A successful response + tags: + - events x-google-backend: address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS protocol: h2 + x-accepts: application/json + /events/{id}: + get: + operationId: get_events_get + parameters: + - explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/EventSchema' + description: A successful response + tags: + - events + x-google-backend: + address: alertmanager + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 x-accepts: application/json /health_check: get: @@ -38,157 +301,416 @@ paths: "200": content: {} description: A successful response + tags: + - health_check x-google-backend: address: alertmanager - protocol: h2 + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 x-accepts: application/json - /client_apps: + /notifications: get: - operationId: get_client_app_get_all + operationId: get_notification_log_get_all responses: "200": content: application/json: schema: - items: - $ref: '#/components/schemas/ClientAppSchema' - type: array + $ref: '#/components/schemas/PaginationSchema' description: A successful response + tags: + - notifications x-google-backend: address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS protocol: h2 + x-accepts: application/json + /notifications/{id}: + get: + operationId: get_notification_log_get + parameters: + - explode: false + in: path + name: id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyChannelSchema' + description: A successful response + tags: + - notifications + x-google-backend: + address: alertmanager + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 x-accepts: application/json - put: - operationId: put_client_app_put + /policies: + get: + operationId: get_policies_get_all responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ClientAppSchema' + $ref: '#/components/schemas/PaginationSchema' description: A successful response + tags: + - policies x-google-backend: address: alertmanager + deadline: 45 + path_translation: APPEND_PATH_TO_ADDRESS protocol: h2 + x-accepts: application/json + post: + operationId: post_policies_post + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/PolicySchema' + required: false + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PolicySchema' + description: A successful response + tags: + - policies + x-codegen-request-body-name: requestBody + x-google-backend: + address: alertmanager + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 + x-content-type: '*/*' x-accepts: application/json - /client_apps/{id}: + /policies/{id}: delete: - operationId: delete_client_app_get_delete + operationId: delete_policies_delete parameters: - - in: path + - explode: false + in: path name: id required: true schema: type: string + style: simple responses: "200": content: application/json: schema: - type: string + $ref: '#/components/schemas/PolicySchema' description: A successful response + tags: + - policies x-google-backend: address: alertmanager - protocol: h2 + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 x-accepts: application/json get: - operationId: get_client_app_get + operationId: get_policies_get parameters: - - in: path + - explode: false + in: path name: id required: true schema: type: string + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ClientAppSchema' + $ref: '#/components/schemas/PolicySchema' description: A successful response + tags: + - policies x-google-backend: address: alertmanager - protocol: h2 + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s + protocol: h2 x-accepts: application/json - post: - operationId: post_client_app_post + put: + operationId: put_policies_put parameters: - - in: path + - explode: false + in: path name: id required: true schema: type: string + style: simple requestBody: content: '*/*': schema: - $ref: '#/components/schemas/ClientAppSchema' + $ref: '#/components/schemas/PolicySchema' required: false responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ClientAppSchema' + $ref: '#/components/schemas/PolicySchema' description: A successful response + tags: + - policies + x-codegen-request-body-name: requestBody x-google-backend: address: alertmanager - protocol: h2 + deadline: 45 path_translation: APPEND_PATH_TO_ADDRESS - deadline: 30s - x-codegen-request-body-name: requestBody + protocol: h2 x-content-type: '*/*' x-accepts: application/json components: schemas: - ClientAppSchema: + EventSchema: example: - deleted: true + schema_version: schema_version + severity: severity + event_type: event_type + data: "{}" updated_at: 2000-01-23T04:56:07.000+00:00 - billing_id: billing_id - contract: contract - name: name + client_uuid: client_uuid created_at: 2000-01-23T04:56:07.000+00:00 + client_source: client_source id: id - url: url labels: "{}" - token: token + status: status properties: + client_source: + description: Event souce + type: string + client_uuid: + description: Client uuid. This is the id defined by client app + type: string + created_at: + format: date-time + type: string + data: + description: Event data + type: object + event_type: + description: Event type + type: string + id: + description: Id + type: string + labels: + description: Event labels + type: object + schema_version: + description: Event schema version. Can be used by client app to know how + to parse the event + type: string + severity: + description: Event severity + type: string + status: + description: "Event status, Received, Stored" + type: string updated_at: format: date-time type: string - name: + required: + - client_source + - client_uuid + - data + - event_type + - id + - labels + - schema_version + - severity + - status + type: object + PaginationSchema: + example: + pageSize: 6 + page: 0 + totalRows: 1 + rows: + - "{}" + - "{}" + properties: + page: + title: Page + type: integer + pageSize: + title: Pagesize + type: integer + rows: + items: + properties: {} + type: object + title: Rows + type: array + totalRows: + title: Totalrows + type: integer + required: + - page + - pageSize + - rows + - totalRows + title: PaginationSchema + type: object + PolicyChannelSchema: + example: + deleted: true + updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + client_uuid: client_uuid + created_at: 2000-01-23T04:56:07.000+00:00 + id: id + last_notification: 2000-01-23T04:56:07.000+00:00 + type: type + config: "{}" + enabled: true + properties: + client_uuid: + description: Client uuid. This is the id defined by client app + type: string + config: + description: Policy Channel config + type: object + created_at: + format: date-time type: string deleted: + description: Policy Channel deleted flag + type: boolean + enabled: + description: Policy Channel enabled flag type: boolean - contract: + id: + description: Id type: string - labels: + last_notification: + format: date-time nullable: true + type: string + name: + description: Policy Channel name + type: string + type: + description: Policy Channel type + type: string + updated_at: + format: date-time + type: string + required: + - client_uuid + - config + - deleted + - enabled + - id + - name + - type + type: object + PolicySchema: + example: + severity: severity + frequency_minutes: 0 + frequency_occurrences: 6 + client_uuid: client_uuid + created_at: 2000-01-23T04:56:07.000+00:00 + filters: "{}" + type: type + enabled: true + frequency: true + labels: "{}" + deleted: true + channels: "{}" + updated_at: 2000-01-23T04:56:07.000+00:00 + name: name + client_source: client_source + id: id + properties: + channels: + description: List of channel notification type: object - id: + client_source: + description: Policy Client source type: string - token: + client_uuid: + description: Policy Client UUID type: string created_at: format: date-time type: string - url: + deleted: + description: Policy deleted + type: boolean + enabled: + description: Policy enabled + type: boolean + filters: + description: Policy filters + type: object + frequency: + description: Enable alert frequency for the policy + type: boolean + frequency_minutes: + description: Quantity of alert interval time + type: integer + frequency_occurrences: + description: Quantity of alert occurrencies + type: integer + id: + description: Id + type: string + labels: + description: Policy labels + type: object + name: + description: Policy name type: string - billing_id: + severity: + description: Policy severity + type: string + type: + description: Policy type + type: string + updated_at: + format: date-time type: string required: + - channels + - client_source + - client_uuid + - deleted + - enabled + - filters + - frequency + - frequency_minutes + - frequency_occurrences - id + - labels + - name + - severity + - type type: object -x-original-swagger-version: "2.0" + securitySchemes: + auth_token: + in: header + name: Authorization + type: apiKey diff --git a/docs/ChannelsApi.md b/docs/ChannelsApi.md new file mode 100644 index 0000000..92afa70 --- /dev/null +++ b/docs/ChannelsApi.md @@ -0,0 +1,414 @@ +# ChannelsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deletePolicyChannelsDelete**](ChannelsApi.md#deletePolicyChannelsDelete) | **DELETE** /channels/{id} | | +| [**getPolicyChannelsGet**](ChannelsApi.md#getPolicyChannelsGet) | **GET** /channels/{id} | | +| [**getPolicyChannelsGetAll**](ChannelsApi.md#getPolicyChannelsGetAll) | **GET** /channels | | +| [**postPolicyChannelsPost**](ChannelsApi.md#postPolicyChannelsPost) | **POST** /channels | | +| [**postPolicyChannelsTest**](ChannelsApi.md#postPolicyChannelsTest) | **POST** /channels/test | | +| [**putPolicyChannelsPut**](ChannelsApi.md#putPolicyChannelsPut) | **PUT** /channels/{id} | | + + + +# **deletePolicyChannelsDelete** +> PolicyChannelSchema deletePolicyChannelsDelete(id) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ChannelsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); + String id = "id_example"; // String | + try { + PolicyChannelSchema result = apiInstance.deletePolicyChannelsDelete(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChannelsApi#deletePolicyChannelsDelete"); + 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 + +[**PolicyChannelSchema**](PolicyChannelSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getPolicyChannelsGet** +> PolicyChannelSchema getPolicyChannelsGet(id) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ChannelsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); + String id = "id_example"; // String | + try { + PolicyChannelSchema result = apiInstance.getPolicyChannelsGet(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChannelsApi#getPolicyChannelsGet"); + 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 + +[**PolicyChannelSchema**](PolicyChannelSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getPolicyChannelsGetAll** +> PaginationSchema getPolicyChannelsGetAll() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ChannelsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); + try { + PaginationSchema result = apiInstance.getPolicyChannelsGetAll(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChannelsApi#getPolicyChannelsGetAll"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PaginationSchema**](PaginationSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **postPolicyChannelsPost** +> PolicyChannelSchema postPolicyChannelsPost(requestBody) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ChannelsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); + PolicyChannelSchema requestBody = new PolicyChannelSchema(); // PolicyChannelSchema | + try { + PolicyChannelSchema result = apiInstance.postPolicyChannelsPost(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChannelsApi#postPolicyChannelsPost"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**PolicyChannelSchema**](PolicyChannelSchema.md)| | [optional] | + +### Return type + +[**PolicyChannelSchema**](PolicyChannelSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **postPolicyChannelsTest** +> PolicyChannelSchema postPolicyChannelsTest(requestBody) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ChannelsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); + PolicyChannelSchema requestBody = new PolicyChannelSchema(); // PolicyChannelSchema | + try { + PolicyChannelSchema result = apiInstance.postPolicyChannelsTest(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChannelsApi#postPolicyChannelsTest"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**PolicyChannelSchema**](PolicyChannelSchema.md)| | [optional] | + +### Return type + +[**PolicyChannelSchema**](PolicyChannelSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **putPolicyChannelsPut** +> PolicyChannelSchema putPolicyChannelsPut(id, requestBody) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.ChannelsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + ChannelsApi apiInstance = new ChannelsApi(defaultClient); + String id = "id_example"; // String | + PolicyChannelSchema requestBody = new PolicyChannelSchema(); // PolicyChannelSchema | + try { + PolicyChannelSchema result = apiInstance.putPolicyChannelsPut(id, requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ChannelsApi#putPolicyChannelsPut"); + 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**| | | +| **requestBody** | [**PolicyChannelSchema**](PolicyChannelSchema.md)| | [optional] | + +### Return type + +[**PolicyChannelSchema**](PolicyChannelSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/docs/DocsApi.md b/docs/DocsApi.md new file mode 100644 index 0000000..1936813 --- /dev/null +++ b/docs/DocsApi.md @@ -0,0 +1,134 @@ +# DocsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getSwaggerJson**](DocsApi.md#getSwaggerJson) | **GET** /docs/swagger.json | | +| [**getSwaggerYml**](DocsApi.md#getSwaggerYml) | **GET** /docs/swagger.yml | | + + + +# **getSwaggerJson** +> getSwaggerJson() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DocsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + DocsApi apiInstance = new DocsApi(defaultClient); + try { + apiInstance.getSwaggerJson(); + } catch (ApiException e) { + System.err.println("Exception when calling DocsApi#getSwaggerJson"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getSwaggerYml** +> getSwaggerYml() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DocsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + DocsApi apiInstance = new DocsApi(defaultClient); + try { + apiInstance.getSwaggerYml(); + } catch (ApiException e) { + System.err.println("Exception when calling DocsApi#getSwaggerYml"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/docs/EventSchema.md b/docs/EventSchema.md new file mode 100644 index 0000000..7460fb5 --- /dev/null +++ b/docs/EventSchema.md @@ -0,0 +1,23 @@ + + +# EventSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**clientSource** | **String** | Event souce | | +|**clientUuid** | **String** | Client uuid. This is the id defined by client app | | +|**createdAt** | **OffsetDateTime** | | [optional] | +|**data** | **Object** | Event data | | +|**eventType** | **String** | Event type | | +|**id** | **String** | Id | | +|**labels** | **Object** | Event labels | | +|**schemaVersion** | **String** | Event schema version. Can be used by client app to know how to parse the event | | +|**severity** | **String** | Event severity | | +|**status** | **String** | Event status, Received, Stored | | +|**updatedAt** | **OffsetDateTime** | | [optional] | + + + diff --git a/docs/EventsApi.md b/docs/EventsApi.md new file mode 100644 index 0000000..044aebf --- /dev/null +++ b/docs/EventsApi.md @@ -0,0 +1,272 @@ +# EventsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getEventsGet**](EventsApi.md#getEventsGet) | **GET** /events/{id} | | +| [**getEventsGetAll**](EventsApi.md#getEventsGetAll) | **GET** /events | | +| [**getEventsParametersGet**](EventsApi.md#getEventsParametersGet) | **GET** /events/parameters | | +| [**postEventsPost**](EventsApi.md#postEventsPost) | **POST** /events | | + + + +# **getEventsGet** +> EventSchema getEventsGet(id) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.EventsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + EventsApi apiInstance = new EventsApi(defaultClient); + String id = "id_example"; // String | + try { + EventSchema result = apiInstance.getEventsGet(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#getEventsGet"); + 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 + +[**EventSchema**](EventSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getEventsGetAll** +> PaginationSchema getEventsGetAll() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.EventsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + EventsApi apiInstance = new EventsApi(defaultClient); + try { + PaginationSchema result = apiInstance.getEventsGetAll(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#getEventsGetAll"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PaginationSchema**](PaginationSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getEventsParametersGet** +> List<EventSchema> getEventsParametersGet() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.EventsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + EventsApi apiInstance = new EventsApi(defaultClient); + try { + List result = apiInstance.getEventsParametersGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#getEventsParametersGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<EventSchema>**](EventSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **postEventsPost** +> EventSchema postEventsPost(requestBody) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.EventsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + EventsApi apiInstance = new EventsApi(defaultClient); + EventSchema requestBody = new EventSchema(); // EventSchema | + try { + EventSchema result = apiInstance.postEventsPost(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling EventsApi#postEventsPost"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**EventSchema**](EventSchema.md)| | [optional] | + +### Return type + +[**EventSchema**](EventSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/docs/HealthCheckApi.md b/docs/HealthCheckApi.md new file mode 100644 index 0000000..7dd0544 --- /dev/null +++ b/docs/HealthCheckApi.md @@ -0,0 +1,71 @@ +# HealthCheckApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getHealthCheck**](HealthCheckApi.md#getHealthCheck) | **GET** /health_check | | + + + +# **getHealthCheck** +> getHealthCheck() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.HealthCheckApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + HealthCheckApi apiInstance = new HealthCheckApi(defaultClient); + try { + apiInstance.getHealthCheck(); + } catch (ApiException e) { + System.err.println("Exception when calling HealthCheckApi#getHealthCheck"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/docs/NotificationsApi.md b/docs/NotificationsApi.md new file mode 100644 index 0000000..517f18a --- /dev/null +++ b/docs/NotificationsApi.md @@ -0,0 +1,140 @@ +# NotificationsApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getNotificationLogGet**](NotificationsApi.md#getNotificationLogGet) | **GET** /notifications/{id} | | +| [**getNotificationLogGetAll**](NotificationsApi.md#getNotificationLogGetAll) | **GET** /notifications | | + + + +# **getNotificationLogGet** +> PolicyChannelSchema getNotificationLogGet(id) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NotificationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + NotificationsApi apiInstance = new NotificationsApi(defaultClient); + String id = "id_example"; // String | + try { + PolicyChannelSchema result = apiInstance.getNotificationLogGet(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotificationsApi#getNotificationLogGet"); + 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 + +[**PolicyChannelSchema**](PolicyChannelSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getNotificationLogGetAll** +> PaginationSchema getNotificationLogGetAll() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.NotificationsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + NotificationsApi apiInstance = new NotificationsApi(defaultClient); + try { + PaginationSchema result = apiInstance.getNotificationLogGetAll(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling NotificationsApi#getNotificationLogGetAll"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PaginationSchema**](PaginationSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/docs/PaginationSchema.md b/docs/PaginationSchema.md new file mode 100644 index 0000000..985e6e1 --- /dev/null +++ b/docs/PaginationSchema.md @@ -0,0 +1,16 @@ + + +# PaginationSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**page** | **Integer** | | | +|**pageSize** | **Integer** | | | +|**rows** | **List<Object>** | | | +|**totalRows** | **Integer** | | | + + + diff --git a/docs/PoliciesApi.md b/docs/PoliciesApi.md new file mode 100644 index 0000000..532b8a0 --- /dev/null +++ b/docs/PoliciesApi.md @@ -0,0 +1,346 @@ +# PoliciesApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deletePoliciesDelete**](PoliciesApi.md#deletePoliciesDelete) | **DELETE** /policies/{id} | | +| [**getPoliciesGet**](PoliciesApi.md#getPoliciesGet) | **GET** /policies/{id} | | +| [**getPoliciesGetAll**](PoliciesApi.md#getPoliciesGetAll) | **GET** /policies | | +| [**postPoliciesPost**](PoliciesApi.md#postPoliciesPost) | **POST** /policies | | +| [**putPoliciesPut**](PoliciesApi.md#putPoliciesPut) | **PUT** /policies/{id} | | + + + +# **deletePoliciesDelete** +> PolicySchema deletePoliciesDelete(id) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PoliciesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + PoliciesApi apiInstance = new PoliciesApi(defaultClient); + String id = "id_example"; // String | + try { + PolicySchema result = apiInstance.deletePoliciesDelete(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PoliciesApi#deletePoliciesDelete"); + 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 + +[**PolicySchema**](PolicySchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getPoliciesGet** +> PolicySchema getPoliciesGet(id) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PoliciesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + PoliciesApi apiInstance = new PoliciesApi(defaultClient); + String id = "id_example"; // String | + try { + PolicySchema result = apiInstance.getPoliciesGet(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PoliciesApi#getPoliciesGet"); + 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 + +[**PolicySchema**](PolicySchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **getPoliciesGetAll** +> PaginationSchema getPoliciesGetAll() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PoliciesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + PoliciesApi apiInstance = new PoliciesApi(defaultClient); + try { + PaginationSchema result = apiInstance.getPoliciesGetAll(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PoliciesApi#getPoliciesGetAll"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**PaginationSchema**](PaginationSchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **postPoliciesPost** +> PolicySchema postPoliciesPost(requestBody) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PoliciesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + PoliciesApi apiInstance = new PoliciesApi(defaultClient); + PolicySchema requestBody = new PolicySchema(); // PolicySchema | + try { + PolicySchema result = apiInstance.postPoliciesPost(requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PoliciesApi#postPoliciesPost"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**PolicySchema**](PolicySchema.md)| | [optional] | + +### Return type + +[**PolicySchema**](PolicySchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + + +# **putPoliciesPut** +> PolicySchema putPoliciesPut(id, requestBody) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PoliciesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + PoliciesApi apiInstance = new PoliciesApi(defaultClient); + String id = "id_example"; // String | + PolicySchema requestBody = new PolicySchema(); // PolicySchema | + try { + PolicySchema result = apiInstance.putPoliciesPut(id, requestBody); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PoliciesApi#putPoliciesPut"); + 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**| | | +| **requestBody** | [**PolicySchema**](PolicySchema.md)| | [optional] | + +### Return type + +[**PolicySchema**](PolicySchema.md) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/docs/PolicyChannelSchema.md b/docs/PolicyChannelSchema.md new file mode 100644 index 0000000..98e7f3f --- /dev/null +++ b/docs/PolicyChannelSchema.md @@ -0,0 +1,22 @@ + + +# PolicyChannelSchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**clientUuid** | **String** | Client uuid. This is the id defined by client app | | +|**config** | **Object** | Policy Channel config | | +|**createdAt** | **OffsetDateTime** | | [optional] | +|**deleted** | **Boolean** | Policy Channel deleted flag | | +|**enabled** | **Boolean** | Policy Channel enabled flag | | +|**id** | **String** | Id | | +|**lastNotification** | **OffsetDateTime** | | [optional] | +|**name** | **String** | Policy Channel name | | +|**type** | **String** | Policy Channel type | | +|**updatedAt** | **OffsetDateTime** | | [optional] | + + + diff --git a/docs/PolicySchema.md b/docs/PolicySchema.md new file mode 100644 index 0000000..d97d507 --- /dev/null +++ b/docs/PolicySchema.md @@ -0,0 +1,28 @@ + + +# PolicySchema + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**channels** | **Object** | List of channel notification | | +|**clientSource** | **String** | Policy Client source | | +|**clientUuid** | **String** | Policy Client UUID | | +|**createdAt** | **OffsetDateTime** | | [optional] | +|**deleted** | **Boolean** | Policy deleted | | +|**enabled** | **Boolean** | Policy enabled | | +|**filters** | **Object** | Policy filters | | +|**frequency** | **Boolean** | Enable alert frequency for the policy | | +|**frequencyMinutes** | **Integer** | Quantity of alert interval time | | +|**frequencyOccurrences** | **Integer** | Quantity of alert occurrencies | | +|**id** | **String** | Id | | +|**labels** | **Object** | Policy labels | | +|**name** | **String** | Policy name | | +|**severity** | **String** | Policy severity | | +|**type** | **String** | Policy type | | +|**updatedAt** | **OffsetDateTime** | | [optional] | + + + diff --git a/docs/WelcomeApi.md b/docs/WelcomeApi.md new file mode 100644 index 0000000..4b2b07e --- /dev/null +++ b/docs/WelcomeApi.md @@ -0,0 +1,71 @@ +# WelcomeApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**getWelcome**](WelcomeApi.md#getWelcome) | **GET** / | | + + + +# **getWelcome** +> getWelcome() + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.WelcomeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: auth_token + ApiKeyAuth auth_token = (ApiKeyAuth) defaultClient.getAuthentication("auth_token"); + auth_token.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //auth_token.setApiKeyPrefix("Token"); + + WelcomeApi apiInstance = new WelcomeApi(defaultClient); + try { + apiInstance.getWelcome(); + } catch (ApiException e) { + System.err.println("Exception when calling WelcomeApi#getWelcome"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[auth_token](../README.md#auth_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A successful response | - | + diff --git a/pom.xml b/pom.xml index 61ba390..5be8e95 100755 --- a/pom.xml +++ b/pom.xml @@ -336,7 +336,6 @@ ${java.version} ${java.version} 1.8.5 - 1.6.6 4.10.0 2.9.1 3.12.0 diff --git a/src/main/java/org/openapitools/client/ApiClient.java b/src/main/java/org/openapitools/client/ApiClient.java index 4b9cd1e..cee0702 100755 --- a/src/main/java/org/openapitools/client/ApiClient.java +++ b/src/main/java/org/openapitools/client/ApiClient.java @@ -99,6 +99,7 @@ public ApiClient() { initHttpClient(); // Setup authentications (key: authentication name, value: authentication). + authentications.put("auth_token", new ApiKeyAuth("header", "Authorization")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -114,6 +115,7 @@ public ApiClient(OkHttpClient client) { httpClient = client; // Setup authentications (key: authentication name, value: authentication). + authentications.put("auth_token", new ApiKeyAuth("header", "Authorization")); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -1166,12 +1168,15 @@ public Request buildRequest(String baseUrl, String path, String method, ListApiException class.

*/ @SuppressWarnings("serial") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - + /** *

Constructor for ApiException.

*/ diff --git a/src/main/java/org/openapitools/client/Configuration.java b/src/main/java/org/openapitools/client/Configuration.java index bd22e3d..8afd384 100755 --- a/src/main/java/org/openapitools/client/Configuration.java +++ b/src/main/java/org/openapitools/client/Configuration.java @@ -13,7 +13,7 @@ package org.openapitools.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/src/main/java/org/openapitools/client/JSON.java b/src/main/java/org/openapitools/client/JSON.java index c00ef98..5789028 100755 --- a/src/main/java/org/openapitools/client/JSON.java +++ b/src/main/java/org/openapitools/client/JSON.java @@ -93,7 +93,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ClientAppSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.EventSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PaginationSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PolicyChannelSchema.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.PolicySchema.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/org/openapitools/client/Pair.java b/src/main/java/org/openapitools/client/Pair.java index 2f053eb..84fdec7 100755 --- a/src/main/java/org/openapitools/client/Pair.java +++ b/src/main/java/org/openapitools/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.client; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public class Pair { private String name = ""; private String value = ""; diff --git a/src/main/java/org/openapitools/client/StringUtil.java b/src/main/java/org/openapitools/client/StringUtil.java index 9d4122d..6a3da0b 100755 --- a/src/main/java/org/openapitools/client/StringUtil.java +++ b/src/main/java/org/openapitools/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/src/main/java/org/openapitools/client/api/ChannelsApi.java b/src/main/java/org/openapitools/client/api/ChannelsApi.java new file mode 100644 index 0000000..844a130 --- /dev/null +++ b/src/main/java/org/openapitools/client/api/ChannelsApi.java @@ -0,0 +1,796 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.PaginationSchema; +import org.openapitools.client.model.PolicyChannelSchema; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ChannelsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ChannelsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ChannelsApi(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 deletePolicyChannelsDelete + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call deletePolicyChannelsDeleteCall(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 = "/channels/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePolicyChannelsDeleteValidateBeforeCall(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 deletePolicyChannelsDelete(Async)"); + } + + return deletePolicyChannelsDeleteCall(id, _callback); + + } + + /** + * + * + * @param id (required) + * @return PolicyChannelSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicyChannelSchema deletePolicyChannelsDelete(String id) throws ApiException { + ApiResponse localVarResp = deletePolicyChannelsDeleteWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @return ApiResponse<PolicyChannelSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse deletePolicyChannelsDeleteWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = deletePolicyChannelsDeleteValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call deletePolicyChannelsDeleteAsync(String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePolicyChannelsDeleteValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPolicyChannelsGet + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPolicyChannelsGetCall(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 = "/channels/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPolicyChannelsGetValidateBeforeCall(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 getPolicyChannelsGet(Async)"); + } + + return getPolicyChannelsGetCall(id, _callback); + + } + + /** + * + * + * @param id (required) + * @return PolicyChannelSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicyChannelSchema getPolicyChannelsGet(String id) throws ApiException { + ApiResponse localVarResp = getPolicyChannelsGetWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @return ApiResponse<PolicyChannelSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getPolicyChannelsGetWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = getPolicyChannelsGetValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPolicyChannelsGetAsync(String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPolicyChannelsGetValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPolicyChannelsGetAll + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPolicyChannelsGetAllCall(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 = "/channels"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPolicyChannelsGetAllValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPolicyChannelsGetAllCall(_callback); + + } + + /** + * + * + * @return PaginationSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PaginationSchema getPolicyChannelsGetAll() throws ApiException { + ApiResponse localVarResp = getPolicyChannelsGetAllWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<PaginationSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getPolicyChannelsGetAllWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPolicyChannelsGetAllValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPolicyChannelsGetAllAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPolicyChannelsGetAllValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postPolicyChannelsPost + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postPolicyChannelsPostCall(PolicyChannelSchema requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/channels"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postPolicyChannelsPostValidateBeforeCall(PolicyChannelSchema requestBody, final ApiCallback _callback) throws ApiException { + return postPolicyChannelsPostCall(requestBody, _callback); + + } + + /** + * + * + * @param requestBody (optional) + * @return PolicyChannelSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicyChannelSchema postPolicyChannelsPost(PolicyChannelSchema requestBody) throws ApiException { + ApiResponse localVarResp = postPolicyChannelsPostWithHttpInfo(requestBody); + return localVarResp.getData(); + } + + /** + * + * + * @param requestBody (optional) + * @return ApiResponse<PolicyChannelSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse postPolicyChannelsPostWithHttpInfo(PolicyChannelSchema requestBody) throws ApiException { + okhttp3.Call localVarCall = postPolicyChannelsPostValidateBeforeCall(requestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postPolicyChannelsPostAsync(PolicyChannelSchema requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postPolicyChannelsPostValidateBeforeCall(requestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postPolicyChannelsTest + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postPolicyChannelsTestCall(PolicyChannelSchema requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/channels/test"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postPolicyChannelsTestValidateBeforeCall(PolicyChannelSchema requestBody, final ApiCallback _callback) throws ApiException { + return postPolicyChannelsTestCall(requestBody, _callback); + + } + + /** + * + * + * @param requestBody (optional) + * @return PolicyChannelSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicyChannelSchema postPolicyChannelsTest(PolicyChannelSchema requestBody) throws ApiException { + ApiResponse localVarResp = postPolicyChannelsTestWithHttpInfo(requestBody); + return localVarResp.getData(); + } + + /** + * + * + * @param requestBody (optional) + * @return ApiResponse<PolicyChannelSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse postPolicyChannelsTestWithHttpInfo(PolicyChannelSchema requestBody) throws ApiException { + okhttp3.Call localVarCall = postPolicyChannelsTestValidateBeforeCall(requestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postPolicyChannelsTestAsync(PolicyChannelSchema requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postPolicyChannelsTestValidateBeforeCall(requestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for putPolicyChannelsPut + * @param id (required) + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call putPolicyChannelsPutCall(String id, PolicyChannelSchema requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/channels/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call putPolicyChannelsPutValidateBeforeCall(String id, PolicyChannelSchema requestBody, 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 putPolicyChannelsPut(Async)"); + } + + return putPolicyChannelsPutCall(id, requestBody, _callback); + + } + + /** + * + * + * @param id (required) + * @param requestBody (optional) + * @return PolicyChannelSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicyChannelSchema putPolicyChannelsPut(String id, PolicyChannelSchema requestBody) throws ApiException { + ApiResponse localVarResp = putPolicyChannelsPutWithHttpInfo(id, requestBody); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @param requestBody (optional) + * @return ApiResponse<PolicyChannelSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse putPolicyChannelsPutWithHttpInfo(String id, PolicyChannelSchema requestBody) throws ApiException { + okhttp3.Call localVarCall = putPolicyChannelsPutValidateBeforeCall(id, requestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param id (required) + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call putPolicyChannelsPutAsync(String id, PolicyChannelSchema requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = putPolicyChannelsPutValidateBeforeCall(id, requestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/api/DocsApi.java b/src/main/java/org/openapitools/client/api/DocsApi.java new file mode 100644 index 0000000..62bff9f --- /dev/null +++ b/src/main/java/org/openapitools/client/api/DocsApi.java @@ -0,0 +1,290 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DocsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DocsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DocsApi(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 getSwaggerJson + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getSwaggerJsonCall(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 = "/docs/swagger.json"; + + 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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSwaggerJsonValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSwaggerJsonCall(_callback); + + } + + /** + * + * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public void getSwaggerJson() throws ApiException { + getSwaggerJsonWithHttpInfo(); + } + + /** + * + * + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getSwaggerJsonWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSwaggerJsonValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getSwaggerJsonAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSwaggerJsonValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getSwaggerYml + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getSwaggerYmlCall(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 = "/docs/swagger.yml"; + + 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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSwaggerYmlValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSwaggerYmlCall(_callback); + + } + + /** + * + * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public void getSwaggerYml() throws ApiException { + getSwaggerYmlWithHttpInfo(); + } + + /** + * + * + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getSwaggerYmlWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSwaggerYmlValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getSwaggerYmlAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getSwaggerYmlValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/api/EventsApi.java b/src/main/java/org/openapitools/client/api/EventsApi.java new file mode 100644 index 0000000..a41b5c2 --- /dev/null +++ b/src/main/java/org/openapitools/client/api/EventsApi.java @@ -0,0 +1,542 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.EventSchema; +import org.openapitools.client.model.PaginationSchema; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EventsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EventsApi() { + this(Configuration.getDefaultApiClient()); + } + + public EventsApi(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 getEventsGet + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getEventsGetCall(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 = "/events/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEventsGetValidateBeforeCall(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 getEventsGet(Async)"); + } + + return getEventsGetCall(id, _callback); + + } + + /** + * + * + * @param id (required) + * @return EventSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public EventSchema getEventsGet(String id) throws ApiException { + ApiResponse localVarResp = getEventsGetWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @return ApiResponse<EventSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getEventsGetWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = getEventsGetValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getEventsGetAsync(String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEventsGetValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getEventsGetAll + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getEventsGetAllCall(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 = "/events"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEventsGetAllValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getEventsGetAllCall(_callback); + + } + + /** + * + * + * @return PaginationSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PaginationSchema getEventsGetAll() throws ApiException { + ApiResponse localVarResp = getEventsGetAllWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<PaginationSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getEventsGetAllWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getEventsGetAllValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getEventsGetAllAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getEventsGetAllValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getEventsParametersGet + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getEventsParametersGetCall(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 = "/events/parameters"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEventsParametersGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getEventsParametersGetCall(_callback); + + } + + /** + * + * + * @return List<EventSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public List getEventsParametersGet() throws ApiException { + ApiResponse> localVarResp = getEventsParametersGetWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<List<EventSchema>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse> getEventsParametersGetWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getEventsParametersGetValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getEventsParametersGetAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getEventsParametersGetValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postEventsPost + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postEventsPostCall(EventSchema requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/events"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postEventsPostValidateBeforeCall(EventSchema requestBody, final ApiCallback _callback) throws ApiException { + return postEventsPostCall(requestBody, _callback); + + } + + /** + * + * + * @param requestBody (optional) + * @return EventSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public EventSchema postEventsPost(EventSchema requestBody) throws ApiException { + ApiResponse localVarResp = postEventsPostWithHttpInfo(requestBody); + return localVarResp.getData(); + } + + /** + * + * + * @param requestBody (optional) + * @return ApiResponse<EventSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse postEventsPostWithHttpInfo(EventSchema requestBody) throws ApiException { + okhttp3.Call localVarCall = postEventsPostValidateBeforeCall(requestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postEventsPostAsync(EventSchema requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postEventsPostValidateBeforeCall(requestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/api/HealthCheckApi.java b/src/main/java/org/openapitools/client/api/HealthCheckApi.java new file mode 100644 index 0000000..0e2a05f --- /dev/null +++ b/src/main/java/org/openapitools/client/api/HealthCheckApi.java @@ -0,0 +1,182 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HealthCheckApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public HealthCheckApi() { + this(Configuration.getDefaultApiClient()); + } + + public HealthCheckApi(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 getHealthCheck + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getHealthCheckCall(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 = "/health_check"; + + 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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getHealthCheckValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getHealthCheckCall(_callback); + + } + + /** + * + * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public void getHealthCheck() throws ApiException { + getHealthCheckWithHttpInfo(); + } + + /** + * + * + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getHealthCheckWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getHealthCheckValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getHealthCheckAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getHealthCheckValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/api/NotificationsApi.java b/src/main/java/org/openapitools/client/api/NotificationsApi.java new file mode 100644 index 0000000..6d24d5d --- /dev/null +++ b/src/main/java/org/openapitools/client/api/NotificationsApi.java @@ -0,0 +1,312 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.PaginationSchema; +import org.openapitools.client.model.PolicyChannelSchema; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class NotificationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public NotificationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public NotificationsApi(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 getNotificationLogGet + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getNotificationLogGetCall(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 = "/notifications/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNotificationLogGetValidateBeforeCall(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 getNotificationLogGet(Async)"); + } + + return getNotificationLogGetCall(id, _callback); + + } + + /** + * + * + * @param id (required) + * @return PolicyChannelSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicyChannelSchema getNotificationLogGet(String id) throws ApiException { + ApiResponse localVarResp = getNotificationLogGetWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @return ApiResponse<PolicyChannelSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getNotificationLogGetWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = getNotificationLogGetValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getNotificationLogGetAsync(String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNotificationLogGetValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNotificationLogGetAll + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getNotificationLogGetAllCall(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 = "/notifications"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNotificationLogGetAllValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getNotificationLogGetAllCall(_callback); + + } + + /** + * + * + * @return PaginationSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PaginationSchema getNotificationLogGetAll() throws ApiException { + ApiResponse localVarResp = getNotificationLogGetAllWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<PaginationSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getNotificationLogGetAllWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getNotificationLogGetAllValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getNotificationLogGetAllAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNotificationLogGetAllValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/api/PoliciesApi.java b/src/main/java/org/openapitools/client/api/PoliciesApi.java new file mode 100644 index 0000000..bfd98ad --- /dev/null +++ b/src/main/java/org/openapitools/client/api/PoliciesApi.java @@ -0,0 +1,679 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.PaginationSchema; +import org.openapitools.client.model.PolicySchema; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PoliciesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PoliciesApi() { + this(Configuration.getDefaultApiClient()); + } + + public PoliciesApi(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 deletePoliciesDelete + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call deletePoliciesDeleteCall(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 = "/policies/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePoliciesDeleteValidateBeforeCall(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 deletePoliciesDelete(Async)"); + } + + return deletePoliciesDeleteCall(id, _callback); + + } + + /** + * + * + * @param id (required) + * @return PolicySchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicySchema deletePoliciesDelete(String id) throws ApiException { + ApiResponse localVarResp = deletePoliciesDeleteWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @return ApiResponse<PolicySchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse deletePoliciesDeleteWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = deletePoliciesDeleteValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call deletePoliciesDeleteAsync(String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePoliciesDeleteValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPoliciesGet + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPoliciesGetCall(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 = "/policies/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPoliciesGetValidateBeforeCall(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 getPoliciesGet(Async)"); + } + + return getPoliciesGetCall(id, _callback); + + } + + /** + * + * + * @param id (required) + * @return PolicySchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicySchema getPoliciesGet(String id) throws ApiException { + ApiResponse localVarResp = getPoliciesGetWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @return ApiResponse<PolicySchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getPoliciesGetWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = getPoliciesGetValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPoliciesGetAsync(String id, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPoliciesGetValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPoliciesGetAll + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPoliciesGetAllCall(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 = "/policies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPoliciesGetAllValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPoliciesGetAllCall(_callback); + + } + + /** + * + * + * @return PaginationSchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PaginationSchema getPoliciesGetAll() throws ApiException { + ApiResponse localVarResp = getPoliciesGetAllWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * + * + * @return ApiResponse<PaginationSchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getPoliciesGetAllWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPoliciesGetAllValidateBeforeCall(null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getPoliciesGetAllAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getPoliciesGetAllValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postPoliciesPost + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postPoliciesPostCall(PolicySchema requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/policies"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postPoliciesPostValidateBeforeCall(PolicySchema requestBody, final ApiCallback _callback) throws ApiException { + return postPoliciesPostCall(requestBody, _callback); + + } + + /** + * + * + * @param requestBody (optional) + * @return PolicySchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicySchema postPoliciesPost(PolicySchema requestBody) throws ApiException { + ApiResponse localVarResp = postPoliciesPostWithHttpInfo(requestBody); + return localVarResp.getData(); + } + + /** + * + * + * @param requestBody (optional) + * @return ApiResponse<PolicySchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse postPoliciesPostWithHttpInfo(PolicySchema requestBody) throws ApiException { + okhttp3.Call localVarCall = postPoliciesPostValidateBeforeCall(requestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call postPoliciesPostAsync(PolicySchema requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = postPoliciesPostValidateBeforeCall(requestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for putPoliciesPut + * @param id (required) + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call putPoliciesPutCall(String id, PolicySchema requestBody, 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 = requestBody; + + // create path and map variables + String localVarPath = "/policies/{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/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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call putPoliciesPutValidateBeforeCall(String id, PolicySchema requestBody, 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 putPoliciesPut(Async)"); + } + + return putPoliciesPutCall(id, requestBody, _callback); + + } + + /** + * + * + * @param id (required) + * @param requestBody (optional) + * @return PolicySchema + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public PolicySchema putPoliciesPut(String id, PolicySchema requestBody) throws ApiException { + ApiResponse localVarResp = putPoliciesPutWithHttpInfo(id, requestBody); + return localVarResp.getData(); + } + + /** + * + * + * @param id (required) + * @param requestBody (optional) + * @return ApiResponse<PolicySchema> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse putPoliciesPutWithHttpInfo(String id, PolicySchema requestBody) throws ApiException { + okhttp3.Call localVarCall = putPoliciesPutValidateBeforeCall(id, requestBody, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * (asynchronously) + * + * @param id (required) + * @param requestBody (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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call putPoliciesPutAsync(String id, PolicySchema requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = putPoliciesPutValidateBeforeCall(id, requestBody, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/api/WelcomeApi.java b/src/main/java/org/openapitools/client/api/WelcomeApi.java new file mode 100644 index 0000000..5d32404 --- /dev/null +++ b/src/main/java/org/openapitools/client/api/WelcomeApi.java @@ -0,0 +1,182 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WelcomeApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WelcomeApi() { + this(Configuration.getDefaultApiClient()); + } + + public WelcomeApi(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 getWelcome + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getWelcomeCall(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 = "/"; + + 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[] { "auth_token" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWelcomeValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getWelcomeCall(_callback); + + } + + /** + * + * + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public void getWelcome() throws ApiException { + getWelcomeWithHttpInfo(); + } + + /** + * + * + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public ApiResponse getWelcomeWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getWelcomeValidateBeforeCall(null); + return localVarApiClient.execute(localVarCall); + } + + /** + * (asynchronously) + * + * @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 + + + +
Status Code Description Response Headers
200 A successful response -
+ */ + public okhttp3.Call getWelcomeAsync(final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getWelcomeValidateBeforeCall(_callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 01504ba..5b7ebe2 100755 --- a/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index ff0a467..3099d54 100755 --- a/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 3161b86..1cd7314 100755 --- a/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -17,14 +17,13 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; //import com.fasterxml.jackson.annotation.JsonValue; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-06-02T15:01:33.240562Z[Etc/UTC]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object @@ -46,7 +45,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ - public abstract Map getSchemas(); + public abstract Map> getSchemas(); /** * Get the actual instance diff --git a/src/main/java/org/openapitools/client/model/EventSchema.java b/src/main/java/org/openapitools/client/model/EventSchema.java new file mode 100644 index 0000000..c7f291f --- /dev/null +++ b/src/main/java/org/openapitools/client/model/EventSchema.java @@ -0,0 +1,524 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * EventSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") +public class EventSchema { + public static final String SERIALIZED_NAME_CLIENT_SOURCE = "client_source"; + @SerializedName(SERIALIZED_NAME_CLIENT_SOURCE) + private String clientSource; + + public static final String SERIALIZED_NAME_CLIENT_UUID = "client_uuid"; + @SerializedName(SERIALIZED_NAME_CLIENT_UUID) + private String clientUuid; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private Object data; + + public static final String SERIALIZED_NAME_EVENT_TYPE = "event_type"; + @SerializedName(SERIALIZED_NAME_EVENT_TYPE) + private String eventType; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + @SerializedName(SERIALIZED_NAME_LABELS) + private Object labels; + + public static final String SERIALIZED_NAME_SCHEMA_VERSION = "schema_version"; + @SerializedName(SERIALIZED_NAME_SCHEMA_VERSION) + private String schemaVersion; + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + private String severity; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public EventSchema() { + } + + public EventSchema clientSource(String clientSource) { + + this.clientSource = clientSource; + return this; + } + + /** + * Event souce + * @return clientSource + **/ + @javax.annotation.Nonnull + public String getClientSource() { + return clientSource; + } + + + public void setClientSource(String clientSource) { + this.clientSource = clientSource; + } + + + public EventSchema clientUuid(String clientUuid) { + + this.clientUuid = clientUuid; + return this; + } + + /** + * Client uuid. This is the id defined by client app + * @return clientUuid + **/ + @javax.annotation.Nonnull + public String getClientUuid() { + return clientUuid; + } + + + public void setClientUuid(String clientUuid) { + this.clientUuid = clientUuid; + } + + + public EventSchema createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public EventSchema data(Object data) { + + this.data = data; + return this; + } + + /** + * Event data + * @return data + **/ + @javax.annotation.Nonnull + public Object getData() { + return data; + } + + + public void setData(Object data) { + this.data = data; + } + + + public EventSchema eventType(String eventType) { + + this.eventType = eventType; + return this; + } + + /** + * Event type + * @return eventType + **/ + @javax.annotation.Nonnull + public String getEventType() { + return eventType; + } + + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + + public EventSchema id(String id) { + + this.id = id; + return this; + } + + /** + * Id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public EventSchema labels(Object labels) { + + this.labels = labels; + return this; + } + + /** + * Event labels + * @return labels + **/ + @javax.annotation.Nonnull + public Object getLabels() { + return labels; + } + + + public void setLabels(Object labels) { + this.labels = labels; + } + + + public EventSchema schemaVersion(String schemaVersion) { + + this.schemaVersion = schemaVersion; + return this; + } + + /** + * Event schema version. Can be used by client app to know how to parse the event + * @return schemaVersion + **/ + @javax.annotation.Nonnull + public String getSchemaVersion() { + return schemaVersion; + } + + + public void setSchemaVersion(String schemaVersion) { + this.schemaVersion = schemaVersion; + } + + + public EventSchema severity(String severity) { + + this.severity = severity; + return this; + } + + /** + * Event severity + * @return severity + **/ + @javax.annotation.Nonnull + public String getSeverity() { + return severity; + } + + + public void setSeverity(String severity) { + this.severity = severity; + } + + + public EventSchema status(String status) { + + this.status = status; + return this; + } + + /** + * Event status, Received, Stored + * @return status + **/ + @javax.annotation.Nonnull + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public EventSchema updatedAt(OffsetDateTime updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventSchema eventSchema = (EventSchema) o; + return Objects.equals(this.clientSource, eventSchema.clientSource) && + Objects.equals(this.clientUuid, eventSchema.clientUuid) && + Objects.equals(this.createdAt, eventSchema.createdAt) && + Objects.equals(this.data, eventSchema.data) && + Objects.equals(this.eventType, eventSchema.eventType) && + Objects.equals(this.id, eventSchema.id) && + Objects.equals(this.labels, eventSchema.labels) && + Objects.equals(this.schemaVersion, eventSchema.schemaVersion) && + Objects.equals(this.severity, eventSchema.severity) && + Objects.equals(this.status, eventSchema.status) && + Objects.equals(this.updatedAt, eventSchema.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(clientSource, clientUuid, createdAt, data, eventType, id, labels, schemaVersion, severity, status, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventSchema {\n"); + sb.append(" clientSource: ").append(toIndentedString(clientSource)).append("\n"); + sb.append(" clientUuid: ").append(toIndentedString(clientUuid)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" schemaVersion: ").append(toIndentedString(schemaVersion)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).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("client_source"); + openapiFields.add("client_uuid"); + openapiFields.add("created_at"); + openapiFields.add("data"); + openapiFields.add("event_type"); + openapiFields.add("id"); + openapiFields.add("labels"); + openapiFields.add("schema_version"); + openapiFields.add("severity"); + openapiFields.add("status"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("client_source"); + openapiRequiredFields.add("client_uuid"); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("event_type"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("labels"); + openapiRequiredFields.add("schema_version"); + openapiRequiredFields.add("severity"); + openapiRequiredFields.add("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 EventSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventSchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EventSchema is not found in the empty JSON string", EventSchema.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EventSchema.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EventSchema` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventSchema.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("client_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_source").toString())); + } + if (!jsonObj.get("client_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_uuid").toString())); + } + if (!jsonObj.get("event_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `event_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("event_type").toString())); + } + 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("schema_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `schema_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("schema_version").toString())); + } + if (!jsonObj.get("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!EventSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, EventSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public EventSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventSchema + * @throws IOException if the JSON string is invalid with respect to EventSchema + */ + public static EventSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventSchema.class); + } + + /** + * Convert an instance of EventSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/client/model/PaginationSchema.java b/src/main/java/org/openapitools/client/model/PaginationSchema.java new file mode 100644 index 0000000..807a9a0 --- /dev/null +++ b/src/main/java/org/openapitools/client/model/PaginationSchema.java @@ -0,0 +1,317 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +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.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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PaginationSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") +public class PaginationSchema { + public static final String SERIALIZED_NAME_PAGE = "page"; + @SerializedName(SERIALIZED_NAME_PAGE) + private Integer page; + + public static final String SERIALIZED_NAME_PAGE_SIZE = "pageSize"; + @SerializedName(SERIALIZED_NAME_PAGE_SIZE) + private Integer pageSize; + + public static final String SERIALIZED_NAME_ROWS = "rows"; + @SerializedName(SERIALIZED_NAME_ROWS) + private List rows = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_ROWS = "totalRows"; + @SerializedName(SERIALIZED_NAME_TOTAL_ROWS) + private Integer totalRows; + + public PaginationSchema() { + } + + public PaginationSchema page(Integer page) { + + this.page = page; + return this; + } + + /** + * Get page + * @return page + **/ + @javax.annotation.Nonnull + public Integer getPage() { + return page; + } + + + public void setPage(Integer page) { + this.page = page; + } + + + public PaginationSchema pageSize(Integer pageSize) { + + this.pageSize = pageSize; + return this; + } + + /** + * Get pageSize + * @return pageSize + **/ + @javax.annotation.Nonnull + public Integer getPageSize() { + return pageSize; + } + + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + + public PaginationSchema rows(List rows) { + + this.rows = rows; + return this; + } + + public PaginationSchema addRowsItem(Object rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * @return rows + **/ + @javax.annotation.Nonnull + public List getRows() { + return rows; + } + + + public void setRows(List rows) { + this.rows = rows; + } + + + public PaginationSchema totalRows(Integer totalRows) { + + this.totalRows = totalRows; + return this; + } + + /** + * Get totalRows + * @return totalRows + **/ + @javax.annotation.Nonnull + public Integer getTotalRows() { + return totalRows; + } + + + public void setTotalRows(Integer totalRows) { + this.totalRows = totalRows; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaginationSchema paginationSchema = (PaginationSchema) o; + return Objects.equals(this.page, paginationSchema.page) && + Objects.equals(this.pageSize, paginationSchema.pageSize) && + Objects.equals(this.rows, paginationSchema.rows) && + Objects.equals(this.totalRows, paginationSchema.totalRows); + } + + @Override + public int hashCode() { + return Objects.hash(page, pageSize, rows, totalRows); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaginationSchema {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" pageSize: ").append(toIndentedString(pageSize)).append("\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" totalRows: ").append(toIndentedString(totalRows)).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("page"); + openapiFields.add("pageSize"); + openapiFields.add("rows"); + openapiFields.add("totalRows"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("page"); + openapiRequiredFields.add("pageSize"); + openapiRequiredFields.add("rows"); + openapiRequiredFields.add("totalRows"); + } + + /** + * 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 PaginationSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PaginationSchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PaginationSchema is not found in the empty JSON string", PaginationSchema.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaginationSchema.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginationSchema` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaginationSchema.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 required json array is present + if (jsonObj.get("rows") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rows` to be an array in the JSON string but got `%s`", jsonObj.get("rows").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaginationSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaginationSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaginationSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaginationSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaginationSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaginationSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaginationSchema + * @throws IOException if the JSON string is invalid with respect to PaginationSchema + */ + public static PaginationSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaginationSchema.class); + } + + /** + * Convert an instance of PaginationSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/client/model/PolicyChannelSchema.java b/src/main/java/org/openapitools/client/model/PolicyChannelSchema.java new file mode 100644 index 0000000..e6125cc --- /dev/null +++ b/src/main/java/org/openapitools/client/model/PolicyChannelSchema.java @@ -0,0 +1,497 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PolicyChannelSchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") +public class PolicyChannelSchema { + public static final String SERIALIZED_NAME_CLIENT_UUID = "client_uuid"; + @SerializedName(SERIALIZED_NAME_CLIENT_UUID) + private String clientUuid; + + public static final String SERIALIZED_NAME_CONFIG = "config"; + @SerializedName(SERIALIZED_NAME_CONFIG) + private Object config; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DELETED = "deleted"; + @SerializedName(SERIALIZED_NAME_DELETED) + private Boolean deleted; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_LAST_NOTIFICATION = "last_notification"; + @SerializedName(SERIALIZED_NAME_LAST_NOTIFICATION) + private OffsetDateTime lastNotification; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public PolicyChannelSchema() { + } + + public PolicyChannelSchema clientUuid(String clientUuid) { + + this.clientUuid = clientUuid; + return this; + } + + /** + * Client uuid. This is the id defined by client app + * @return clientUuid + **/ + @javax.annotation.Nonnull + public String getClientUuid() { + return clientUuid; + } + + + public void setClientUuid(String clientUuid) { + this.clientUuid = clientUuid; + } + + + public PolicyChannelSchema config(Object config) { + + this.config = config; + return this; + } + + /** + * Policy Channel config + * @return config + **/ + @javax.annotation.Nonnull + public Object getConfig() { + return config; + } + + + public void setConfig(Object config) { + this.config = config; + } + + + public PolicyChannelSchema createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public PolicyChannelSchema deleted(Boolean deleted) { + + this.deleted = deleted; + return this; + } + + /** + * Policy Channel deleted flag + * @return deleted + **/ + @javax.annotation.Nonnull + public Boolean getDeleted() { + return deleted; + } + + + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + + + public PolicyChannelSchema enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Policy Channel enabled flag + * @return enabled + **/ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + public PolicyChannelSchema id(String id) { + + this.id = id; + return this; + } + + /** + * Id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PolicyChannelSchema lastNotification(OffsetDateTime lastNotification) { + + this.lastNotification = lastNotification; + return this; + } + + /** + * Get lastNotification + * @return lastNotification + **/ + @javax.annotation.Nullable + public OffsetDateTime getLastNotification() { + return lastNotification; + } + + + public void setLastNotification(OffsetDateTime lastNotification) { + this.lastNotification = lastNotification; + } + + + public PolicyChannelSchema name(String name) { + + this.name = name; + return this; + } + + /** + * Policy Channel name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PolicyChannelSchema type(String type) { + + this.type = type; + return this; + } + + /** + * Policy Channel type + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public PolicyChannelSchema updatedAt(OffsetDateTime updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PolicyChannelSchema policyChannelSchema = (PolicyChannelSchema) o; + return Objects.equals(this.clientUuid, policyChannelSchema.clientUuid) && + Objects.equals(this.config, policyChannelSchema.config) && + Objects.equals(this.createdAt, policyChannelSchema.createdAt) && + Objects.equals(this.deleted, policyChannelSchema.deleted) && + Objects.equals(this.enabled, policyChannelSchema.enabled) && + Objects.equals(this.id, policyChannelSchema.id) && + Objects.equals(this.lastNotification, policyChannelSchema.lastNotification) && + Objects.equals(this.name, policyChannelSchema.name) && + Objects.equals(this.type, policyChannelSchema.type) && + Objects.equals(this.updatedAt, policyChannelSchema.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(clientUuid, config, createdAt, deleted, enabled, id, lastNotification, name, type, 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 PolicyChannelSchema {\n"); + sb.append(" clientUuid: ").append(toIndentedString(clientUuid)).append("\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastNotification: ").append(toIndentedString(lastNotification)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("client_uuid"); + openapiFields.add("config"); + openapiFields.add("created_at"); + openapiFields.add("deleted"); + openapiFields.add("enabled"); + openapiFields.add("id"); + openapiFields.add("last_notification"); + openapiFields.add("name"); + openapiFields.add("type"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("client_uuid"); + openapiRequiredFields.add("config"); + openapiRequiredFields.add("deleted"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + 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 PolicyChannelSchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PolicyChannelSchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PolicyChannelSchema is not found in the empty JSON string", PolicyChannelSchema.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PolicyChannelSchema.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PolicyChannelSchema` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PolicyChannelSchema.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("client_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_uuid").toString())); + } + 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("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").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 (!PolicyChannelSchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PolicyChannelSchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PolicyChannelSchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PolicyChannelSchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PolicyChannelSchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PolicyChannelSchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PolicyChannelSchema + * @throws IOException if the JSON string is invalid with respect to PolicyChannelSchema + */ + public static PolicyChannelSchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PolicyChannelSchema.class); + } + + /** + * Convert an instance of PolicyChannelSchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/org/openapitools/client/model/PolicySchema.java b/src/main/java/org/openapitools/client/model/PolicySchema.java new file mode 100644 index 0000000..c7e1990 --- /dev/null +++ b/src/main/java/org/openapitools/client/model/PolicySchema.java @@ -0,0 +1,666 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 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.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PolicySchema + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-08-10T17:30:44.416597Z[Etc/UTC]") +public class PolicySchema { + public static final String SERIALIZED_NAME_CHANNELS = "channels"; + @SerializedName(SERIALIZED_NAME_CHANNELS) + private Object channels; + + public static final String SERIALIZED_NAME_CLIENT_SOURCE = "client_source"; + @SerializedName(SERIALIZED_NAME_CLIENT_SOURCE) + private String clientSource; + + public static final String SERIALIZED_NAME_CLIENT_UUID = "client_uuid"; + @SerializedName(SERIALIZED_NAME_CLIENT_UUID) + private String clientUuid; + + public static final String SERIALIZED_NAME_CREATED_AT = "created_at"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DELETED = "deleted"; + @SerializedName(SERIALIZED_NAME_DELETED) + private Boolean deleted; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_FILTERS = "filters"; + @SerializedName(SERIALIZED_NAME_FILTERS) + private Object filters; + + public static final String SERIALIZED_NAME_FREQUENCY = "frequency"; + @SerializedName(SERIALIZED_NAME_FREQUENCY) + private Boolean frequency; + + public static final String SERIALIZED_NAME_FREQUENCY_MINUTES = "frequency_minutes"; + @SerializedName(SERIALIZED_NAME_FREQUENCY_MINUTES) + private Integer frequencyMinutes; + + public static final String SERIALIZED_NAME_FREQUENCY_OCCURRENCES = "frequency_occurrences"; + @SerializedName(SERIALIZED_NAME_FREQUENCY_OCCURRENCES) + private Integer frequencyOccurrences; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_LABELS = "labels"; + @SerializedName(SERIALIZED_NAME_LABELS) + private Object labels; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_SEVERITY = "severity"; + @SerializedName(SERIALIZED_NAME_SEVERITY) + private String severity; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at"; + @SerializedName(SERIALIZED_NAME_UPDATED_AT) + private OffsetDateTime updatedAt; + + public PolicySchema() { + } + + public PolicySchema channels(Object channels) { + + this.channels = channels; + return this; + } + + /** + * List of channel notification + * @return channels + **/ + @javax.annotation.Nonnull + public Object getChannels() { + return channels; + } + + + public void setChannels(Object channels) { + this.channels = channels; + } + + + public PolicySchema clientSource(String clientSource) { + + this.clientSource = clientSource; + return this; + } + + /** + * Policy Client source + * @return clientSource + **/ + @javax.annotation.Nonnull + public String getClientSource() { + return clientSource; + } + + + public void setClientSource(String clientSource) { + this.clientSource = clientSource; + } + + + public PolicySchema clientUuid(String clientUuid) { + + this.clientUuid = clientUuid; + return this; + } + + /** + * Policy Client UUID + * @return clientUuid + **/ + @javax.annotation.Nonnull + public String getClientUuid() { + return clientUuid; + } + + + public void setClientUuid(String clientUuid) { + this.clientUuid = clientUuid; + } + + + public PolicySchema createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public PolicySchema deleted(Boolean deleted) { + + this.deleted = deleted; + return this; + } + + /** + * Policy deleted + * @return deleted + **/ + @javax.annotation.Nonnull + public Boolean getDeleted() { + return deleted; + } + + + public void setDeleted(Boolean deleted) { + this.deleted = deleted; + } + + + public PolicySchema enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Policy enabled + * @return enabled + **/ + @javax.annotation.Nonnull + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + public PolicySchema filters(Object filters) { + + this.filters = filters; + return this; + } + + /** + * Policy filters + * @return filters + **/ + @javax.annotation.Nonnull + public Object getFilters() { + return filters; + } + + + public void setFilters(Object filters) { + this.filters = filters; + } + + + public PolicySchema frequency(Boolean frequency) { + + this.frequency = frequency; + return this; + } + + /** + * Enable alert frequency for the policy + * @return frequency + **/ + @javax.annotation.Nonnull + public Boolean getFrequency() { + return frequency; + } + + + public void setFrequency(Boolean frequency) { + this.frequency = frequency; + } + + + public PolicySchema frequencyMinutes(Integer frequencyMinutes) { + + this.frequencyMinutes = frequencyMinutes; + return this; + } + + /** + * Quantity of alert interval time + * @return frequencyMinutes + **/ + @javax.annotation.Nonnull + public Integer getFrequencyMinutes() { + return frequencyMinutes; + } + + + public void setFrequencyMinutes(Integer frequencyMinutes) { + this.frequencyMinutes = frequencyMinutes; + } + + + public PolicySchema frequencyOccurrences(Integer frequencyOccurrences) { + + this.frequencyOccurrences = frequencyOccurrences; + return this; + } + + /** + * Quantity of alert occurrencies + * @return frequencyOccurrences + **/ + @javax.annotation.Nonnull + public Integer getFrequencyOccurrences() { + return frequencyOccurrences; + } + + + public void setFrequencyOccurrences(Integer frequencyOccurrences) { + this.frequencyOccurrences = frequencyOccurrences; + } + + + public PolicySchema id(String id) { + + this.id = id; + return this; + } + + /** + * Id + * @return id + **/ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PolicySchema labels(Object labels) { + + this.labels = labels; + return this; + } + + /** + * Policy labels + * @return labels + **/ + @javax.annotation.Nonnull + public Object getLabels() { + return labels; + } + + + public void setLabels(Object labels) { + this.labels = labels; + } + + + public PolicySchema name(String name) { + + this.name = name; + return this; + } + + /** + * Policy name + * @return name + **/ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PolicySchema severity(String severity) { + + this.severity = severity; + return this; + } + + /** + * Policy severity + * @return severity + **/ + @javax.annotation.Nonnull + public String getSeverity() { + return severity; + } + + + public void setSeverity(String severity) { + this.severity = severity; + } + + + public PolicySchema type(String type) { + + this.type = type; + return this; + } + + /** + * Policy type + * @return type + **/ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public PolicySchema updatedAt(OffsetDateTime updatedAt) { + + this.updatedAt = updatedAt; + return this; + } + + /** + * Get updatedAt + * @return updatedAt + **/ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PolicySchema policySchema = (PolicySchema) o; + return Objects.equals(this.channels, policySchema.channels) && + Objects.equals(this.clientSource, policySchema.clientSource) && + Objects.equals(this.clientUuid, policySchema.clientUuid) && + Objects.equals(this.createdAt, policySchema.createdAt) && + Objects.equals(this.deleted, policySchema.deleted) && + Objects.equals(this.enabled, policySchema.enabled) && + Objects.equals(this.filters, policySchema.filters) && + Objects.equals(this.frequency, policySchema.frequency) && + Objects.equals(this.frequencyMinutes, policySchema.frequencyMinutes) && + Objects.equals(this.frequencyOccurrences, policySchema.frequencyOccurrences) && + Objects.equals(this.id, policySchema.id) && + Objects.equals(this.labels, policySchema.labels) && + Objects.equals(this.name, policySchema.name) && + Objects.equals(this.severity, policySchema.severity) && + Objects.equals(this.type, policySchema.type) && + Objects.equals(this.updatedAt, policySchema.updatedAt); + } + + @Override + public int hashCode() { + return Objects.hash(channels, clientSource, clientUuid, createdAt, deleted, enabled, filters, frequency, frequencyMinutes, frequencyOccurrences, id, labels, name, severity, type, updatedAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PolicySchema {\n"); + sb.append(" channels: ").append(toIndentedString(channels)).append("\n"); + sb.append(" clientSource: ").append(toIndentedString(clientSource)).append("\n"); + sb.append(" clientUuid: ").append(toIndentedString(clientUuid)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" filters: ").append(toIndentedString(filters)).append("\n"); + sb.append(" frequency: ").append(toIndentedString(frequency)).append("\n"); + sb.append(" frequencyMinutes: ").append(toIndentedString(frequencyMinutes)).append("\n"); + sb.append(" frequencyOccurrences: ").append(toIndentedString(frequencyOccurrences)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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("channels"); + openapiFields.add("client_source"); + openapiFields.add("client_uuid"); + openapiFields.add("created_at"); + openapiFields.add("deleted"); + openapiFields.add("enabled"); + openapiFields.add("filters"); + openapiFields.add("frequency"); + openapiFields.add("frequency_minutes"); + openapiFields.add("frequency_occurrences"); + openapiFields.add("id"); + openapiFields.add("labels"); + openapiFields.add("name"); + openapiFields.add("severity"); + openapiFields.add("type"); + openapiFields.add("updated_at"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("channels"); + openapiRequiredFields.add("client_source"); + openapiRequiredFields.add("client_uuid"); + openapiRequiredFields.add("deleted"); + openapiRequiredFields.add("enabled"); + openapiRequiredFields.add("filters"); + openapiRequiredFields.add("frequency"); + openapiRequiredFields.add("frequency_minutes"); + openapiRequiredFields.add("frequency_occurrences"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("labels"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("severity"); + 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 PolicySchema + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PolicySchema.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PolicySchema is not found in the empty JSON string", PolicySchema.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PolicySchema.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PolicySchema` properties. JSON: %s", entry.getKey(), jsonElement.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PolicySchema.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("client_source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_source").toString())); + } + if (!jsonObj.get("client_uuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_uuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_uuid").toString())); + } + 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("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("severity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `severity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("severity").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PolicySchema.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PolicySchema' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PolicySchema.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PolicySchema value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PolicySchema read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PolicySchema given an JSON string + * + * @param jsonString JSON string + * @return An instance of PolicySchema + * @throws IOException if the JSON string is invalid with respect to PolicySchema + */ + public static PolicySchema fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PolicySchema.class); + } + + /** + * Convert an instance of PolicySchema to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/test/java/org/openapitools/client/api/ChannelsApiTest.java b/src/test/java/org/openapitools/client/api/ChannelsApiTest.java new file mode 100644 index 0000000..d5f731a --- /dev/null +++ b/src/test/java/org/openapitools/client/api/ChannelsApiTest.java @@ -0,0 +1,95 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.PaginationSchema; +import org.openapitools.client.model.PolicyChannelSchema; +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 ChannelsApi + */ +@Disabled +public class ChannelsApiTest { + + private final ChannelsApi api = new ChannelsApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void deletePolicyChannelsDeleteTest() throws ApiException { + String id = null; + PolicyChannelSchema response = api.deletePolicyChannelsDelete(id); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getPolicyChannelsGetTest() throws ApiException { + String id = null; + PolicyChannelSchema response = api.getPolicyChannelsGet(id); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getPolicyChannelsGetAllTest() throws ApiException { + PaginationSchema response = api.getPolicyChannelsGetAll(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void postPolicyChannelsPostTest() throws ApiException { + PolicyChannelSchema requestBody = null; + PolicyChannelSchema response = api.postPolicyChannelsPost(requestBody); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void postPolicyChannelsTestTest() throws ApiException { + PolicyChannelSchema requestBody = null; + PolicyChannelSchema response = api.postPolicyChannelsTest(requestBody); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void putPolicyChannelsPutTest() throws ApiException { + String id = null; + PolicyChannelSchema requestBody = null; + PolicyChannelSchema response = api.putPolicyChannelsPut(id, requestBody); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/api/DocsApiTest.java b/src/test/java/org/openapitools/client/api/DocsApiTest.java new file mode 100644 index 0000000..9a0819d --- /dev/null +++ b/src/test/java/org/openapitools/client/api/DocsApiTest.java @@ -0,0 +1,51 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +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 DocsApi + */ +@Disabled +public class DocsApiTest { + + private final DocsApi api = new DocsApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getSwaggerJsonTest() throws ApiException { + api.getSwaggerJson(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getSwaggerYmlTest() throws ApiException { + api.getSwaggerYml(); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/api/EventsApiTest.java b/src/test/java/org/openapitools/client/api/EventsApiTest.java new file mode 100644 index 0000000..5f4b682 --- /dev/null +++ b/src/test/java/org/openapitools/client/api/EventsApiTest.java @@ -0,0 +1,73 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.EventSchema; +import org.openapitools.client.model.PaginationSchema; +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 EventsApi + */ +@Disabled +public class EventsApiTest { + + private final EventsApi api = new EventsApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getEventsGetTest() throws ApiException { + String id = null; + EventSchema response = api.getEventsGet(id); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getEventsGetAllTest() throws ApiException { + PaginationSchema response = api.getEventsGetAll(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getEventsParametersGetTest() throws ApiException { + List response = api.getEventsParametersGet(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void postEventsPostTest() throws ApiException { + EventSchema requestBody = null; + EventSchema response = api.postEventsPost(requestBody); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/api/HealthCheckApiTest.java b/src/test/java/org/openapitools/client/api/HealthCheckApiTest.java new file mode 100644 index 0000000..831c903 --- /dev/null +++ b/src/test/java/org/openapitools/client/api/HealthCheckApiTest.java @@ -0,0 +1,42 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +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 HealthCheckApi + */ +@Disabled +public class HealthCheckApiTest { + + private final HealthCheckApi api = new HealthCheckApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getHealthCheckTest() throws ApiException { + api.getHealthCheck(); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/api/NotificationsApiTest.java b/src/test/java/org/openapitools/client/api/NotificationsApiTest.java new file mode 100644 index 0000000..2b7919b --- /dev/null +++ b/src/test/java/org/openapitools/client/api/NotificationsApiTest.java @@ -0,0 +1,54 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.PaginationSchema; +import org.openapitools.client.model.PolicyChannelSchema; +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 NotificationsApi + */ +@Disabled +public class NotificationsApiTest { + + private final NotificationsApi api = new NotificationsApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getNotificationLogGetTest() throws ApiException { + String id = null; + PolicyChannelSchema response = api.getNotificationLogGet(id); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getNotificationLogGetAllTest() throws ApiException { + PaginationSchema response = api.getNotificationLogGetAll(); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/api/PoliciesApiTest.java b/src/test/java/org/openapitools/client/api/PoliciesApiTest.java new file mode 100644 index 0000000..a6076aa --- /dev/null +++ b/src/test/java/org/openapitools/client/api/PoliciesApiTest.java @@ -0,0 +1,85 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.PaginationSchema; +import org.openapitools.client.model.PolicySchema; +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 PoliciesApi + */ +@Disabled +public class PoliciesApiTest { + + private final PoliciesApi api = new PoliciesApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void deletePoliciesDeleteTest() throws ApiException { + String id = null; + PolicySchema response = api.deletePoliciesDelete(id); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getPoliciesGetTest() throws ApiException { + String id = null; + PolicySchema response = api.getPoliciesGet(id); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getPoliciesGetAllTest() throws ApiException { + PaginationSchema response = api.getPoliciesGetAll(); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void postPoliciesPostTest() throws ApiException { + PolicySchema requestBody = null; + PolicySchema response = api.postPoliciesPost(requestBody); + // TODO: test validations + } + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void putPoliciesPutTest() throws ApiException { + String id = null; + PolicySchema requestBody = null; + PolicySchema response = api.putPoliciesPut(id, requestBody); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/api/WelcomeApiTest.java b/src/test/java/org/openapitools/client/api/WelcomeApiTest.java new file mode 100644 index 0000000..fd5526b --- /dev/null +++ b/src/test/java/org/openapitools/client/api/WelcomeApiTest.java @@ -0,0 +1,42 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +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 WelcomeApi + */ +@Disabled +public class WelcomeApiTest { + + private final WelcomeApi api = new WelcomeApi(); + + /** + * @throws ApiException if the Api call fails + */ + @Test + public void getWelcomeTest() throws ApiException { + api.getWelcome(); + // TODO: test validations + } + +} diff --git a/src/test/java/org/openapitools/client/model/EventSchemaTest.java b/src/test/java/org/openapitools/client/model/EventSchemaTest.java new file mode 100644 index 0000000..01c9617 --- /dev/null +++ b/src/test/java/org/openapitools/client/model/EventSchemaTest.java @@ -0,0 +1,128 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EventSchema + */ +public class EventSchemaTest { + private final EventSchema model = new EventSchema(); + + /** + * Model tests for EventSchema + */ + @Test + public void testEventSchema() { + // TODO: test EventSchema + } + + /** + * Test the property 'clientSource' + */ + @Test + public void clientSourceTest() { + // TODO: test clientSource + } + + /** + * Test the property 'clientUuid' + */ + @Test + public void clientUuidTest() { + // TODO: test clientUuid + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'data' + */ + @Test + public void dataTest() { + // TODO: test data + } + + /** + * Test the property 'eventType' + */ + @Test + public void eventTypeTest() { + // TODO: test eventType + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'labels' + */ + @Test + public void labelsTest() { + // TODO: test labels + } + + /** + * Test the property 'schemaVersion' + */ + @Test + public void schemaVersionTest() { + // TODO: test schemaVersion + } + + /** + * Test the property 'severity' + */ + @Test + public void severityTest() { + // TODO: test severity + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/org/openapitools/client/model/PaginationSchemaTest.java b/src/test/java/org/openapitools/client/model/PaginationSchemaTest.java new file mode 100644 index 0000000..350e3df --- /dev/null +++ b/src/test/java/org/openapitools/client/model/PaginationSchemaTest.java @@ -0,0 +1,73 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.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.List; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PaginationSchema + */ +public class PaginationSchemaTest { + private final PaginationSchema model = new PaginationSchema(); + + /** + * Model tests for PaginationSchema + */ + @Test + public void testPaginationSchema() { + // TODO: test PaginationSchema + } + + /** + * Test the property 'page' + */ + @Test + public void pageTest() { + // TODO: test page + } + + /** + * Test the property 'pageSize' + */ + @Test + public void pageSizeTest() { + // TODO: test pageSize + } + + /** + * Test the property 'rows' + */ + @Test + public void rowsTest() { + // TODO: test rows + } + + /** + * Test the property 'totalRows' + */ + @Test + public void totalRowsTest() { + // TODO: test totalRows + } + +} diff --git a/src/test/java/org/openapitools/client/model/PolicyChannelSchemaTest.java b/src/test/java/org/openapitools/client/model/PolicyChannelSchemaTest.java new file mode 100644 index 0000000..8dc59c7 --- /dev/null +++ b/src/test/java/org/openapitools/client/model/PolicyChannelSchemaTest.java @@ -0,0 +1,121 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.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 org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PolicyChannelSchema + */ +public class PolicyChannelSchemaTest { + private final PolicyChannelSchema model = new PolicyChannelSchema(); + + /** + * Model tests for PolicyChannelSchema + */ + @Test + public void testPolicyChannelSchema() { + // TODO: test PolicyChannelSchema + } + + /** + * Test the property 'clientUuid' + */ + @Test + public void clientUuidTest() { + // TODO: test clientUuid + } + + /** + * Test the property 'config' + */ + @Test + public void configTest() { + // TODO: test config + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'deleted' + */ + @Test + public void deletedTest() { + // TODO: test deleted + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'lastNotification' + */ + @Test + public void lastNotificationTest() { + // TODO: test lastNotification + } + + /** + * 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 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +} diff --git a/src/test/java/org/openapitools/client/model/PolicySchemaTest.java b/src/test/java/org/openapitools/client/model/PolicySchemaTest.java new file mode 100644 index 0000000..073eb31 --- /dev/null +++ b/src/test/java/org/openapitools/client/model/PolicySchemaTest.java @@ -0,0 +1,168 @@ +/* + * alertmanager + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.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 org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for PolicySchema + */ +public class PolicySchemaTest { + private final PolicySchema model = new PolicySchema(); + + /** + * Model tests for PolicySchema + */ + @Test + public void testPolicySchema() { + // TODO: test PolicySchema + } + + /** + * Test the property 'channels' + */ + @Test + public void channelsTest() { + // TODO: test channels + } + + /** + * Test the property 'clientSource' + */ + @Test + public void clientSourceTest() { + // TODO: test clientSource + } + + /** + * Test the property 'clientUuid' + */ + @Test + public void clientUuidTest() { + // TODO: test clientUuid + } + + /** + * Test the property 'createdAt' + */ + @Test + public void createdAtTest() { + // TODO: test createdAt + } + + /** + * Test the property 'deleted' + */ + @Test + public void deletedTest() { + // TODO: test deleted + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + + /** + * Test the property 'filters' + */ + @Test + public void filtersTest() { + // TODO: test filters + } + + /** + * Test the property 'frequency' + */ + @Test + public void frequencyTest() { + // TODO: test frequency + } + + /** + * Test the property 'frequencyMinutes' + */ + @Test + public void frequencyMinutesTest() { + // TODO: test frequencyMinutes + } + + /** + * Test the property 'frequencyOccurrences' + */ + @Test + public void frequencyOccurrencesTest() { + // TODO: test frequencyOccurrences + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'labels' + */ + @Test + public void labelsTest() { + // TODO: test labels + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'severity' + */ + @Test + public void severityTest() { + // TODO: test severity + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'updatedAt' + */ + @Test + public void updatedAtTest() { + // TODO: test updatedAt + } + +}