From faadfe2734ba790df3ddaf63b8b89b8f44a33a4e Mon Sep 17 00:00:00 2001 From: rusirijayodaillesinghe Date: Fri, 5 Jul 2024 15:21:04 +0530 Subject: [PATCH] Modify integration tests based on the change to facilitate having the same alias for production and sandbox key types --- .../publisher-api.yaml.sha256 | 2 +- .../clients/publisher/api/openapi.yaml | 672 ++++++++- .../publisher/docs/ClientCertMetadataDTO.md | 1 - .../publisher/docs/ClientCertificatesApi.md | 470 ++++++- .../api/v1/ClientCertificatesApi.java | 1241 ++++++++++++++--- .../api/v1/dto/ClientCertMetadataDTO.java | 33 +- .../src/main/resources/publisher-api.yaml | 348 ++++- .../test/impl/RestAPIPublisherImpl.java | 4 +- 8 files changed, 2511 insertions(+), 260 deletions(-) diff --git a/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 b/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 index 001627b42a..c5df44d193 100644 --- a/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 +++ b/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 @@ -1 +1 @@ -44e1db981270b033c54cda9c9d6c3e111c1cf6c1ec1529f7d72d47a4564f3ffa \ No newline at end of file +f22432a7f6a2e79f6244e9360787b60d17a9169f9e91d69368ce8fd2a139ba5d \ No newline at end of file diff --git a/modules/integration/tests-common/clients/publisher/api/openapi.yaml b/modules/integration/tests-common/clients/publisher/api/openapi.yaml index af590a66fc..2dfe0b6820 100644 --- a/modules/integration/tests-common/clients/publisher/api/openapi.yaml +++ b/modules/integration/tests-common/clients/publisher/api/openapi.yaml @@ -8375,8 +8375,595 @@ paths: tier: description: api tier to which the certificate should be applied. type: string - keyType: - description: key type to which the certificate should be applied. + required: + - alias + - certificate + - tier + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertMetadata' + description: | + OK. + The Certificate added successfully. + headers: + Location: + description: | + The URL of the newly created resource. + explode: false + schema: + type: string + style: simple + Content-Type: + description: | + The content type of the body. + explode: false + schema: + type: string + style: simple + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_create + - apim:api_manage + - apim:client_certificates_add + - apim:client_certificates_manage + summary: Upload a New Certificate + tags: + - Client Certificates + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon + -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates"' + x-contentType: multipart/form-data + x-accepts: application/json + /apis/{apiId}/client-certificates/{alias}: + delete: + description: | + This operation can be used to delete an uploaded certificate. + operationId: deleteAPIClientCertificateByAlias + parameters: + - description: | + The alias of the certificate that should be deleted. + explode: false + in: path + name: alias + required: true + schema: + type: string + style: simple + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + responses: + "200": + content: {} + description: | + OK. + The Certificate deleted successfully. + headers: + Content-Type: + description: | + The content type of the body. + explode: false + schema: + type: string + style: simple + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_create + - apim:api_manage + - apim:client_certificates_update + summary: Delete a Certificate + tags: + - Client Certificates + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + x-accepts: application/json + get: + description: | + This operation can be used to get the information about a certificate. + operationId: getAPIClientCertificateByAlias + parameters: + - explode: false + in: path + name: alias + required: true + schema: + type: string + style: simple + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateInfo' + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + explode: false + schema: + type: string + style: simple + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_view + - apim:api_manage + - apim:client_certificates_view + - apim:client_certificates_manage + summary: Get the Certificate Information + tags: + - Client Certificates + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + x-accepts: application/json + put: + description: | + This operation can be used to update an uploaded certificate. + operationId: updateAPIClientCertificateByAlias + parameters: + - description: Alias for the certificate + explode: false + in: path + name: alias + required: true + schema: + maxLength: 30 + minLength: 1 + type: string + style: simple + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + schema: + properties: + certificate: + description: The certificate that needs to be uploaded. + format: binary + type: string + tier: + description: The tier of the certificate + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertMetadata' + description: | + OK. + The Certificate updated successfully. + headers: + Location: + description: | + The URL of the newly created resource. + explode: false + schema: + type: string + style: simple + Content-Type: + description: | + The content type of the body. + explode: false + schema: + type: string + style: simple + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_create + - apim:api_manage + - apim:client_certificates_update + - apim:client_certificates_manage + summary: Update a Certificate + tags: + - Client Certificates + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon + -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + x-contentType: multipart/form-data + x-accepts: application/json + /apis/{apiId}/client-certificates/{alias}/content: + get: + description: | + This operation can be used to download a certificate which matches the given alias. + operationId: getAPIClientCertificateContentByAlias + parameters: + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: alias + required: true + schema: + type: string + style: simple + responses: + "200": + content: {} + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + explode: false + schema: + type: string + style: simple + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_view + - apim:api_manage + - apim:client_certificates_view + - apim:client_certificates_manage + summary: Download a Certificate + tags: + - Client Certificates + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon/content"' + x-accepts: application/json + /apis/{apiId}/client-certs/{keyType}: + get: + description: | + This operation can be used to retrieve and search the uploaded client certificates of a given key type. + operationId: getAPIClientCertificatesByKeyType + parameters: + - description: Key type for the certificate + explode: false + in: path + name: keyType + required: true + schema: + type: string + style: simple + - description: | + Maximum size of resource array to return. + explode: true + in: query + name: limit + required: false + schema: + default: 25 + type: integer + style: form + - description: | + Starting point within the complete list of items qualified. + explode: true + in: query + name: offset + required: false + schema: + default: 0 + type: integer + style: form + - description: Alias for the client certificate + explode: true + in: query + name: alias + required: false + schema: + type: string + style: form + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertificates' + description: | + OK. Successful response with the list of matching certificate information in the body. + headers: + Content-Type: + description: | + The content type of the body. + explode: false + schema: + type: string + style: simple + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_view + - apim:api_manage + - apim:client_certificates_view + - apim:client_certificates_manage + summary: Retrieve/ Search Uploaded Client Certificates of a given key type + tags: + - Client Certificates + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION?alias=wso2carbon"' + x-accepts: application/json + post: + description: | + This operation can be used to upload a new certificate for an endpoint of the given type. + operationId: addAPIClientCertificateOfGivenKeyType + parameters: + - description: Key type for the certificate + explode: false + in: path + name: keyType + required: true + schema: + type: string + style: simple + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + requestBody: + content: + multipart/form-data: + schema: + properties: + certificate: + description: The certificate that needs to be uploaded. + format: binary + type: string + alias: + description: Alias for the certificate + maxLength: 30 + minLength: 1 + type: string + tier: + description: API tier to which the certificate should be applied. type: string required: - alias @@ -8438,22 +9025,30 @@ paths: - apim:api_manage - apim:client_certificates_add - apim:client_certificates_manage - summary: Upload a New Certificate + summary: Upload a New Certificate of the given key type tags: - Client Certificates x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon - -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates"' + -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION"' x-contentType: multipart/form-data x-accepts: application/json - /apis/{apiId}/client-certificates/{alias}: + /apis/{apiId}/client-certs/{keyType}/{alias}: delete: description: | - This operation can be used to delete an uploaded certificate. - operationId: deleteAPIClientCertificateByAlias + This operation can be used to delete an uploaded certificate of a given key type. + operationId: deleteAPIClientCertificateByKeyTypeAndAlias parameters: + - description: Key type for the certificate + explode: false + in: path + name: keyType + required: true + schema: + type: string + style: simple - description: | The alias of the certificate that should be deleted. explode: false @@ -8528,7 +9123,7 @@ paths: - apim:api_create - apim:api_manage - apim:client_certificates_update - summary: Delete a Certificate + summary: Delete a Certificate of a Given Key Type tags: - Client Certificates x-code-samples: @@ -8538,9 +9133,17 @@ paths: x-accepts: application/json get: description: | - This operation can be used to get the information about a certificate. - operationId: getAPIClientCertificateByAlias + This operation can be used to get the information about a certificate of a given key type. + operationId: getAPIClientCertificateByKeyTypeAndAlias parameters: + - description: Key type for the certificate + explode: false + in: path + name: keyType + required: true + schema: + type: string + style: simple - explode: false in: path name: alias @@ -8616,19 +9219,27 @@ paths: - apim:api_manage - apim:client_certificates_view - apim:client_certificates_manage - summary: Get the Certificate Information + summary: Get the Certificate Information of a Given Key Type tags: - Client Certificates x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION/wso2carbon"' x-accepts: application/json put: description: | - This operation can be used to update an uploaded certificate. - operationId: updateAPIClientCertificateByAlias + This operation can be used to update an uploaded certificate of a given key type. + operationId: updateAPIClientCertificateByKeyTypeAndAlias parameters: + - description: Key type for the certificate + explode: false + in: path + name: keyType + required: true + schema: + type: string + style: simple - description: Alias for the certificate explode: false in: path @@ -8660,9 +9271,6 @@ paths: tier: description: The tier of the certificate type: string - keyType: - description: The key type of the certificate - type: string responses: "200": content: @@ -8730,21 +9338,21 @@ paths: - apim:api_manage - apim:client_certificates_update - apim:client_certificates_manage - summary: Update a Certificate + summary: Update a Certificate of a Given Key Type tags: - Client Certificates x-code-samples: - lang: Curl source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon - -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION/wso2carbon"' x-contentType: multipart/form-data x-accepts: application/json - /apis/{apiId}/client-certificates/{alias}/content: + /apis/{apiId}/client-certs/{keyType}/{alias}/content: get: description: | - This operation can be used to download a certificate which matches the given alias. - operationId: getAPIClientCertificateContentByAlias + This operation can be used to download a certificate which matches the given alias and key type. + operationId: getAPIClientCertificateContentByKeyTypeAndAlias parameters: - description: | **API ID** consisting of the **UUID** of the API. @@ -8762,6 +9370,15 @@ paths: schema: type: string style: simple + - description: | + The key type of the certificate that should be deleted. + explode: false + in: path + name: keyType + required: true + schema: + type: string + style: simple responses: "200": content: {} @@ -8818,13 +9435,14 @@ paths: - apim:api_manage - apim:client_certificates_view - apim:client_certificates_manage - summary: Download a Certificate + summary: Download a Certificate of Given Key Type tags: - Client Certificates x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon/content"' + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION/wso2carbon/content" + > test.crt' x-accepts: application/json /endpoint-certificates: get: @@ -19802,11 +20420,9 @@ components: certificates: - tier: Gold alias: wso2carbon - keyType: PRODUCTION apiId: 64eca60b-2e55-4c38-8603-e9e6bad7d809 - tier: Gold alias: wso2carbon - keyType: PRODUCTION apiId: 64eca60b-2e55-4c38-8603-e9e6bad7d809 count: 1 properties: @@ -19826,7 +20442,6 @@ components: example: tier: Gold alias: wso2carbon - keyType: PRODUCTION apiId: 64eca60b-2e55-4c38-8603-e9e6bad7d809 properties: alias: @@ -19838,9 +20453,6 @@ components: tier: example: Gold type: string - keyType: - default: PRODUCTION - type: string title: Client certificate meta data type: object LifecycleState: diff --git a/modules/integration/tests-common/clients/publisher/docs/ClientCertMetadataDTO.md b/modules/integration/tests-common/clients/publisher/docs/ClientCertMetadataDTO.md index 27278434cb..08e52569cb 100644 --- a/modules/integration/tests-common/clients/publisher/docs/ClientCertMetadataDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/ClientCertMetadataDTO.md @@ -10,7 +10,6 @@ Name | Type | Description | Notes **alias** | **String** | | [optional] **apiId** | **String** | | [optional] **tier** | **String** | | [optional] -**keyType** | **String** | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/ClientCertificatesApi.md b/modules/integration/tests-common/clients/publisher/docs/ClientCertificatesApi.md index df7e327206..1d440bcd11 100644 --- a/modules/integration/tests-common/clients/publisher/docs/ClientCertificatesApi.md +++ b/modules/integration/tests-common/clients/publisher/docs/ClientCertificatesApi.md @@ -5,16 +5,22 @@ All URIs are relative to *https://apis.wso2.com/api/am/publisher/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**addAPIClientCertificate**](ClientCertificatesApi.md#addAPIClientCertificate) | **POST** /apis/{apiId}/client-certificates | Upload a New Certificate +[**addAPIClientCertificateOfGivenKeyType**](ClientCertificatesApi.md#addAPIClientCertificateOfGivenKeyType) | **POST** /apis/{apiId}/client-certs/{keyType} | Upload a New Certificate of the given key type [**deleteAPIClientCertificateByAlias**](ClientCertificatesApi.md#deleteAPIClientCertificateByAlias) | **DELETE** /apis/{apiId}/client-certificates/{alias} | Delete a Certificate +[**deleteAPIClientCertificateByKeyTypeAndAlias**](ClientCertificatesApi.md#deleteAPIClientCertificateByKeyTypeAndAlias) | **DELETE** /apis/{apiId}/client-certs/{keyType}/{alias} | Delete a Certificate of a Given Key Type [**getAPIClientCertificateByAlias**](ClientCertificatesApi.md#getAPIClientCertificateByAlias) | **GET** /apis/{apiId}/client-certificates/{alias} | Get the Certificate Information +[**getAPIClientCertificateByKeyTypeAndAlias**](ClientCertificatesApi.md#getAPIClientCertificateByKeyTypeAndAlias) | **GET** /apis/{apiId}/client-certs/{keyType}/{alias} | Get the Certificate Information of a Given Key Type [**getAPIClientCertificateContentByAlias**](ClientCertificatesApi.md#getAPIClientCertificateContentByAlias) | **GET** /apis/{apiId}/client-certificates/{alias}/content | Download a Certificate +[**getAPIClientCertificateContentByKeyTypeAndAlias**](ClientCertificatesApi.md#getAPIClientCertificateContentByKeyTypeAndAlias) | **GET** /apis/{apiId}/client-certs/{keyType}/{alias}/content | Download a Certificate of Given Key Type [**getAPIClientCertificates**](ClientCertificatesApi.md#getAPIClientCertificates) | **GET** /apis/{apiId}/client-certificates | Retrieve/ Search Uploaded Client Certificates +[**getAPIClientCertificatesByKeyType**](ClientCertificatesApi.md#getAPIClientCertificatesByKeyType) | **GET** /apis/{apiId}/client-certs/{keyType} | Retrieve/ Search Uploaded Client Certificates of a given key type [**updateAPIClientCertificateByAlias**](ClientCertificatesApi.md#updateAPIClientCertificateByAlias) | **PUT** /apis/{apiId}/client-certificates/{alias} | Update a Certificate +[**updateAPIClientCertificateByKeyTypeAndAlias**](ClientCertificatesApi.md#updateAPIClientCertificateByKeyTypeAndAlias) | **PUT** /apis/{apiId}/client-certs/{keyType}/{alias} | Update a Certificate of a Given Key Type # **addAPIClientCertificate** -> ClientCertMetadataDTO addAPIClientCertificate(apiId, certificate, alias, tier, keyType) +> ClientCertMetadataDTO addAPIClientCertificate(apiId, certificate, alias, tier) Upload a New Certificate @@ -44,9 +50,8 @@ public class Example { File certificate = new File("/path/to/file"); // File | The certificate that needs to be uploaded. String alias = "alias_example"; // String | Alias for the certificate String tier = "tier_example"; // String | api tier to which the certificate should be applied. - String keyType = "keyType_example"; // String | key type to which the certificate should be applied. try { - ClientCertMetadataDTO result = apiInstance.addAPIClientCertificate(apiId, certificate, alias, tier, keyType); + ClientCertMetadataDTO result = apiInstance.addAPIClientCertificate(apiId, certificate, alias, tier); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ClientCertificatesApi#addAPIClientCertificate"); @@ -67,7 +72,83 @@ Name | Type | Description | Notes **certificate** | **File**| The certificate that needs to be uploaded. | **alias** | **String**| Alias for the certificate | **tier** | **String**| api tier to which the certificate should be applied. | - **keyType** | **String**| key type to which the certificate should be applied. | [optional] + +### Return type + +[**ClientCertMetadataDTO**](ClientCertMetadataDTO.md) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. The Certificate added successfully. | * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
| +**400** | Bad Request. Invalid request or validation error. | - | +**500** | Internal Server Error. | - | + + +# **addAPIClientCertificateOfGivenKeyType** +> ClientCertMetadataDTO addAPIClientCertificateOfGivenKeyType(keyType, apiId, certificate, alias, tier) + +Upload a New Certificate of the given key type + +This operation can be used to upload a new certificate for an endpoint of the given type. + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ClientCertificatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v4"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ClientCertificatesApi apiInstance = new ClientCertificatesApi(defaultClient); + String keyType = "keyType_example"; // String | Key type for the certificate + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + File certificate = new File("/path/to/file"); // File | The certificate that needs to be uploaded. + String alias = "alias_example"; // String | Alias for the certificate + String tier = "tier_example"; // String | API tier to which the certificate should be applied. + try { + ClientCertMetadataDTO result = apiInstance.addAPIClientCertificateOfGivenKeyType(keyType, apiId, certificate, alias, tier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ClientCertificatesApi#addAPIClientCertificateOfGivenKeyType"); + 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 +------------- | ------------- | ------------- | ------------- + **keyType** | **String**| Key type for the certificate | + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + **certificate** | **File**| The certificate that needs to be uploaded. | + **alias** | **String**| Alias for the certificate | + **tier** | **String**| API tier to which the certificate should be applied. | ### Return type @@ -160,6 +241,79 @@ null (empty response body) **404** | Not Found. The specified resource does not exist. | - | **500** | Internal Server Error. | - | + +# **deleteAPIClientCertificateByKeyTypeAndAlias** +> deleteAPIClientCertificateByKeyTypeAndAlias(keyType, alias, apiId) + +Delete a Certificate of a Given Key Type + +This operation can be used to delete an uploaded certificate of a given key type. + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ClientCertificatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v4"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ClientCertificatesApi apiInstance = new ClientCertificatesApi(defaultClient); + String keyType = "keyType_example"; // String | Key type for the certificate + String alias = "alias_example"; // String | The alias of the certificate that should be deleted. + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + try { + apiInstance.deleteAPIClientCertificateByKeyTypeAndAlias(keyType, alias, apiId); + } catch (ApiException e) { + System.err.println("Exception when calling ClientCertificatesApi#deleteAPIClientCertificateByKeyTypeAndAlias"); + 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 +------------- | ------------- | ------------- | ------------- + **keyType** | **String**| Key type for the certificate | + **alias** | **String**| The alias of the certificate that should be deleted. | + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. The Certificate deleted successfully. | * Content-Type - The content type of the body.
| +**400** | Bad Request. Invalid request or validation error. | - | +**404** | Not Found. The specified resource does not exist. | - | +**500** | Internal Server Error. | - | + # **getAPIClientCertificateByAlias** > CertificateInfoDTO getAPIClientCertificateByAlias(alias, apiId) @@ -232,6 +386,80 @@ Name | Type | Description | Notes **404** | Not Found. The specified resource does not exist. | - | **500** | Internal Server Error. | - | + +# **getAPIClientCertificateByKeyTypeAndAlias** +> CertificateInfoDTO getAPIClientCertificateByKeyTypeAndAlias(keyType, alias, apiId) + +Get the Certificate Information of a Given Key Type + +This operation can be used to get the information about a certificate of a given key type. + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ClientCertificatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v4"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ClientCertificatesApi apiInstance = new ClientCertificatesApi(defaultClient); + String keyType = "keyType_example"; // String | Key type for the certificate + String alias = "alias_example"; // String | + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + try { + CertificateInfoDTO result = apiInstance.getAPIClientCertificateByKeyTypeAndAlias(keyType, alias, apiId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ClientCertificatesApi#getAPIClientCertificateByKeyTypeAndAlias"); + 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 +------------- | ------------- | ------------- | ------------- + **keyType** | **String**| Key type for the certificate | + **alias** | **String**| | + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + +### Return type + +[**CertificateInfoDTO**](CertificateInfoDTO.md) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. | * Content-Type - The content type of the body.
| +**400** | Bad Request. Invalid request or validation error. | - | +**404** | Not Found. The specified resource does not exist. | - | +**500** | Internal Server Error. | - | + # **getAPIClientCertificateContentByAlias** > getAPIClientCertificateContentByAlias(apiId, alias) @@ -303,6 +531,79 @@ null (empty response body) **404** | Not Found. The specified resource does not exist. | - | **500** | Internal Server Error. | - | + +# **getAPIClientCertificateContentByKeyTypeAndAlias** +> getAPIClientCertificateContentByKeyTypeAndAlias(apiId, alias, keyType) + +Download a Certificate of Given Key Type + +This operation can be used to download a certificate which matches the given alias and key type. + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ClientCertificatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v4"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ClientCertificatesApi apiInstance = new ClientCertificatesApi(defaultClient); + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + String alias = "alias_example"; // String | + String keyType = "keyType_example"; // String | The key type of the certificate that should be deleted. + try { + apiInstance.getAPIClientCertificateContentByKeyTypeAndAlias(apiId, alias, keyType); + } catch (ApiException e) { + System.err.println("Exception when calling ClientCertificatesApi#getAPIClientCertificateContentByKeyTypeAndAlias"); + 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 +------------- | ------------- | ------------- | ------------- + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + **alias** | **String**| | + **keyType** | **String**| The key type of the certificate that should be deleted. | + +### Return type + +null (empty response body) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. | * Content-Type - The content type of the body.
| +**400** | Bad Request. Invalid request or validation error. | - | +**404** | Not Found. The specified resource does not exist. | - | +**500** | Internal Server Error. | - | + # **getAPIClientCertificates** > ClientCertificatesDTO getAPIClientCertificates(apiId, limit, offset, alias) @@ -378,9 +679,86 @@ Name | Type | Description | Notes **400** | Bad Request. Invalid request or validation error. | - | **500** | Internal Server Error. | - | + +# **getAPIClientCertificatesByKeyType** +> ClientCertificatesDTO getAPIClientCertificatesByKeyType(keyType, apiId, limit, offset, alias) + +Retrieve/ Search Uploaded Client Certificates of a given key type + +This operation can be used to retrieve and search the uploaded client certificates of a given key type. + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ClientCertificatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v4"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ClientCertificatesApi apiInstance = new ClientCertificatesApi(defaultClient); + String keyType = "keyType_example"; // String | Key type for the certificate + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + Integer limit = 25; // Integer | Maximum size of resource array to return. + Integer offset = 0; // Integer | Starting point within the complete list of items qualified. + String alias = "alias_example"; // String | Alias for the client certificate + try { + ClientCertificatesDTO result = apiInstance.getAPIClientCertificatesByKeyType(keyType, apiId, limit, offset, alias); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ClientCertificatesApi#getAPIClientCertificatesByKeyType"); + 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 +------------- | ------------- | ------------- | ------------- + **keyType** | **String**| Key type for the certificate | + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + **limit** | **Integer**| Maximum size of resource array to return. | [optional] [default to 25] + **offset** | **Integer**| Starting point within the complete list of items qualified. | [optional] [default to 0] + **alias** | **String**| Alias for the client certificate | [optional] + +### Return type + +[**ClientCertificatesDTO**](ClientCertificatesDTO.md) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. Successful response with the list of matching certificate information in the body. | * Content-Type - The content type of the body.
| +**400** | Bad Request. Invalid request or validation error. | - | +**500** | Internal Server Error. | - | + # **updateAPIClientCertificateByAlias** -> ClientCertMetadataDTO updateAPIClientCertificateByAlias(alias, apiId, certificate, tier, keyType) +> ClientCertMetadataDTO updateAPIClientCertificateByAlias(alias, apiId, certificate, tier) Update a Certificate @@ -410,9 +788,8 @@ public class Example { String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. File certificate = new File("/path/to/file"); // File | The certificate that needs to be uploaded. String tier = "tier_example"; // String | The tier of the certificate - String keyType = "keyType_example"; // String | The key type of the certificate try { - ClientCertMetadataDTO result = apiInstance.updateAPIClientCertificateByAlias(alias, apiId, certificate, tier, keyType); + ClientCertMetadataDTO result = apiInstance.updateAPIClientCertificateByAlias(alias, apiId, certificate, tier); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ClientCertificatesApi#updateAPIClientCertificateByAlias"); @@ -433,7 +810,84 @@ Name | Type | Description | Notes **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | **certificate** | **File**| The certificate that needs to be uploaded. | [optional] **tier** | **String**| The tier of the certificate | [optional] - **keyType** | **String**| The key type of the certificate | [optional] + +### Return type + +[**ClientCertMetadataDTO**](ClientCertMetadataDTO.md) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. The Certificate updated successfully. | * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
| +**400** | Bad Request. Invalid request or validation error. | - | +**404** | Not Found. The specified resource does not exist. | - | +**500** | Internal Server Error. | - | + + +# **updateAPIClientCertificateByKeyTypeAndAlias** +> ClientCertMetadataDTO updateAPIClientCertificateByKeyTypeAndAlias(keyType, alias, apiId, certificate, tier) + +Update a Certificate of a Given Key Type + +This operation can be used to update an uploaded certificate of a given key type. + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ClientCertificatesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v4"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ClientCertificatesApi apiInstance = new ClientCertificatesApi(defaultClient); + String keyType = "keyType_example"; // String | Key type for the certificate + String alias = "alias_example"; // String | Alias for the certificate + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + File certificate = new File("/path/to/file"); // File | The certificate that needs to be uploaded. + String tier = "tier_example"; // String | The tier of the certificate + try { + ClientCertMetadataDTO result = apiInstance.updateAPIClientCertificateByKeyTypeAndAlias(keyType, alias, apiId, certificate, tier); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ClientCertificatesApi#updateAPIClientCertificateByKeyTypeAndAlias"); + 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 +------------- | ------------- | ------------- | ------------- + **keyType** | **String**| Key type for the certificate | + **alias** | **String**| Alias for the certificate | + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + **certificate** | **File**| The certificate that needs to be uploaded. | [optional] + **tier** | **String**| The tier of the certificate | [optional] ### Return type diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java index 02b62748fb..9067e74037 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java @@ -64,7 +64,6 @@ public void setApiClient(ApiClient apiClient) { * @param certificate The certificate that needs to be uploaded. (required) * @param alias Alias for the certificate (required) * @param tier api tier to which the certificate should be applied. (required) - * @param keyType key type to which the certificate should be applied. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -76,7 +75,7 @@ public void setApiClient(ApiClient apiClient) { 500 Internal Server Error. - */ - public okhttp3.Call addAPIClientCertificateCall(String apiId, File certificate, String alias, String tier, String keyType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addAPIClientCertificateCall(String apiId, File certificate, String alias, String tier, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -100,10 +99,6 @@ public okhttp3.Call addAPIClientCertificateCall(String apiId, File certificate, localVarFormParams.put("tier", tier); } - if (keyType != null) { - localVarFormParams.put("keyType", keyType); - } - final String[] localVarAccepts = { "application/json" }; @@ -123,7 +118,7 @@ public okhttp3.Call addAPIClientCertificateCall(String apiId, File certificate, } @SuppressWarnings("rawtypes") - private okhttp3.Call addAPIClientCertificateValidateBeforeCall(String apiId, File certificate, String alias, String tier, String keyType, final ApiCallback _callback) throws ApiException { + private okhttp3.Call addAPIClientCertificateValidateBeforeCall(String apiId, File certificate, String alias, String tier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'apiId' is set if (apiId == null) { @@ -146,7 +141,7 @@ private okhttp3.Call addAPIClientCertificateValidateBeforeCall(String apiId, Fil } - okhttp3.Call localVarCall = addAPIClientCertificateCall(apiId, certificate, alias, tier, keyType, _callback); + okhttp3.Call localVarCall = addAPIClientCertificateCall(apiId, certificate, alias, tier, _callback); return localVarCall; } @@ -158,7 +153,6 @@ private okhttp3.Call addAPIClientCertificateValidateBeforeCall(String apiId, Fil * @param certificate The certificate that needs to be uploaded. (required) * @param alias Alias for the certificate (required) * @param tier api tier to which the certificate should be applied. (required) - * @param keyType key type to which the certificate should be applied. (optional) * @return ClientCertMetadataDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -169,8 +163,8 @@ private okhttp3.Call addAPIClientCertificateValidateBeforeCall(String apiId, Fil 500 Internal Server Error. - */ - public ClientCertMetadataDTO addAPIClientCertificate(String apiId, File certificate, String alias, String tier, String keyType) throws ApiException { - ApiResponse localVarResp = addAPIClientCertificateWithHttpInfo(apiId, certificate, alias, tier, keyType); + public ClientCertMetadataDTO addAPIClientCertificate(String apiId, File certificate, String alias, String tier) throws ApiException { + ApiResponse localVarResp = addAPIClientCertificateWithHttpInfo(apiId, certificate, alias, tier); return localVarResp.getData(); } @@ -181,7 +175,6 @@ public ClientCertMetadataDTO addAPIClientCertificate(String apiId, File certific * @param certificate The certificate that needs to be uploaded. (required) * @param alias Alias for the certificate (required) * @param tier api tier to which the certificate should be applied. (required) - * @param keyType key type to which the certificate should be applied. (optional) * @return ApiResponse<ClientCertMetadataDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -192,8 +185,8 @@ public ClientCertMetadataDTO addAPIClientCertificate(String apiId, File certific 500 Internal Server Error. - */ - public ApiResponse addAPIClientCertificateWithHttpInfo(String apiId, File certificate, String alias, String tier, String keyType) throws ApiException { - okhttp3.Call localVarCall = addAPIClientCertificateValidateBeforeCall(apiId, certificate, alias, tier, keyType, null); + public ApiResponse addAPIClientCertificateWithHttpInfo(String apiId, File certificate, String alias, String tier) throws ApiException { + okhttp3.Call localVarCall = addAPIClientCertificateValidateBeforeCall(apiId, certificate, alias, tier, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -205,7 +198,6 @@ public ApiResponse addAPIClientCertificateWithHttpInfo(St * @param certificate The certificate that needs to be uploaded. (required) * @param alias Alias for the certificate (required) * @param tier api tier to which the certificate should be applied. (required) - * @param keyType key type to which the certificate should be applied. (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 @@ -217,35 +209,37 @@ public ApiResponse addAPIClientCertificateWithHttpInfo(St 500 Internal Server Error. - */ - public okhttp3.Call addAPIClientCertificateAsync(String apiId, File certificate, String alias, String tier, String keyType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addAPIClientCertificateAsync(String apiId, File certificate, String alias, String tier, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = addAPIClientCertificateValidateBeforeCall(apiId, certificate, alias, tier, keyType, _callback); + okhttp3.Call localVarCall = addAPIClientCertificateValidateBeforeCall(apiId, certificate, alias, tier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for deleteAPIClientCertificateByAlias - * @param alias The alias of the certificate that should be deleted. (required) + * Build call for addAPIClientCertificateOfGivenKeyType + * @param keyType Key type for the certificate (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (required) + * @param alias Alias for the certificate (required) + * @param tier API tier to which the certificate should be applied. (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 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
200 OK. The Certificate added successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call deleteAPIClientCertificateByAliasCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addAPIClientCertificateOfGivenKeyTypeCall(String keyType, String apiId, File certificate, String alias, String tier, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apis/{apiId}/client-certificates/{alias}" - .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())) + String localVarPath = "/apis/{apiId}/client-certs/{keyType}" + .replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString())) .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); List localVarQueryParams = new ArrayList(); @@ -253,6 +247,18 @@ public okhttp3.Call deleteAPIClientCertificateByAliasCall(String alias, String a Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (certificate != null) { + localVarFormParams.put("certificate", certificate); + } + + if (alias != null) { + localVarFormParams.put("alias", alias); + } + + if (tier != null) { + localVarFormParams.put("tier", tier); + } + final String[] localVarAccepts = { "application/json" }; @@ -262,100 +268,125 @@ public okhttp3.Call deleteAPIClientCertificateByAliasCall(String alias, String a } final String[] localVarContentTypes = { - + "multipart/form-data" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAPIClientCertificateByAliasValidateBeforeCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call addAPIClientCertificateOfGivenKeyTypeValidateBeforeCall(String keyType, String apiId, File certificate, String alias, String tier, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'alias' is set - if (alias == null) { - throw new ApiException("Missing the required parameter 'alias' when calling deleteAPIClientCertificateByAlias(Async)"); + // verify the required parameter 'keyType' is set + if (keyType == null) { + throw new ApiException("Missing the required parameter 'keyType' when calling addAPIClientCertificateOfGivenKeyType(Async)"); } // verify the required parameter 'apiId' is set if (apiId == null) { - throw new ApiException("Missing the required parameter 'apiId' when calling deleteAPIClientCertificateByAlias(Async)"); + throw new ApiException("Missing the required parameter 'apiId' when calling addAPIClientCertificateOfGivenKeyType(Async)"); + } + + // verify the required parameter 'certificate' is set + if (certificate == null) { + throw new ApiException("Missing the required parameter 'certificate' when calling addAPIClientCertificateOfGivenKeyType(Async)"); + } + + // verify the required parameter 'alias' is set + if (alias == null) { + throw new ApiException("Missing the required parameter 'alias' when calling addAPIClientCertificateOfGivenKeyType(Async)"); + } + + // verify the required parameter 'tier' is set + if (tier == null) { + throw new ApiException("Missing the required parameter 'tier' when calling addAPIClientCertificateOfGivenKeyType(Async)"); } - okhttp3.Call localVarCall = deleteAPIClientCertificateByAliasCall(alias, apiId, _callback); + okhttp3.Call localVarCall = addAPIClientCertificateOfGivenKeyTypeCall(keyType, apiId, certificate, alias, tier, _callback); return localVarCall; } /** - * Delete a Certificate - * This operation can be used to delete an uploaded certificate. - * @param alias The alias of the certificate that should be deleted. (required) + * Upload a New Certificate of the given key type + * This operation can be used to upload a new certificate for an endpoint of the given type. + * @param keyType Key type for the certificate (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (required) + * @param alias Alias for the certificate (required) + * @param tier API tier to which the certificate should be applied. (required) + * @return ClientCertMetadataDTO * @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 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
200 OK. The Certificate added successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public void deleteAPIClientCertificateByAlias(String alias, String apiId) throws ApiException { - deleteAPIClientCertificateByAliasWithHttpInfo(alias, apiId); + public ClientCertMetadataDTO addAPIClientCertificateOfGivenKeyType(String keyType, String apiId, File certificate, String alias, String tier) throws ApiException { + ApiResponse localVarResp = addAPIClientCertificateOfGivenKeyTypeWithHttpInfo(keyType, apiId, certificate, alias, tier); + return localVarResp.getData(); } /** - * Delete a Certificate - * This operation can be used to delete an uploaded certificate. - * @param alias The alias of the certificate that should be deleted. (required) + * Upload a New Certificate of the given key type + * This operation can be used to upload a new certificate for an endpoint of the given type. + * @param keyType Key type for the certificate (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @return ApiResponse<Void> + * @param certificate The certificate that needs to be uploaded. (required) + * @param alias Alias for the certificate (required) + * @param tier API tier to which the certificate should be applied. (required) + * @return ApiResponse<ClientCertMetadataDTO> * @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 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
200 OK. The Certificate added successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public ApiResponse deleteAPIClientCertificateByAliasWithHttpInfo(String alias, String apiId) throws ApiException { - okhttp3.Call localVarCall = deleteAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, null); - return localVarApiClient.execute(localVarCall); + public ApiResponse addAPIClientCertificateOfGivenKeyTypeWithHttpInfo(String keyType, String apiId, File certificate, String alias, String tier) throws ApiException { + okhttp3.Call localVarCall = addAPIClientCertificateOfGivenKeyTypeValidateBeforeCall(keyType, apiId, certificate, alias, tier, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Delete a Certificate (asynchronously) - * This operation can be used to delete an uploaded certificate. - * @param alias The alias of the certificate that should be deleted. (required) + * Upload a New Certificate of the given key type (asynchronously) + * This operation can be used to upload a new certificate for an endpoint of the given type. + * @param keyType Key type for the certificate (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (required) + * @param alias Alias for the certificate (required) + * @param tier API tier to which the certificate should be applied. (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 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
200 OK. The Certificate added successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call deleteAPIClientCertificateByAliasAsync(String alias, String apiId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call addAPIClientCertificateOfGivenKeyTypeAsync(String keyType, String apiId, File certificate, String alias, String tier, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = deleteAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + okhttp3.Call localVarCall = addAPIClientCertificateOfGivenKeyTypeValidateBeforeCall(keyType, apiId, certificate, alias, tier, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** - * Build call for getAPIClientCertificateByAlias - * @param alias (required) + * Build call for deleteAPIClientCertificateByAlias + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param _callback Callback for upload/download progress * @return Call to execute @@ -363,13 +394,13 @@ public okhttp3.Call deleteAPIClientCertificateByAliasAsync(String alias, String * @http.response.details - +
Status Code Description Response Headers
200 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call getAPIClientCertificateByAliasCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAPIClientCertificateByAliasCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -397,75 +428,72 @@ public okhttp3.Call getAPIClientCertificateByAliasCall(String alias, String apiI localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAPIClientCertificateByAliasValidateBeforeCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteAPIClientCertificateByAliasValidateBeforeCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'alias' is set if (alias == null) { - throw new ApiException("Missing the required parameter 'alias' when calling getAPIClientCertificateByAlias(Async)"); + throw new ApiException("Missing the required parameter 'alias' when calling deleteAPIClientCertificateByAlias(Async)"); } // verify the required parameter 'apiId' is set if (apiId == null) { - throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificateByAlias(Async)"); + throw new ApiException("Missing the required parameter 'apiId' when calling deleteAPIClientCertificateByAlias(Async)"); } - okhttp3.Call localVarCall = getAPIClientCertificateByAliasCall(alias, apiId, _callback); + okhttp3.Call localVarCall = deleteAPIClientCertificateByAliasCall(alias, apiId, _callback); return localVarCall; } /** - * Get the Certificate Information - * This operation can be used to get the information about a certificate. - * @param alias (required) + * Delete a Certificate + * This operation can be used to delete an uploaded certificate. + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @return CertificateInfoDTO * @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 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public CertificateInfoDTO getAPIClientCertificateByAlias(String alias, String apiId) throws ApiException { - ApiResponse localVarResp = getAPIClientCertificateByAliasWithHttpInfo(alias, apiId); - return localVarResp.getData(); + public void deleteAPIClientCertificateByAlias(String alias, String apiId) throws ApiException { + deleteAPIClientCertificateByAliasWithHttpInfo(alias, apiId); } /** - * Get the Certificate Information - * This operation can be used to get the information about a certificate. - * @param alias (required) + * Delete a Certificate + * This operation can be used to delete an uploaded certificate. + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @return ApiResponse<CertificateInfoDTO> + * @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 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public ApiResponse getAPIClientCertificateByAliasWithHttpInfo(String alias, String apiId) throws ApiException { - okhttp3.Call localVarCall = getAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + public ApiResponse deleteAPIClientCertificateByAliasWithHttpInfo(String alias, String apiId) throws ApiException { + okhttp3.Call localVarCall = deleteAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, null); + return localVarApiClient.execute(localVarCall); } /** - * Get the Certificate Information (asynchronously) - * This operation can be used to get the information about a certificate. - * @param alias (required) + * Delete a Certificate (asynchronously) + * This operation can be used to delete an uploaded certificate. + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -473,42 +501,43 @@ public ApiResponse getAPIClientCertificateByAliasWithHttpInf * @http.response.details - +
Status Code Description Response Headers
200 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call getAPIClientCertificateByAliasAsync(String alias, String apiId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAPIClientCertificateByAliasAsync(String alias, String apiId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + okhttp3.Call localVarCall = deleteAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getAPIClientCertificateContentByAlias + * Build call for deleteAPIClientCertificateByKeyTypeAndAlias + * @param keyType Key type for the certificate (required) + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param alias (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 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call getAPIClientCertificateContentByAliasCall(String apiId, String alias, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAPIClientCertificateByKeyTypeAndAliasCall(String keyType, String alias, String apiId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apis/{apiId}/client-certificates/{alias}/content" - .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())) - .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())); + String localVarPath = "/apis/{apiId}/client-certs/{keyType}/{alias}" + .replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString())) + .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())) + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); @@ -530,129 +559,125 @@ public okhttp3.Call getAPIClientCertificateContentByAliasCall(String apiId, Stri localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") - private okhttp3.Call getAPIClientCertificateContentByAliasValidateBeforeCall(String apiId, String alias, final ApiCallback _callback) throws ApiException { + private okhttp3.Call deleteAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(String keyType, String alias, String apiId, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'apiId' is set - if (apiId == null) { - throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificateContentByAlias(Async)"); + // verify the required parameter 'keyType' is set + if (keyType == null) { + throw new ApiException("Missing the required parameter 'keyType' when calling deleteAPIClientCertificateByKeyTypeAndAlias(Async)"); } // verify the required parameter 'alias' is set if (alias == null) { - throw new ApiException("Missing the required parameter 'alias' when calling getAPIClientCertificateContentByAlias(Async)"); + throw new ApiException("Missing the required parameter 'alias' when calling deleteAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling deleteAPIClientCertificateByKeyTypeAndAlias(Async)"); } - okhttp3.Call localVarCall = getAPIClientCertificateContentByAliasCall(apiId, alias, _callback); + okhttp3.Call localVarCall = deleteAPIClientCertificateByKeyTypeAndAliasCall(keyType, alias, apiId, _callback); return localVarCall; } /** - * Download a Certificate - * This operation can be used to download a certificate which matches the given alias. + * Delete a Certificate of a Given Key Type + * This operation can be used to delete an uploaded certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param alias (required) * @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 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public void getAPIClientCertificateContentByAlias(String apiId, String alias) throws ApiException { - getAPIClientCertificateContentByAliasWithHttpInfo(apiId, alias); + public void deleteAPIClientCertificateByKeyTypeAndAlias(String keyType, String alias, String apiId) throws ApiException { + deleteAPIClientCertificateByKeyTypeAndAliasWithHttpInfo(keyType, alias, apiId); } /** - * Download a Certificate - * This operation can be used to download a certificate which matches the given alias. + * Delete a Certificate of a Given Key Type + * This operation can be used to delete an uploaded certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param alias (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - +
Status Code Description Response Headers
200 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public ApiResponse getAPIClientCertificateContentByAliasWithHttpInfo(String apiId, String alias) throws ApiException { - okhttp3.Call localVarCall = getAPIClientCertificateContentByAliasValidateBeforeCall(apiId, alias, null); + public ApiResponse deleteAPIClientCertificateByKeyTypeAndAliasWithHttpInfo(String keyType, String alias, String apiId) throws ApiException { + okhttp3.Call localVarCall = deleteAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(keyType, alias, apiId, null); return localVarApiClient.execute(localVarCall); } /** - * Download a Certificate (asynchronously) - * This operation can be used to download a certificate which matches the given alias. + * Delete a Certificate of a Given Key Type (asynchronously) + * This operation can be used to delete an uploaded certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias The alias of the certificate that should be deleted. (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param alias (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 OK. * Content-Type - The content type of the body.
200 OK. The Certificate deleted successfully. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call getAPIClientCertificateContentByAliasAsync(String apiId, String alias, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAPIClientCertificateByKeyTypeAndAliasAsync(String keyType, String alias, String apiId, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAPIClientCertificateContentByAliasValidateBeforeCall(apiId, alias, _callback); + okhttp3.Call localVarCall = deleteAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(keyType, alias, apiId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** - * Build call for getAPIClientCertificates + * Build call for getAPIClientCertificateByAlias + * @param alias (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param limit Maximum size of resource array to return. (optional, default to 25) - * @param offset Starting point within the complete list of items qualified. (optional, default to 0) - * @param alias Alias for the client certificate (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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
200 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public okhttp3.Call getAPIClientCertificatesCall(String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAPIClientCertificateByAliasCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apis/{apiId}/client-certificates" + String localVarPath = "/apis/{apiId}/client-certificates/{alias}" + .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())) .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); - if (limit != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); - } - - if (offset != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); - } - - if (alias != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("alias", alias)); - } - Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); @@ -675,44 +700,752 @@ public okhttp3.Call getAPIClientCertificatesCall(String apiId, Integer limit, In } @SuppressWarnings("rawtypes") - private okhttp3.Call getAPIClientCertificatesValidateBeforeCall(String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + private okhttp3.Call getAPIClientCertificateByAliasValidateBeforeCall(String alias, String apiId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'alias' is set + if (alias == null) { + throw new ApiException("Missing the required parameter 'alias' when calling getAPIClientCertificateByAlias(Async)"); + } // verify the required parameter 'apiId' is set if (apiId == null) { - throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificates(Async)"); + throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificateByAlias(Async)"); } - okhttp3.Call localVarCall = getAPIClientCertificatesCall(apiId, limit, offset, alias, _callback); + okhttp3.Call localVarCall = getAPIClientCertificateByAliasCall(alias, apiId, _callback); return localVarCall; } /** - * Retrieve/ Search Uploaded Client Certificates - * This operation can be used to retrieve and search the uploaded client certificates. + * Get the Certificate Information + * This operation can be used to get the information about a certificate. + * @param alias (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param limit Maximum size of resource array to return. (optional, default to 25) - * @param offset Starting point within the complete list of items qualified. (optional, default to 0) - * @param alias Alias for the client certificate (optional) - * @return ClientCertificatesDTO + * @return CertificateInfoDTO * @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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
200 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ - public ClientCertificatesDTO getAPIClientCertificates(String apiId, Integer limit, Integer offset, String alias) throws ApiException { - ApiResponse localVarResp = getAPIClientCertificatesWithHttpInfo(apiId, limit, offset, alias); + public CertificateInfoDTO getAPIClientCertificateByAlias(String alias, String apiId) throws ApiException { + ApiResponse localVarResp = getAPIClientCertificateByAliasWithHttpInfo(alias, apiId); return localVarResp.getData(); } /** - * Retrieve/ Search Uploaded Client Certificates - * This operation can be used to retrieve and search the uploaded client certificates. + * Get the Certificate Information + * This operation can be used to get the information about a certificate. + * @param alias (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @return ApiResponse<CertificateInfoDTO> + * @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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public ApiResponse getAPIClientCertificateByAliasWithHttpInfo(String alias, String apiId) throws ApiException { + okhttp3.Call localVarCall = getAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Certificate Information (asynchronously) + * This operation can be used to get the information about a certificate. + * @param alias (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateByAliasAsync(String alias, String apiId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAPIClientCertificateByKeyTypeAndAlias + * @param keyType Key type for the certificate (required) + * @param alias (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateByKeyTypeAndAliasCall(String keyType, String alias, String apiId, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/{apiId}/client-certs/{keyType}/{alias}" + .replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString())) + .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())) + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(String keyType, String alias, String apiId, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'keyType' is set + if (keyType == null) { + throw new ApiException("Missing the required parameter 'keyType' when calling getAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'alias' is set + if (alias == null) { + throw new ApiException("Missing the required parameter 'alias' when calling getAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + + okhttp3.Call localVarCall = getAPIClientCertificateByKeyTypeAndAliasCall(keyType, alias, apiId, _callback); + return localVarCall; + + } + + /** + * Get the Certificate Information of a Given Key Type + * This operation can be used to get the information about a certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @return CertificateInfoDTO + * @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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public CertificateInfoDTO getAPIClientCertificateByKeyTypeAndAlias(String keyType, String alias, String apiId) throws ApiException { + ApiResponse localVarResp = getAPIClientCertificateByKeyTypeAndAliasWithHttpInfo(keyType, alias, apiId); + return localVarResp.getData(); + } + + /** + * Get the Certificate Information of a Given Key Type + * This operation can be used to get the information about a certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @return ApiResponse<CertificateInfoDTO> + * @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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public ApiResponse getAPIClientCertificateByKeyTypeAndAliasWithHttpInfo(String keyType, String alias, String apiId) throws ApiException { + okhttp3.Call localVarCall = getAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(keyType, alias, apiId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get the Certificate Information of a Given Key Type (asynchronously) + * This operation can be used to get the information about a certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateByKeyTypeAndAliasAsync(String keyType, String alias, String apiId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(keyType, alias, apiId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAPIClientCertificateContentByAlias + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateContentByAliasCall(String apiId, String alias, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/{apiId}/client-certificates/{alias}/content" + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())) + .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIClientCertificateContentByAliasValidateBeforeCall(String apiId, String alias, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificateContentByAlias(Async)"); + } + + // verify the required parameter 'alias' is set + if (alias == null) { + throw new ApiException("Missing the required parameter 'alias' when calling getAPIClientCertificateContentByAlias(Async)"); + } + + + okhttp3.Call localVarCall = getAPIClientCertificateContentByAliasCall(apiId, alias, _callback); + return localVarCall; + + } + + /** + * Download a Certificate + * This operation can be used to download a certificate which matches the given alias. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (required) + * @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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public void getAPIClientCertificateContentByAlias(String apiId, String alias) throws ApiException { + getAPIClientCertificateContentByAliasWithHttpInfo(apiId, alias); + } + + /** + * Download a Certificate + * This operation can be used to download a certificate which matches the given alias. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public ApiResponse getAPIClientCertificateContentByAliasWithHttpInfo(String apiId, String alias) throws ApiException { + okhttp3.Call localVarCall = getAPIClientCertificateContentByAliasValidateBeforeCall(apiId, alias, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download a Certificate (asynchronously) + * This operation can be used to download a certificate which matches the given alias. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateContentByAliasAsync(String apiId, String alias, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIClientCertificateContentByAliasValidateBeforeCall(apiId, alias, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getAPIClientCertificateContentByKeyTypeAndAlias + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (required) + * @param keyType The key type of the certificate that should be deleted. (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateContentByKeyTypeAndAliasCall(String apiId, String alias, String keyType, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/{apiId}/client-certs/{keyType}/{alias}/content" + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())) + .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())) + .replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIClientCertificateContentByKeyTypeAndAliasValidateBeforeCall(String apiId, String alias, String keyType, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificateContentByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'alias' is set + if (alias == null) { + throw new ApiException("Missing the required parameter 'alias' when calling getAPIClientCertificateContentByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'keyType' is set + if (keyType == null) { + throw new ApiException("Missing the required parameter 'keyType' when calling getAPIClientCertificateContentByKeyTypeAndAlias(Async)"); + } + + + okhttp3.Call localVarCall = getAPIClientCertificateContentByKeyTypeAndAliasCall(apiId, alias, keyType, _callback); + return localVarCall; + + } + + /** + * Download a Certificate of Given Key Type + * This operation can be used to download a certificate which matches the given alias and key type. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (required) + * @param keyType The key type of the certificate that should be deleted. (required) + * @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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public void getAPIClientCertificateContentByKeyTypeAndAlias(String apiId, String alias, String keyType) throws ApiException { + getAPIClientCertificateContentByKeyTypeAndAliasWithHttpInfo(apiId, alias, keyType); + } + + /** + * Download a Certificate of Given Key Type + * This operation can be used to download a certificate which matches the given alias and key type. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (required) + * @param keyType The key type of the certificate that should be deleted. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public ApiResponse getAPIClientCertificateContentByKeyTypeAndAliasWithHttpInfo(String apiId, String alias, String keyType) throws ApiException { + okhttp3.Call localVarCall = getAPIClientCertificateContentByKeyTypeAndAliasValidateBeforeCall(apiId, alias, keyType, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Download a Certificate of Given Key Type (asynchronously) + * This operation can be used to download a certificate which matches the given alias and key type. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param alias (required) + * @param keyType The key type of the certificate that should be deleted. (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 OK. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificateContentByKeyTypeAndAliasAsync(String apiId, String alias, String keyType, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIClientCertificateContentByKeyTypeAndAliasValidateBeforeCall(apiId, alias, keyType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getAPIClientCertificates + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param limit Maximum size of resource array to return. (optional, default to 25) + * @param offset Starting point within the complete list of items qualified. (optional, default to 0) + * @param alias Alias for the client certificate (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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificatesCall(String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/{apiId}/client-certificates" + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (alias != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("alias", alias)); + } + + 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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIClientCertificatesValidateBeforeCall(String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificates(Async)"); + } + + + okhttp3.Call localVarCall = getAPIClientCertificatesCall(apiId, limit, offset, alias, _callback); + return localVarCall; + + } + + /** + * Retrieve/ Search Uploaded Client Certificates + * This operation can be used to retrieve and search the uploaded client certificates. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param limit Maximum size of resource array to return. (optional, default to 25) + * @param offset Starting point within the complete list of items qualified. (optional, default to 0) + * @param alias Alias for the client certificate (optional) + * @return ClientCertificatesDTO + * @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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
+ */ + public ClientCertificatesDTO getAPIClientCertificates(String apiId, Integer limit, Integer offset, String alias) throws ApiException { + ApiResponse localVarResp = getAPIClientCertificatesWithHttpInfo(apiId, limit, offset, alias); + return localVarResp.getData(); + } + + /** + * Retrieve/ Search Uploaded Client Certificates + * This operation can be used to retrieve and search the uploaded client certificates. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param limit Maximum size of resource array to return. (optional, default to 25) + * @param offset Starting point within the complete list of items qualified. (optional, default to 0) + * @param alias Alias for the client certificate (optional) + * @return ApiResponse<ClientCertificatesDTO> + * @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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
+ */ + public ApiResponse getAPIClientCertificatesWithHttpInfo(String apiId, Integer limit, Integer offset, String alias) throws ApiException { + okhttp3.Call localVarCall = getAPIClientCertificatesValidateBeforeCall(apiId, limit, offset, alias, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve/ Search Uploaded Client Certificates (asynchronously) + * This operation can be used to retrieve and search the uploaded client certificates. + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param limit Maximum size of resource array to return. (optional, default to 25) + * @param offset Starting point within the complete list of items qualified. (optional, default to 0) + * @param alias Alias for the client certificate (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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificatesAsync(String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAPIClientCertificatesValidateBeforeCall(apiId, limit, offset, alias, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAPIClientCertificatesByKeyType + * @param keyType Key type for the certificate (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param limit Maximum size of resource array to return. (optional, default to 25) + * @param offset Starting point within the complete list of items qualified. (optional, default to 0) + * @param alias Alias for the client certificate (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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
+ */ + public okhttp3.Call getAPIClientCertificatesByKeyTypeCall(String keyType, String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/{apiId}/client-certs/{keyType}" + .replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString())) + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (offset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); + } + + if (alias != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("alias", alias)); + } + + 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); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAPIClientCertificatesByKeyTypeValidateBeforeCall(String keyType, String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'keyType' is set + if (keyType == null) { + throw new ApiException("Missing the required parameter 'keyType' when calling getAPIClientCertificatesByKeyType(Async)"); + } + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling getAPIClientCertificatesByKeyType(Async)"); + } + + + okhttp3.Call localVarCall = getAPIClientCertificatesByKeyTypeCall(keyType, apiId, limit, offset, alias, _callback); + return localVarCall; + + } + + /** + * Retrieve/ Search Uploaded Client Certificates of a given key type + * This operation can be used to retrieve and search the uploaded client certificates of a given key type. + * @param keyType Key type for the certificate (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param limit Maximum size of resource array to return. (optional, default to 25) + * @param offset Starting point within the complete list of items qualified. (optional, default to 0) + * @param alias Alias for the client certificate (optional) + * @return ClientCertificatesDTO + * @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 OK. Successful response with the list of matching certificate information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
+ */ + public ClientCertificatesDTO getAPIClientCertificatesByKeyType(String keyType, String apiId, Integer limit, Integer offset, String alias) throws ApiException { + ApiResponse localVarResp = getAPIClientCertificatesByKeyTypeWithHttpInfo(keyType, apiId, limit, offset, alias); + return localVarResp.getData(); + } + + /** + * Retrieve/ Search Uploaded Client Certificates of a given key type + * This operation can be used to retrieve and search the uploaded client certificates of a given key type. + * @param keyType Key type for the certificate (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param limit Maximum size of resource array to return. (optional, default to 25) * @param offset Starting point within the complete list of items qualified. (optional, default to 0) @@ -727,15 +1460,16 @@ public ClientCertificatesDTO getAPIClientCertificates(String apiId, Integer limi 500 Internal Server Error. - */ - public ApiResponse getAPIClientCertificatesWithHttpInfo(String apiId, Integer limit, Integer offset, String alias) throws ApiException { - okhttp3.Call localVarCall = getAPIClientCertificatesValidateBeforeCall(apiId, limit, offset, alias, null); + public ApiResponse getAPIClientCertificatesByKeyTypeWithHttpInfo(String keyType, String apiId, Integer limit, Integer offset, String alias) throws ApiException { + okhttp3.Call localVarCall = getAPIClientCertificatesByKeyTypeValidateBeforeCall(keyType, apiId, limit, offset, alias, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Retrieve/ Search Uploaded Client Certificates (asynchronously) - * This operation can be used to retrieve and search the uploaded client certificates. + * Retrieve/ Search Uploaded Client Certificates of a given key type (asynchronously) + * This operation can be used to retrieve and search the uploaded client certificates of a given key type. + * @param keyType Key type for the certificate (required) * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param limit Maximum size of resource array to return. (optional, default to 25) * @param offset Starting point within the complete list of items qualified. (optional, default to 0) @@ -751,9 +1485,9 @@ public ApiResponse getAPIClientCertificatesWithHttpInfo(S 500 Internal Server Error. - */ - public okhttp3.Call getAPIClientCertificatesAsync(String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getAPIClientCertificatesByKeyTypeAsync(String keyType, String apiId, Integer limit, Integer offset, String alias, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = getAPIClientCertificatesValidateBeforeCall(apiId, limit, offset, alias, _callback); + okhttp3.Call localVarCall = getAPIClientCertificatesByKeyTypeValidateBeforeCall(keyType, apiId, limit, offset, alias, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -764,7 +1498,6 @@ public okhttp3.Call getAPIClientCertificatesAsync(String apiId, Integer limit, I * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param certificate The certificate that needs to be uploaded. (optional) * @param tier The tier of the certificate (optional) - * @param keyType The key type of the certificate (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -777,7 +1510,7 @@ public okhttp3.Call getAPIClientCertificatesAsync(String apiId, Integer limit, I 500 Internal Server Error. - */ - public okhttp3.Call updateAPIClientCertificateByAliasCall(String alias, String apiId, File certificate, String tier, String keyType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAPIClientCertificateByAliasCall(String alias, String apiId, File certificate, String tier, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -798,10 +1531,6 @@ public okhttp3.Call updateAPIClientCertificateByAliasCall(String alias, String a localVarFormParams.put("tier", tier); } - if (keyType != null) { - localVarFormParams.put("keyType", keyType); - } - final String[] localVarAccepts = { "application/json" }; @@ -821,7 +1550,7 @@ public okhttp3.Call updateAPIClientCertificateByAliasCall(String alias, String a } @SuppressWarnings("rawtypes") - private okhttp3.Call updateAPIClientCertificateByAliasValidateBeforeCall(String alias, String apiId, File certificate, String tier, String keyType, final ApiCallback _callback) throws ApiException { + private okhttp3.Call updateAPIClientCertificateByAliasValidateBeforeCall(String alias, String apiId, File certificate, String tier, final ApiCallback _callback) throws ApiException { // verify the required parameter 'alias' is set if (alias == null) { @@ -834,7 +1563,7 @@ private okhttp3.Call updateAPIClientCertificateByAliasValidateBeforeCall(String } - okhttp3.Call localVarCall = updateAPIClientCertificateByAliasCall(alias, apiId, certificate, tier, keyType, _callback); + okhttp3.Call localVarCall = updateAPIClientCertificateByAliasCall(alias, apiId, certificate, tier, _callback); return localVarCall; } @@ -846,7 +1575,6 @@ private okhttp3.Call updateAPIClientCertificateByAliasValidateBeforeCall(String * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param certificate The certificate that needs to be uploaded. (optional) * @param tier The tier of the certificate (optional) - * @param keyType The key type of the certificate (optional) * @return ClientCertMetadataDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -858,8 +1586,8 @@ private okhttp3.Call updateAPIClientCertificateByAliasValidateBeforeCall(String 500 Internal Server Error. - */ - public ClientCertMetadataDTO updateAPIClientCertificateByAlias(String alias, String apiId, File certificate, String tier, String keyType) throws ApiException { - ApiResponse localVarResp = updateAPIClientCertificateByAliasWithHttpInfo(alias, apiId, certificate, tier, keyType); + public ClientCertMetadataDTO updateAPIClientCertificateByAlias(String alias, String apiId, File certificate, String tier) throws ApiException { + ApiResponse localVarResp = updateAPIClientCertificateByAliasWithHttpInfo(alias, apiId, certificate, tier); return localVarResp.getData(); } @@ -870,7 +1598,6 @@ public ClientCertMetadataDTO updateAPIClientCertificateByAlias(String alias, Str * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param certificate The certificate that needs to be uploaded. (optional) * @param tier The tier of the certificate (optional) - * @param keyType The key type of the certificate (optional) * @return ApiResponse<ClientCertMetadataDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -882,8 +1609,8 @@ public ClientCertMetadataDTO updateAPIClientCertificateByAlias(String alias, Str 500 Internal Server Error. - */ - public ApiResponse updateAPIClientCertificateByAliasWithHttpInfo(String alias, String apiId, File certificate, String tier, String keyType) throws ApiException { - okhttp3.Call localVarCall = updateAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, certificate, tier, keyType, null); + public ApiResponse updateAPIClientCertificateByAliasWithHttpInfo(String alias, String apiId, File certificate, String tier) throws ApiException { + okhttp3.Call localVarCall = updateAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, certificate, tier, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -895,7 +1622,6 @@ public ApiResponse updateAPIClientCertificateByAliasWithH * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param certificate The certificate that needs to be uploaded. (optional) * @param tier The tier of the certificate (optional) - * @param keyType The key type of the certificate (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 @@ -908,9 +1634,168 @@ public ApiResponse updateAPIClientCertificateByAliasWithH 500 Internal Server Error. - */ - public okhttp3.Call updateAPIClientCertificateByAliasAsync(String alias, String apiId, File certificate, String tier, String keyType, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAPIClientCertificateByAliasAsync(String alias, String apiId, File certificate, String tier, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, certificate, tier, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateAPIClientCertificateByKeyTypeAndAlias + * @param keyType Key type for the certificate (required) + * @param alias Alias for the certificate (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (optional) + * @param tier The tier of the certificate (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 OK. The Certificate updated successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call updateAPIClientCertificateByKeyTypeAndAliasCall(String keyType, String alias, String apiId, File certificate, String tier, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/apis/{apiId}/client-certs/{keyType}/{alias}" + .replaceAll("\\{" + "keyType" + "\\}", localVarApiClient.escapeString(keyType.toString())) + .replaceAll("\\{" + "alias" + "\\}", localVarApiClient.escapeString(alias.toString())) + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + if (certificate != null) { + localVarFormParams.put("certificate", certificate); + } + + if (tier != null) { + localVarFormParams.put("tier", tier); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(String keyType, String alias, String apiId, File certificate, String tier, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'keyType' is set + if (keyType == null) { + throw new ApiException("Missing the required parameter 'keyType' when calling updateAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'alias' is set + if (alias == null) { + throw new ApiException("Missing the required parameter 'alias' when calling updateAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling updateAPIClientCertificateByKeyTypeAndAlias(Async)"); + } + + + okhttp3.Call localVarCall = updateAPIClientCertificateByKeyTypeAndAliasCall(keyType, alias, apiId, certificate, tier, _callback); + return localVarCall; + + } + + /** + * Update a Certificate of a Given Key Type + * This operation can be used to update an uploaded certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias Alias for the certificate (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (optional) + * @param tier The tier of the certificate (optional) + * @return ClientCertMetadataDTO + * @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 OK. The Certificate updated successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public ClientCertMetadataDTO updateAPIClientCertificateByKeyTypeAndAlias(String keyType, String alias, String apiId, File certificate, String tier) throws ApiException { + ApiResponse localVarResp = updateAPIClientCertificateByKeyTypeAndAliasWithHttpInfo(keyType, alias, apiId, certificate, tier); + return localVarResp.getData(); + } + + /** + * Update a Certificate of a Given Key Type + * This operation can be used to update an uploaded certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias Alias for the certificate (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (optional) + * @param tier The tier of the certificate (optional) + * @return ApiResponse<ClientCertMetadataDTO> + * @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 OK. The Certificate updated successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public ApiResponse updateAPIClientCertificateByKeyTypeAndAliasWithHttpInfo(String keyType, String alias, String apiId, File certificate, String tier) throws ApiException { + okhttp3.Call localVarCall = updateAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(keyType, alias, apiId, certificate, tier, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a Certificate of a Given Key Type (asynchronously) + * This operation can be used to update an uploaded certificate of a given key type. + * @param keyType Key type for the certificate (required) + * @param alias Alias for the certificate (required) + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param certificate The certificate that needs to be uploaded. (optional) + * @param tier The tier of the certificate (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 OK. The Certificate updated successfully. * Location - The URL of the newly created resource.
* Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
+ */ + public okhttp3.Call updateAPIClientCertificateByKeyTypeAndAliasAsync(String keyType, String alias, String apiId, File certificate, String tier, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = updateAPIClientCertificateByAliasValidateBeforeCall(alias, apiId, certificate, tier, keyType, _callback); + okhttp3.Call localVarCall = updateAPIClientCertificateByKeyTypeAndAliasValidateBeforeCall(keyType, alias, apiId, certificate, tier, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java index 7af28c0c83..d1b52c43a5 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java @@ -42,10 +42,6 @@ public class ClientCertMetadataDTO { @SerializedName(SERIALIZED_NAME_TIER) private String tier; - public static final String SERIALIZED_NAME_KEY_TYPE = "keyType"; - @SerializedName(SERIALIZED_NAME_KEY_TYPE) - private String keyType = "PRODUCTION"; - public ClientCertMetadataDTO alias(String alias) { @@ -116,29 +112,6 @@ public void setTier(String tier) { } - public ClientCertMetadataDTO keyType(String keyType) { - - this.keyType = keyType; - return this; - } - - /** - * Get keyType - * @return keyType - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getKeyType() { - return keyType; - } - - - public void setKeyType(String keyType) { - this.keyType = keyType; - } - - @Override public boolean equals(Object o) { if (this == o) { @@ -150,13 +123,12 @@ public boolean equals(Object o) { ClientCertMetadataDTO clientCertMetadata = (ClientCertMetadataDTO) o; return Objects.equals(this.alias, clientCertMetadata.alias) && Objects.equals(this.apiId, clientCertMetadata.apiId) && - Objects.equals(this.tier, clientCertMetadata.tier) && - Objects.equals(this.keyType, clientCertMetadata.keyType); + Objects.equals(this.tier, clientCertMetadata.tier); } @Override public int hashCode() { - return Objects.hash(alias, apiId, tier, keyType); + return Objects.hash(alias, apiId, tier); } @@ -167,7 +139,6 @@ public String toString() { sb.append(" alias: ").append(toIndentedString(alias)).append("\n"); sb.append(" apiId: ").append(toIndentedString(apiId)).append("\n"); sb.append(" tier: ").append(toIndentedString(tier)).append("\n"); - sb.append(" keyType: ").append(toIndentedString(keyType)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml b/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml index 4d5ebabc2d..0946d3cb45 100644 --- a/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml +++ b/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml @@ -4596,6 +4596,9 @@ paths: source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" "https://127.0.0.1:9443/api/am/publisher/v4/throttling-policies/api/Platinum"' + ###################################################### + # The "Client Certificates" resource APIs (Deprecated) + ###################################################### /apis/{apiId}/client-certificates: get: tags: @@ -4671,9 +4674,6 @@ paths: tier: type: string description: api tier to which the certificate should be applied. - keyType: - type: string - description: key type to which the certificate should be applied. required: true responses: 200: @@ -4786,9 +4786,6 @@ paths: tier: type: string description: The tier of the certificate - keyType: - type: string - description: The key type of the certificate responses: 200: description: | @@ -4915,6 +4912,342 @@ paths: "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon/content"' operationId: getAPIClientCertificateContentByAlias + ###################################################### + # The "Client Certificates" resource APIs (New) + ###################################################### + /apis/{apiId}/client-certs/{keyType}: + parameters: + - in: path + name: keyType + schema: + type: string + required: true + description: Key type for the certificate + get: + tags: + - Client Certificates + summary: Retrieve/ Search Uploaded Client Certificates of a given key type + description: | + This operation can be used to retrieve and search the uploaded client certificates of a given key type. + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: alias + in: query + description: Alias for the client certificate + schema: + type: string + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. Successful response with the list of matching certificate information in the body. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertificates' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:api_manage + - apim:client_certificates_view + - apim:client_certificates_manage + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION?alias=wso2carbon"' + operationId: getAPIClientCertificatesByKeyType + post: + tags: + - Client Certificates + summary: Upload a New Certificate of the given key type + description: | + This operation can be used to upload a new certificate for an endpoint of the given type. + parameters: + - $ref: '#/components/parameters/apiId' + requestBody: + content: + multipart/form-data: + schema: + required: + - alias + - certificate + - tier + properties: + certificate: + type: string + description: The certificate that needs to be uploaded. + format: binary + alias: + maxLength: 30 + minLength: 1 + type: string + description: Alias for the certificate + tier: + type: string + description: API tier to which the certificate should be applied. + required: true + responses: + 200: + description: | + OK. + The Certificate added successfully. + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertMetadata' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:api_manage + - apim:client_certificates_add + - apim:client_certificates_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon -F tier=Gold + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION"' + operationId: addAPIClientCertificateOfGivenKeyType + + /apis/{apiId}/client-certs/{keyType}/{alias}: + parameters: + - in: path + name: keyType + schema: + type: string + required: true + description: Key type for the certificate + get: + tags: + - Client Certificates + summary: Get the Certificate Information of a Given Key Type + description: | + This operation can be used to get the information about a certificate of a given key type. + parameters: + - name: alias + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateInfo' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:api_manage + - apim:client_certificates_view + - apim:client_certificates_manage + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION/wso2carbon"' + operationId: getAPIClientCertificateByKeyTypeAndAlias + + put: + tags: + - Client Certificates + summary: Update a Certificate of a Given Key Type + description: | + This operation can be used to update an uploaded certificate of a given key type. + parameters: + - name: alias + in: path + description: Alias for the certificate + required: true + schema: + maxLength: 30 + minLength: 1 + type: string + - $ref: '#/components/parameters/apiId' + requestBody: + content: + multipart/form-data: + schema: + properties: + certificate: + type: string + description: The certificate that needs to be uploaded. + format: binary + tier: + type: string + description: The tier of the certificate + responses: + 200: + description: | + OK. + The Certificate updated successfully. + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertMetadata' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:api_manage + - apim:client_certificates_update + - apim:client_certificates_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon + -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION/wso2carbon"' + operationId: updateAPIClientCertificateByKeyTypeAndAlias + + delete: + tags: + - Client Certificates + summary: Delete a Certificate of a Given Key Type + description: | + This operation can be used to delete an uploaded certificate of a given key type. + parameters: + - name: alias + in: path + description: | + The alias of the certificate that should be deleted. + required: true + schema: + type: string + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + The Certificate deleted successfully. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: { } + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:api_manage + - apim:client_certificates_update + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + operationId: deleteAPIClientCertificateByKeyTypeAndAlias + + /apis/{apiId}/client-certs/{keyType}/{alias}/content: + get: + tags: + - Client Certificates + summary: Download a Certificate of Given Key Type + description: | + This operation can be used to download a certificate which matches the given alias and key type. + parameters: + - $ref: '#/components/parameters/apiId' + - name: alias + in: path + required: true + schema: + type: string + - name: keyType + in: path + description: | + The key type of the certificate that should be deleted. + required: true + schema: + type: string + responses: + 200: + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:api_manage + - apim:client_certificates_view + - apim:client_certificates_manage + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v4/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certs/PRODUCTION/wso2carbon/content" > test.crt' + operationId: getAPIClientCertificateContentByKeyTypeAndAlias + ###################################################### # The "Certificate Management" resource APIs ###################################################### @@ -11288,9 +11621,6 @@ components: tier: type: string example: Gold - keyType: - type: string - default: PRODUCTION description: Meta data of certificate LifecycleState: title: Lifecycle State diff --git a/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java b/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java index 0410667ba8..0e0b354dbf 100644 --- a/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java +++ b/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java @@ -1426,8 +1426,8 @@ public APIDTO addAPI(APICreationRequestBean apiCreationRequestBean) throws ApiEx public HttpResponse uploadCertificate(File certificate, String alias, String apiId, String tier, String keyType) throws ApiException { - ClientCertMetadataDTO certificateDTO = clientCertificatesApi.addAPIClientCertificate(apiId, certificate, - alias, tier, keyType); + ClientCertMetadataDTO certificateDTO = clientCertificatesApi.addAPIClientCertificateOfGivenKeyType(keyType, + apiId, certificate, alias, tier); HttpResponse response = null; if (StringUtils.isNotEmpty(certificateDTO.getAlias())) { response = new HttpResponse("Successfully uploaded the certificate", 200);