From 21ed5ed675c1363ab5566527c97dc57ab16f8d14 Mon Sep 17 00:00:00 2001 From: app-services-ci Date: Fri, 4 Feb 2022 13:27:31 +0000 Subject: [PATCH 1/3] chore(all): re-generate OpenAPI client(s) --- .../cloud/api/connector/ApiErrorType.java | 159 ------------------ packages/kafka-instance-sdk/api/openapi.yaml | 11 +- packages/kafka-instance-sdk/docs/GroupsApi.md | 8 +- packages/kafka-instance-sdk/docs/TopicsApi.md | 8 +- .../cloud/api/kas/auth/GroupsApi.java | 6 +- .../cloud/api/kas/auth/TopicsApi.java | 6 +- 6 files changed, 20 insertions(+), 178 deletions(-) delete mode 100644 packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java deleted file mode 100644 index 00fee958..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.openshift.cloud.api.connector; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Contains the possible error codes returned by API - */ -public enum ApiErrorType { - - /** Forbidden to perform this action*/ - ERROR_4("CONNECTOR-MGMT-4"), - - /** Forbidden to create more instances than the maximum allowed*/ - ERROR_5("CONNECTOR-MGMT-5"), - - /** An entity with the specified unique values already exists*/ - ERROR_6("CONNECTOR-MGMT-6"), - - /** Resource not found*/ - ERROR_7("CONNECTOR-MGMT-7"), - - /** General validation failure*/ - ERROR_8("CONNECTOR-MGMT-8"), - - /** Unspecified error*/ - ERROR_9("CONNECTOR-MGMT-9"), - - /** HTTP Method not implemented for this endpoint*/ - ERROR_10("CONNECTOR-MGMT-10"), - - /** Account is unauthorized to perform this action*/ - ERROR_11("CONNECTOR-MGMT-11"), - - /** Required terms have not been accepted*/ - ERROR_12("CONNECTOR-MGMT-12"), - - /** Account authentication could not be verified*/ - ERROR_15("CONNECTOR-MGMT-15"), - - /** Unable to read request body*/ - ERROR_17("CONNECTOR-MGMT-17"), - - /** Bad request*/ - ERROR_21("CONNECTOR-MGMT-21"), - - /** Failed to parse search query*/ - ERROR_23("CONNECTOR-MGMT-23"), - - /** The maximum number of allowed kafka instances has been reached*/ - ERROR_24("CONNECTOR-MGMT-24"), - - /** Resource gone*/ - ERROR_25("CONNECTOR-MGMT-25"), - - /** Provider not supported*/ - ERROR_30("CONNECTOR-MGMT-30"), - - /** Region not supported*/ - ERROR_31("CONNECTOR-MGMT-31"), - - /** Kafka cluster name is invalid*/ - ERROR_32("CONNECTOR-MGMT-32"), - - /** Minimum field length not reached*/ - ERROR_33("CONNECTOR-MGMT-33"), - - /** Maximum field length has been depassed*/ - ERROR_34("CONNECTOR-MGMT-34"), - - /** Only multiAZ Kafkas are supported, use multi_az=true*/ - ERROR_35("CONNECTOR-MGMT-35"), - - /** Kafka cluster name is already used*/ - ERROR_36("CONNECTOR-MGMT-36"), - - /** Field validation failed*/ - ERROR_37("CONNECTOR-MGMT-37"), - - /** Service account name is invalid*/ - ERROR_38("CONNECTOR-MGMT-38"), - - /** Service account desc is invalid*/ - ERROR_39("CONNECTOR-MGMT-39"), - - /** Service account id is invalid*/ - ERROR_40("CONNECTOR-MGMT-40"), - - /** Instance Type not supported*/ - ERROR_41("CONNECTOR-MGMT-41"), - - /** Synchronous action is not supported, use async=true parameter*/ - ERROR_103("CONNECTOR-MGMT-103"), - - /** Failed to create kafka client in the mas sso*/ - ERROR_106("CONNECTOR-MGMT-106"), - - /** Failed to get kafka client secret from the mas sso*/ - ERROR_107("CONNECTOR-MGMT-107"), - - /** Failed to get kafka client from the mas sso*/ - ERROR_108("CONNECTOR-MGMT-108"), - - /** Failed to delete kafka client from the mas sso*/ - ERROR_109("CONNECTOR-MGMT-109"), - - /** Failed to create service account*/ - ERROR_110("CONNECTOR-MGMT-110"), - - /** Failed to get service account*/ - ERROR_111("CONNECTOR-MGMT-111"), - - /** Failed to delete service account*/ - ERROR_112("CONNECTOR-MGMT-112"), - - /** Failed to find service account*/ - ERROR_113("CONNECTOR-MGMT-113"), - - /** Insufficient quota*/ - ERROR_120("CONNECTOR-MGMT-120"), - - /** Failed to check quota*/ - ERROR_121("CONNECTOR-MGMT-121"), - - /** Too Many requests*/ - ERROR_429("CONNECTOR-MGMT-429"), - - /** An unexpected error happened, please check the log of the service for details*/ - ERROR_1000("CONNECTOR-MGMT-1000"); - - - - private String value; - - ApiErrorType(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ApiErrorType fromValue(String value) { - for (ApiErrorType b : ApiErrorType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/packages/kafka-instance-sdk/api/openapi.yaml b/packages/kafka-instance-sdk/api/openapi.yaml index 1014db3b..227b39bc 100644 --- a/packages/kafka-instance-sdk/api/openapi.yaml +++ b/packages/kafka-instance-sdk/api/openapi.yaml @@ -26,13 +26,13 @@ paths: those records the requestor is authorized to view. operationId: getTopics parameters: - - description: Maximum number of topics to return on single page + - deprecated: true + description: Maximum number of topics to return explode: true in: query - name: size + name: limit required: false schema: - format: int32 type: integer style: form - description: Filter to apply when returning the list of topics @@ -508,10 +508,11 @@ paths: authorized to view. operationId: getConsumerGroups parameters: - - description: Maximum number of consumer groups to return on single page + - deprecated: true + description: Maximum number of consumer groups to return explode: true in: query - name: size + name: limit required: false schema: type: integer diff --git a/packages/kafka-instance-sdk/docs/GroupsApi.md b/packages/kafka-instance-sdk/docs/GroupsApi.md index aaec5789..c76709ef 100644 --- a/packages/kafka-instance-sdk/docs/GroupsApi.md +++ b/packages/kafka-instance-sdk/docs/GroupsApi.md @@ -171,7 +171,7 @@ Name | Type | Description | Notes ## getConsumerGroups -> ConsumerGroupList getConsumerGroups(size, page, topic, groupIdFilter, order, orderKey) +> ConsumerGroupList getConsumerGroups(limit, page, topic, groupIdFilter, order, orderKey) List of consumer groups in the Kafka instance. @@ -198,14 +198,14 @@ public class Example { Bearer.setAccessToken("YOUR ACCESS TOKEN"); GroupsApi apiInstance = new GroupsApi(defaultClient); - Integer size = 56; // Integer | Maximum number of consumer groups to return on single page + Integer limit = 56; // Integer | Maximum number of consumer groups to return Integer page = 56; // Integer | The page when returning the list of consumer groups String topic = "topic_example"; // String | Return consumer groups where the topic name contains with this value String groupIdFilter = "groupIdFilter_example"; // String | Return the consumer groups where the ID contains with this value String order = "asc"; // String | Order of the consumer groups sorting. Ascending order is used as default. String orderKey = "name"; // String | Order key to sort the items by. Only the value 'name' is currently applicable. try { - ConsumerGroupList result = apiInstance.getConsumerGroups(size, page, topic, groupIdFilter, order, orderKey); + ConsumerGroupList result = apiInstance.getConsumerGroups(limit, page, topic, groupIdFilter, order, orderKey); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling GroupsApi#getConsumerGroups"); @@ -223,7 +223,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **size** | **Integer**| Maximum number of consumer groups to return on single page | [optional] + **limit** | **Integer**| Maximum number of consumer groups to return | [optional] **page** | **Integer**| The page when returning the list of consumer groups | [optional] **topic** | **String**| Return consumer groups where the topic name contains with this value | [optional] **groupIdFilter** | **String**| Return the consumer groups where the ID contains with this value | [optional] diff --git a/packages/kafka-instance-sdk/docs/TopicsApi.md b/packages/kafka-instance-sdk/docs/TopicsApi.md index b6b6b64e..76aac16e 100644 --- a/packages/kafka-instance-sdk/docs/TopicsApi.md +++ b/packages/kafka-instance-sdk/docs/TopicsApi.md @@ -239,7 +239,7 @@ Name | Type | Description | Notes ## getTopics -> TopicsList getTopics(size, filter, page, order, orderKey) +> TopicsList getTopics(limit, filter, page, order, orderKey) List of topics @@ -266,13 +266,13 @@ public class Example { Bearer.setAccessToken("YOUR ACCESS TOKEN"); TopicsApi apiInstance = new TopicsApi(defaultClient); - Integer size = 56; // Integer | Maximum number of topics to return on single page + Integer limit = 56; // Integer | Maximum number of topics to return String filter = "filter_example"; // String | Filter to apply when returning the list of topics Integer page = 56; // Integer | The page when returning the limit of requested topics. String order = "asc"; // String | Order of the items sorting. Ascending order is used as default. String orderKey = "name"; // String | Order key to sort the topics by. try { - TopicsList result = apiInstance.getTopics(size, filter, page, order, orderKey); + TopicsList result = apiInstance.getTopics(limit, filter, page, order, orderKey); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TopicsApi#getTopics"); @@ -290,7 +290,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **size** | **Integer**| Maximum number of topics to return on single page | [optional] + **limit** | **Integer**| Maximum number of topics to return | [optional] **filter** | **String**| Filter to apply when returning the list of topics | [optional] **page** | **Integer**| The page when returning the limit of requested topics. | [optional] **order** | **String**| Order of the items sorting. Ascending order is used as default. | [optional] [enum: asc, desc] diff --git a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java index 0a05f218..1d604d38 100644 --- a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java +++ b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java @@ -136,7 +136,7 @@ public ConsumerGroup getConsumerGroupById(String consumerGroupId, String order, /** * List of consumer groups in the Kafka instance. * Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view. - * @param size Maximum number of consumer groups to return on single page (optional) + * @param limit Maximum number of consumer groups to return (optional) * @param page The page when returning the list of consumer groups (optional) * @param topic Return consumer groups where the topic name contains with this value (optional) * @param groupIdFilter Return the consumer groups where the ID contains with this value (optional) @@ -145,7 +145,7 @@ public ConsumerGroup getConsumerGroupById(String consumerGroupId, String order, * @return a {@code ConsumerGroupList} * @throws ApiException if fails to make API call */ - public ConsumerGroupList getConsumerGroups(Integer size, Integer page, String topic, String groupIdFilter, String order, String orderKey) throws ApiException { + public ConsumerGroupList getConsumerGroups(Integer limit, Integer page, String topic, String groupIdFilter, String order, String orderKey) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -157,7 +157,7 @@ public ConsumerGroupList getConsumerGroups(Integer size, Integer page, String to Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "topic", topic)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "group-id-filter", groupIdFilter)); diff --git a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java index 3d852ab4..8c990364 100644 --- a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java +++ b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java @@ -171,7 +171,7 @@ public Topic getTopic(String topicName) throws ApiException { /** * List of topics * Returns a list of all of the available topics, or the list of topics that meet the request query parameters. The topics returned are limited to those records the requestor is authorized to view. - * @param size Maximum number of topics to return on single page (optional) + * @param limit Maximum number of topics to return (optional) * @param filter Filter to apply when returning the list of topics (optional) * @param page The page when returning the limit of requested topics. (optional) * @param order Order of the items sorting. Ascending order is used as default. (optional) @@ -179,7 +179,7 @@ public Topic getTopic(String topicName) throws ApiException { * @return a {@code TopicsList} * @throws ApiException if fails to make API call */ - public TopicsList getTopics(Integer size, String filter, Integer page, String order, String orderKey) throws ApiException { + public TopicsList getTopics(Integer limit, String filter, Integer page, String order, String orderKey) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -191,7 +191,7 @@ public TopicsList getTopics(Integer size, String filter, Integer page, String or Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "order", order)); From 129f03f7d9da2efee66fb8ea480de06c34d0003b Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Fri, 4 Feb 2022 14:41:51 +0000 Subject: [PATCH 2/3] fix: add generate action to the workflow --- .github/workflows/generate.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 7a9262cd..ce46a805 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -20,6 +20,8 @@ jobs: - run: wget https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64 -O $HOME/.local/bin/yq && chmod +x $HOME/.local/bin/yq - name: Generate API clients run: ./scripts/generate.sh + - name: Generate Errors SDK + run: ./scripts/errors/generate-errors.sh - uses: peter-evans/create-pull-request@v3 with: title: "chore(all): re-generate OpenAPI client(s)" From bacf40c2d872705353ec716527904170550ec776 Mon Sep 17 00:00:00 2001 From: Wojciech Trocki Date: Fri, 4 Feb 2022 14:44:51 +0000 Subject: [PATCH 3/3] fix: readd error types --- .../cloud/api/connector/ApiErrorType.java | 159 ++++++++++++++++++ .../openshift/cloud/api/kas/ApiErrorType.java | 159 ++++++++++++++++++ .../openshift/cloud/api/srs/ApiErrorType.java | 69 ++++++++ 3 files changed, 387 insertions(+) create mode 100644 packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java create mode 100644 packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/ApiErrorType.java create mode 100644 packages/registry-management-sdk/src/main/java/com/openshift/cloud/api/srs/ApiErrorType.java diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java new file mode 100644 index 00000000..00fee958 --- /dev/null +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ApiErrorType.java @@ -0,0 +1,159 @@ +package com.openshift.cloud.api.connector; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Contains the possible error codes returned by API + */ +public enum ApiErrorType { + + /** Forbidden to perform this action*/ + ERROR_4("CONNECTOR-MGMT-4"), + + /** Forbidden to create more instances than the maximum allowed*/ + ERROR_5("CONNECTOR-MGMT-5"), + + /** An entity with the specified unique values already exists*/ + ERROR_6("CONNECTOR-MGMT-6"), + + /** Resource not found*/ + ERROR_7("CONNECTOR-MGMT-7"), + + /** General validation failure*/ + ERROR_8("CONNECTOR-MGMT-8"), + + /** Unspecified error*/ + ERROR_9("CONNECTOR-MGMT-9"), + + /** HTTP Method not implemented for this endpoint*/ + ERROR_10("CONNECTOR-MGMT-10"), + + /** Account is unauthorized to perform this action*/ + ERROR_11("CONNECTOR-MGMT-11"), + + /** Required terms have not been accepted*/ + ERROR_12("CONNECTOR-MGMT-12"), + + /** Account authentication could not be verified*/ + ERROR_15("CONNECTOR-MGMT-15"), + + /** Unable to read request body*/ + ERROR_17("CONNECTOR-MGMT-17"), + + /** Bad request*/ + ERROR_21("CONNECTOR-MGMT-21"), + + /** Failed to parse search query*/ + ERROR_23("CONNECTOR-MGMT-23"), + + /** The maximum number of allowed kafka instances has been reached*/ + ERROR_24("CONNECTOR-MGMT-24"), + + /** Resource gone*/ + ERROR_25("CONNECTOR-MGMT-25"), + + /** Provider not supported*/ + ERROR_30("CONNECTOR-MGMT-30"), + + /** Region not supported*/ + ERROR_31("CONNECTOR-MGMT-31"), + + /** Kafka cluster name is invalid*/ + ERROR_32("CONNECTOR-MGMT-32"), + + /** Minimum field length not reached*/ + ERROR_33("CONNECTOR-MGMT-33"), + + /** Maximum field length has been depassed*/ + ERROR_34("CONNECTOR-MGMT-34"), + + /** Only multiAZ Kafkas are supported, use multi_az=true*/ + ERROR_35("CONNECTOR-MGMT-35"), + + /** Kafka cluster name is already used*/ + ERROR_36("CONNECTOR-MGMT-36"), + + /** Field validation failed*/ + ERROR_37("CONNECTOR-MGMT-37"), + + /** Service account name is invalid*/ + ERROR_38("CONNECTOR-MGMT-38"), + + /** Service account desc is invalid*/ + ERROR_39("CONNECTOR-MGMT-39"), + + /** Service account id is invalid*/ + ERROR_40("CONNECTOR-MGMT-40"), + + /** Instance Type not supported*/ + ERROR_41("CONNECTOR-MGMT-41"), + + /** Synchronous action is not supported, use async=true parameter*/ + ERROR_103("CONNECTOR-MGMT-103"), + + /** Failed to create kafka client in the mas sso*/ + ERROR_106("CONNECTOR-MGMT-106"), + + /** Failed to get kafka client secret from the mas sso*/ + ERROR_107("CONNECTOR-MGMT-107"), + + /** Failed to get kafka client from the mas sso*/ + ERROR_108("CONNECTOR-MGMT-108"), + + /** Failed to delete kafka client from the mas sso*/ + ERROR_109("CONNECTOR-MGMT-109"), + + /** Failed to create service account*/ + ERROR_110("CONNECTOR-MGMT-110"), + + /** Failed to get service account*/ + ERROR_111("CONNECTOR-MGMT-111"), + + /** Failed to delete service account*/ + ERROR_112("CONNECTOR-MGMT-112"), + + /** Failed to find service account*/ + ERROR_113("CONNECTOR-MGMT-113"), + + /** Insufficient quota*/ + ERROR_120("CONNECTOR-MGMT-120"), + + /** Failed to check quota*/ + ERROR_121("CONNECTOR-MGMT-121"), + + /** Too Many requests*/ + ERROR_429("CONNECTOR-MGMT-429"), + + /** An unexpected error happened, please check the log of the service for details*/ + ERROR_1000("CONNECTOR-MGMT-1000"); + + + + private String value; + + ApiErrorType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ApiErrorType fromValue(String value) { + for (ApiErrorType b : ApiErrorType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/ApiErrorType.java b/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/ApiErrorType.java new file mode 100644 index 00000000..8e9746c8 --- /dev/null +++ b/packages/kafka-management-sdk/src/main/java/com/openshift/cloud/api/kas/ApiErrorType.java @@ -0,0 +1,159 @@ +package com.openshift.cloud.api.kas; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Contains the possible error codes returned by API + */ +public enum ApiErrorType { + + /** Forbidden to perform this action*/ + ERROR_4("KAFKAS-MGMT-4"), + + /** Forbidden to create more instances than the maximum allowed*/ + ERROR_5("KAFKAS-MGMT-5"), + + /** An entity with the specified unique values already exists*/ + ERROR_6("KAFKAS-MGMT-6"), + + /** Resource not found*/ + ERROR_7("KAFKAS-MGMT-7"), + + /** General validation failure*/ + ERROR_8("KAFKAS-MGMT-8"), + + /** Unspecified error*/ + ERROR_9("KAFKAS-MGMT-9"), + + /** HTTP Method not implemented for this endpoint*/ + ERROR_10("KAFKAS-MGMT-10"), + + /** Account is unauthorized to perform this action*/ + ERROR_11("KAFKAS-MGMT-11"), + + /** Required terms have not been accepted*/ + ERROR_12("KAFKAS-MGMT-12"), + + /** Account authentication could not be verified*/ + ERROR_15("KAFKAS-MGMT-15"), + + /** Unable to read request body*/ + ERROR_17("KAFKAS-MGMT-17"), + + /** Bad request*/ + ERROR_21("KAFKAS-MGMT-21"), + + /** Failed to parse search query*/ + ERROR_23("KAFKAS-MGMT-23"), + + /** The maximum number of allowed kafka instances has been reached*/ + ERROR_24("KAFKAS-MGMT-24"), + + /** Resource gone*/ + ERROR_25("KAFKAS-MGMT-25"), + + /** Provider not supported*/ + ERROR_30("KAFKAS-MGMT-30"), + + /** Region not supported*/ + ERROR_31("KAFKAS-MGMT-31"), + + /** Kafka cluster name is invalid*/ + ERROR_32("KAFKAS-MGMT-32"), + + /** Minimum field length not reached*/ + ERROR_33("KAFKAS-MGMT-33"), + + /** Maximum field length has been depassed*/ + ERROR_34("KAFKAS-MGMT-34"), + + /** Only multiAZ Kafkas are supported, use multi_az=true*/ + ERROR_35("KAFKAS-MGMT-35"), + + /** Kafka cluster name is already used*/ + ERROR_36("KAFKAS-MGMT-36"), + + /** Field validation failed*/ + ERROR_37("KAFKAS-MGMT-37"), + + /** Service account name is invalid*/ + ERROR_38("KAFKAS-MGMT-38"), + + /** Service account desc is invalid*/ + ERROR_39("KAFKAS-MGMT-39"), + + /** Service account id is invalid*/ + ERROR_40("KAFKAS-MGMT-40"), + + /** Instance Type not supported*/ + ERROR_41("KAFKAS-MGMT-41"), + + /** Synchronous action is not supported, use async=true parameter*/ + ERROR_103("KAFKAS-MGMT-103"), + + /** Failed to create kafka client in the mas sso*/ + ERROR_106("KAFKAS-MGMT-106"), + + /** Failed to get kafka client secret from the mas sso*/ + ERROR_107("KAFKAS-MGMT-107"), + + /** Failed to get kafka client from the mas sso*/ + ERROR_108("KAFKAS-MGMT-108"), + + /** Failed to delete kafka client from the mas sso*/ + ERROR_109("KAFKAS-MGMT-109"), + + /** Failed to create service account*/ + ERROR_110("KAFKAS-MGMT-110"), + + /** Failed to get service account*/ + ERROR_111("KAFKAS-MGMT-111"), + + /** Failed to delete service account*/ + ERROR_112("KAFKAS-MGMT-112"), + + /** Failed to find service account*/ + ERROR_113("KAFKAS-MGMT-113"), + + /** Insufficient quota*/ + ERROR_120("KAFKAS-MGMT-120"), + + /** Failed to check quota*/ + ERROR_121("KAFKAS-MGMT-121"), + + /** Too Many requests*/ + ERROR_429("KAFKAS-MGMT-429"), + + /** An unexpected error happened, please check the log of the service for details*/ + ERROR_1000("KAFKAS-MGMT-1000"); + + + + private String value; + + ApiErrorType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ApiErrorType fromValue(String value) { + for (ApiErrorType b : ApiErrorType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/packages/registry-management-sdk/src/main/java/com/openshift/cloud/api/srs/ApiErrorType.java b/packages/registry-management-sdk/src/main/java/com/openshift/cloud/api/srs/ApiErrorType.java new file mode 100644 index 00000000..dd937c40 --- /dev/null +++ b/packages/registry-management-sdk/src/main/java/com/openshift/cloud/api/srs/ApiErrorType.java @@ -0,0 +1,69 @@ +package com.openshift.cloud.api.srs; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Contains the possible error codes returned by API + */ +public enum ApiErrorType { + + /** Unspecified error*/ + ERROR_1("SRS-MGMT-1"), + + /** Registry with id='?' not found*/ + ERROR_2("SRS-MGMT-2"), + + /** Bad date or time format*/ + ERROR_3("SRS-MGMT-3"), + + /** Invalid request content. Make sure the request conforms to the given JSON schema*/ + ERROR_4("SRS-MGMT-4"), + + /** Bad request format - invalid JSON*/ + ERROR_5("SRS-MGMT-5"), + + /** Required terms have not been accepted for account id='?'*/ + ERROR_6("SRS-MGMT-6"), + + /** The maximum number of allowed Registry instances has been reached*/ + ERROR_7("SRS-MGMT-7"), + + /** Error type with id='?' not found*/ + ERROR_8("SRS-MGMT-8"), + + /** Data conflict. Make sure a Registry with the given name does not already exist*/ + ERROR_9("SRS-MGMT-9"), + + /** Bad request format - unsupported media type*/ + ERROR_10("SRS-MGMT-10"); + + + + private String value; + + ApiErrorType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ApiErrorType fromValue(String value) { + for (ApiErrorType b : ApiErrorType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} +