From 990e340be264ef94f3c35a110326ba2f513a6ddf Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 24 Nov 2022 10:14:25 +0000 Subject: [PATCH] Support deleteCertificate. --- VERSION | 2 +- cas/CMakeLists.txt | 12 ++ cas/include/alibabacloud/cas/CasClient.h | 24 +++ .../cas/model/DeleteUserCertificateRequest.h | 45 +++++ .../cas/model/DeleteUserCertificateResult.h | 49 ++++++ .../model/GetUserCertificateDetailRequest.h | 45 +++++ .../model/GetUserCertificateDetailResult.h | 81 +++++++++ .../cas/model/UploadUserCertificateRequest.h | 63 +++++++ .../cas/model/UploadUserCertificateResult.h | 51 ++++++ cas/src/CasClient.cc | 108 ++++++++++++ cas/src/model/DeleteUserCertificateRequest.cc | 45 +++++ cas/src/model/DeleteUserCertificateResult.cc | 44 +++++ .../model/GetUserCertificateDetailRequest.cc | 45 +++++ .../model/GetUserCertificateDetailResult.cc | 156 ++++++++++++++++++ cas/src/model/UploadUserCertificateRequest.cc | 99 +++++++++++ cas/src/model/UploadUserCertificateResult.cc | 51 ++++++ 16 files changed, 919 insertions(+), 1 deletion(-) create mode 100644 cas/include/alibabacloud/cas/model/DeleteUserCertificateRequest.h create mode 100644 cas/include/alibabacloud/cas/model/DeleteUserCertificateResult.h create mode 100644 cas/include/alibabacloud/cas/model/GetUserCertificateDetailRequest.h create mode 100644 cas/include/alibabacloud/cas/model/GetUserCertificateDetailResult.h create mode 100644 cas/include/alibabacloud/cas/model/UploadUserCertificateRequest.h create mode 100644 cas/include/alibabacloud/cas/model/UploadUserCertificateResult.h create mode 100644 cas/src/model/DeleteUserCertificateRequest.cc create mode 100644 cas/src/model/DeleteUserCertificateResult.cc create mode 100644 cas/src/model/GetUserCertificateDetailRequest.cc create mode 100644 cas/src/model/GetUserCertificateDetailResult.cc create mode 100644 cas/src/model/UploadUserCertificateRequest.cc create mode 100644 cas/src/model/UploadUserCertificateResult.cc diff --git a/VERSION b/VERSION index e77cf1099..bc0b25918 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1348 \ No newline at end of file +1.36.1349 \ No newline at end of file diff --git a/cas/CMakeLists.txt b/cas/CMakeLists.txt index 18bb0da1c..bb23c1bbf 100644 --- a/cas/CMakeLists.txt +++ b/cas/CMakeLists.txt @@ -39,6 +39,8 @@ set(cas_public_header_model include/alibabacloud/cas/model/DeleteCertificateRequestResult.h include/alibabacloud/cas/model/DeletePCACertRequest.h include/alibabacloud/cas/model/DeletePCACertResult.h + include/alibabacloud/cas/model/DeleteUserCertificateRequest.h + include/alibabacloud/cas/model/DeleteUserCertificateResult.h include/alibabacloud/cas/model/DescribeCertificateStateRequest.h include/alibabacloud/cas/model/DescribeCertificateStateResult.h include/alibabacloud/cas/model/DescribePackageStateRequest.h @@ -47,6 +49,8 @@ set(cas_public_header_model include/alibabacloud/cas/model/EncryptResult.h include/alibabacloud/cas/model/GetCertWarehouseQuotaRequest.h include/alibabacloud/cas/model/GetCertWarehouseQuotaResult.h + include/alibabacloud/cas/model/GetUserCertificateDetailRequest.h + include/alibabacloud/cas/model/GetUserCertificateDetailResult.h include/alibabacloud/cas/model/ListCertRequest.h include/alibabacloud/cas/model/ListCertResult.h include/alibabacloud/cas/model/ListCertWarehouseRequest.h @@ -61,6 +65,8 @@ set(cas_public_header_model include/alibabacloud/cas/model/SignResult.h include/alibabacloud/cas/model/UploadPCACertRequest.h include/alibabacloud/cas/model/UploadPCACertResult.h + include/alibabacloud/cas/model/UploadUserCertificateRequest.h + include/alibabacloud/cas/model/UploadUserCertificateResult.h include/alibabacloud/cas/model/VerifyRequest.h include/alibabacloud/cas/model/VerifyResult.h ) @@ -84,6 +90,8 @@ set(cas_src src/model/DeleteCertificateRequestResult.cc src/model/DeletePCACertRequest.cc src/model/DeletePCACertResult.cc + src/model/DeleteUserCertificateRequest.cc + src/model/DeleteUserCertificateResult.cc src/model/DescribeCertificateStateRequest.cc src/model/DescribeCertificateStateResult.cc src/model/DescribePackageStateRequest.cc @@ -92,6 +100,8 @@ set(cas_src src/model/EncryptResult.cc src/model/GetCertWarehouseQuotaRequest.cc src/model/GetCertWarehouseQuotaResult.cc + src/model/GetUserCertificateDetailRequest.cc + src/model/GetUserCertificateDetailResult.cc src/model/ListCertRequest.cc src/model/ListCertResult.cc src/model/ListCertWarehouseRequest.cc @@ -106,6 +116,8 @@ set(cas_src src/model/SignResult.cc src/model/UploadPCACertRequest.cc src/model/UploadPCACertResult.cc + src/model/UploadUserCertificateRequest.cc + src/model/UploadUserCertificateResult.cc src/model/VerifyRequest.cc src/model/VerifyResult.cc ) diff --git a/cas/include/alibabacloud/cas/CasClient.h b/cas/include/alibabacloud/cas/CasClient.h index 65b0fe6f2..5e5d16482 100644 --- a/cas/include/alibabacloud/cas/CasClient.h +++ b/cas/include/alibabacloud/cas/CasClient.h @@ -40,6 +40,8 @@ #include "model/DeleteCertificateRequestResult.h" #include "model/DeletePCACertRequest.h" #include "model/DeletePCACertResult.h" +#include "model/DeleteUserCertificateRequest.h" +#include "model/DeleteUserCertificateResult.h" #include "model/DescribeCertificateStateRequest.h" #include "model/DescribeCertificateStateResult.h" #include "model/DescribePackageStateRequest.h" @@ -48,6 +50,8 @@ #include "model/EncryptResult.h" #include "model/GetCertWarehouseQuotaRequest.h" #include "model/GetCertWarehouseQuotaResult.h" +#include "model/GetUserCertificateDetailRequest.h" +#include "model/GetUserCertificateDetailResult.h" #include "model/ListCertRequest.h" #include "model/ListCertResult.h" #include "model/ListCertWarehouseRequest.h" @@ -62,6 +66,8 @@ #include "model/SignResult.h" #include "model/UploadPCACertRequest.h" #include "model/UploadPCACertResult.h" +#include "model/UploadUserCertificateRequest.h" +#include "model/UploadUserCertificateResult.h" #include "model/VerifyRequest.h" #include "model/VerifyResult.h" @@ -100,6 +106,9 @@ namespace AlibabaCloud typedef Outcome DeletePCACertOutcome; typedef std::future DeletePCACertOutcomeCallable; typedef std::function&)> DeletePCACertAsyncHandler; + typedef Outcome DeleteUserCertificateOutcome; + typedef std::future DeleteUserCertificateOutcomeCallable; + typedef std::function&)> DeleteUserCertificateAsyncHandler; typedef Outcome DescribeCertificateStateOutcome; typedef std::future DescribeCertificateStateOutcomeCallable; typedef std::function&)> DescribeCertificateStateAsyncHandler; @@ -112,6 +121,9 @@ namespace AlibabaCloud typedef Outcome GetCertWarehouseQuotaOutcome; typedef std::future GetCertWarehouseQuotaOutcomeCallable; typedef std::function&)> GetCertWarehouseQuotaAsyncHandler; + typedef Outcome GetUserCertificateDetailOutcome; + typedef std::future GetUserCertificateDetailOutcomeCallable; + typedef std::function&)> GetUserCertificateDetailAsyncHandler; typedef Outcome ListCertOutcome; typedef std::future ListCertOutcomeCallable; typedef std::function&)> ListCertAsyncHandler; @@ -133,6 +145,9 @@ namespace AlibabaCloud typedef Outcome UploadPCACertOutcome; typedef std::future UploadPCACertOutcomeCallable; typedef std::function&)> UploadPCACertAsyncHandler; + typedef Outcome UploadUserCertificateOutcome; + typedef std::future UploadUserCertificateOutcomeCallable; + typedef std::function&)> UploadUserCertificateAsyncHandler; typedef Outcome VerifyOutcome; typedef std::future VerifyOutcomeCallable; typedef std::function&)> VerifyAsyncHandler; @@ -168,6 +183,9 @@ namespace AlibabaCloud DeletePCACertOutcome deletePCACert(const Model::DeletePCACertRequest &request)const; void deletePCACertAsync(const Model::DeletePCACertRequest& request, const DeletePCACertAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeletePCACertOutcomeCallable deletePCACertCallable(const Model::DeletePCACertRequest& request) const; + DeleteUserCertificateOutcome deleteUserCertificate(const Model::DeleteUserCertificateRequest &request)const; + void deleteUserCertificateAsync(const Model::DeleteUserCertificateRequest& request, const DeleteUserCertificateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteUserCertificateOutcomeCallable deleteUserCertificateCallable(const Model::DeleteUserCertificateRequest& request) const; DescribeCertificateStateOutcome describeCertificateState(const Model::DescribeCertificateStateRequest &request)const; void describeCertificateStateAsync(const Model::DescribeCertificateStateRequest& request, const DescribeCertificateStateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeCertificateStateOutcomeCallable describeCertificateStateCallable(const Model::DescribeCertificateStateRequest& request) const; @@ -180,6 +198,9 @@ namespace AlibabaCloud GetCertWarehouseQuotaOutcome getCertWarehouseQuota(const Model::GetCertWarehouseQuotaRequest &request)const; void getCertWarehouseQuotaAsync(const Model::GetCertWarehouseQuotaRequest& request, const GetCertWarehouseQuotaAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetCertWarehouseQuotaOutcomeCallable getCertWarehouseQuotaCallable(const Model::GetCertWarehouseQuotaRequest& request) const; + GetUserCertificateDetailOutcome getUserCertificateDetail(const Model::GetUserCertificateDetailRequest &request)const; + void getUserCertificateDetailAsync(const Model::GetUserCertificateDetailRequest& request, const GetUserCertificateDetailAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetUserCertificateDetailOutcomeCallable getUserCertificateDetailCallable(const Model::GetUserCertificateDetailRequest& request) const; ListCertOutcome listCert(const Model::ListCertRequest &request)const; void listCertAsync(const Model::ListCertRequest& request, const ListCertAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListCertOutcomeCallable listCertCallable(const Model::ListCertRequest& request) const; @@ -201,6 +222,9 @@ namespace AlibabaCloud UploadPCACertOutcome uploadPCACert(const Model::UploadPCACertRequest &request)const; void uploadPCACertAsync(const Model::UploadPCACertRequest& request, const UploadPCACertAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UploadPCACertOutcomeCallable uploadPCACertCallable(const Model::UploadPCACertRequest& request) const; + UploadUserCertificateOutcome uploadUserCertificate(const Model::UploadUserCertificateRequest &request)const; + void uploadUserCertificateAsync(const Model::UploadUserCertificateRequest& request, const UploadUserCertificateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UploadUserCertificateOutcomeCallable uploadUserCertificateCallable(const Model::UploadUserCertificateRequest& request) const; VerifyOutcome verify(const Model::VerifyRequest &request)const; void verifyAsync(const Model::VerifyRequest& request, const VerifyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; VerifyOutcomeCallable verifyCallable(const Model::VerifyRequest& request) const; diff --git a/cas/include/alibabacloud/cas/model/DeleteUserCertificateRequest.h b/cas/include/alibabacloud/cas/model/DeleteUserCertificateRequest.h new file mode 100644 index 000000000..43b01aa7c --- /dev/null +++ b/cas/include/alibabacloud/cas/model/DeleteUserCertificateRequest.h @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CAS_MODEL_DELETEUSERCERTIFICATEREQUEST_H_ +#define ALIBABACLOUD_CAS_MODEL_DELETEUSERCERTIFICATEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Cas { +namespace Model { +class ALIBABACLOUD_CAS_EXPORT DeleteUserCertificateRequest : public RpcServiceRequest { +public: + DeleteUserCertificateRequest(); + ~DeleteUserCertificateRequest(); + long getCertId() const; + void setCertId(long certId); + std::string getSourceIp() const; + void setSourceIp(const std::string &sourceIp); + +private: + long certId_; + std::string sourceIp_; +}; +} // namespace Model +} // namespace Cas +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_CAS_MODEL_DELETEUSERCERTIFICATEREQUEST_H_ diff --git a/cas/include/alibabacloud/cas/model/DeleteUserCertificateResult.h b/cas/include/alibabacloud/cas/model/DeleteUserCertificateResult.h new file mode 100644 index 000000000..4a95b5e7a --- /dev/null +++ b/cas/include/alibabacloud/cas/model/DeleteUserCertificateResult.h @@ -0,0 +1,49 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CAS_MODEL_DELETEUSERCERTIFICATERESULT_H_ +#define ALIBABACLOUD_CAS_MODEL_DELETEUSERCERTIFICATERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Cas + { + namespace Model + { + class ALIBABACLOUD_CAS_EXPORT DeleteUserCertificateResult : public ServiceResult + { + public: + + + DeleteUserCertificateResult(); + explicit DeleteUserCertificateResult(const std::string &payload); + ~DeleteUserCertificateResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_CAS_MODEL_DELETEUSERCERTIFICATERESULT_H_ \ No newline at end of file diff --git a/cas/include/alibabacloud/cas/model/GetUserCertificateDetailRequest.h b/cas/include/alibabacloud/cas/model/GetUserCertificateDetailRequest.h new file mode 100644 index 000000000..bdcb09746 --- /dev/null +++ b/cas/include/alibabacloud/cas/model/GetUserCertificateDetailRequest.h @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CAS_MODEL_GETUSERCERTIFICATEDETAILREQUEST_H_ +#define ALIBABACLOUD_CAS_MODEL_GETUSERCERTIFICATEDETAILREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Cas { +namespace Model { +class ALIBABACLOUD_CAS_EXPORT GetUserCertificateDetailRequest : public RpcServiceRequest { +public: + GetUserCertificateDetailRequest(); + ~GetUserCertificateDetailRequest(); + long getCertId() const; + void setCertId(long certId); + std::string getSourceIp() const; + void setSourceIp(const std::string &sourceIp); + +private: + long certId_; + std::string sourceIp_; +}; +} // namespace Model +} // namespace Cas +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_CAS_MODEL_GETUSERCERTIFICATEDETAILREQUEST_H_ diff --git a/cas/include/alibabacloud/cas/model/GetUserCertificateDetailResult.h b/cas/include/alibabacloud/cas/model/GetUserCertificateDetailResult.h new file mode 100644 index 000000000..61ae717d8 --- /dev/null +++ b/cas/include/alibabacloud/cas/model/GetUserCertificateDetailResult.h @@ -0,0 +1,81 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CAS_MODEL_GETUSERCERTIFICATEDETAILRESULT_H_ +#define ALIBABACLOUD_CAS_MODEL_GETUSERCERTIFICATEDETAILRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Cas + { + namespace Model + { + class ALIBABACLOUD_CAS_EXPORT GetUserCertificateDetailResult : public ServiceResult + { + public: + + + GetUserCertificateDetailResult(); + explicit GetUserCertificateDetailResult(const std::string &payload); + ~GetUserCertificateDetailResult(); + std::string getFingerprint()const; + std::string getIssuer()const; + std::string getOrgName()const; + bool getExpired()const; + std::string getCity()const; + std::string getEndDate()const; + std::string getProvince()const; + std::string getName()const; + std::string getCommon()const; + bool getBuyInAliyun()const; + std::string getStartDate()const; + std::string getSans()const; + std::string getCountry()const; + std::string getCert()const; + long getId()const; + std::string getKey()const; + + protected: + void parse(const std::string &payload); + private: + std::string fingerprint_; + std::string issuer_; + std::string orgName_; + bool expired_; + std::string city_; + std::string endDate_; + std::string province_; + std::string name_; + std::string common_; + bool buyInAliyun_; + std::string startDate_; + std::string sans_; + std::string country_; + std::string cert_; + long id_; + std::string key_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CAS_MODEL_GETUSERCERTIFICATEDETAILRESULT_H_ \ No newline at end of file diff --git a/cas/include/alibabacloud/cas/model/UploadUserCertificateRequest.h b/cas/include/alibabacloud/cas/model/UploadUserCertificateRequest.h new file mode 100644 index 000000000..78848c87b --- /dev/null +++ b/cas/include/alibabacloud/cas/model/UploadUserCertificateRequest.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CAS_MODEL_UPLOADUSERCERTIFICATEREQUEST_H_ +#define ALIBABACLOUD_CAS_MODEL_UPLOADUSERCERTIFICATEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Cas { +namespace Model { +class ALIBABACLOUD_CAS_EXPORT UploadUserCertificateRequest : public RpcServiceRequest { +public: + UploadUserCertificateRequest(); + ~UploadUserCertificateRequest(); + std::string getEncryptCert() const; + void setEncryptCert(const std::string &encryptCert); + std::string getCert() const; + void setCert(const std::string &cert); + std::string getSourceIp() const; + void setSourceIp(const std::string &sourceIp); + std::string getKey() const; + void setKey(const std::string &key); + std::string getEncryptPrivateKey() const; + void setEncryptPrivateKey(const std::string &encryptPrivateKey); + std::string getSignPrivateKey() const; + void setSignPrivateKey(const std::string &signPrivateKey); + std::string getSignCert() const; + void setSignCert(const std::string &signCert); + std::string getName() const; + void setName(const std::string &name); + +private: + std::string encryptCert_; + std::string cert_; + std::string sourceIp_; + std::string key_; + std::string encryptPrivateKey_; + std::string signPrivateKey_; + std::string signCert_; + std::string name_; +}; +} // namespace Model +} // namespace Cas +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_CAS_MODEL_UPLOADUSERCERTIFICATEREQUEST_H_ diff --git a/cas/include/alibabacloud/cas/model/UploadUserCertificateResult.h b/cas/include/alibabacloud/cas/model/UploadUserCertificateResult.h new file mode 100644 index 000000000..039056433 --- /dev/null +++ b/cas/include/alibabacloud/cas/model/UploadUserCertificateResult.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CAS_MODEL_UPLOADUSERCERTIFICATERESULT_H_ +#define ALIBABACLOUD_CAS_MODEL_UPLOADUSERCERTIFICATERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Cas + { + namespace Model + { + class ALIBABACLOUD_CAS_EXPORT UploadUserCertificateResult : public ServiceResult + { + public: + + + UploadUserCertificateResult(); + explicit UploadUserCertificateResult(const std::string &payload); + ~UploadUserCertificateResult(); + long getCertId()const; + + protected: + void parse(const std::string &payload); + private: + long certId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CAS_MODEL_UPLOADUSERCERTIFICATERESULT_H_ \ No newline at end of file diff --git a/cas/src/CasClient.cc b/cas/src/CasClient.cc index 6dbfe4411..269202edd 100644 --- a/cas/src/CasClient.cc +++ b/cas/src/CasClient.cc @@ -375,6 +375,42 @@ CasClient::DeletePCACertOutcomeCallable CasClient::deletePCACertCallable(const D return task->get_future(); } +CasClient::DeleteUserCertificateOutcome CasClient::deleteUserCertificate(const DeleteUserCertificateRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteUserCertificateOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteUserCertificateOutcome(DeleteUserCertificateResult(outcome.result())); + else + return DeleteUserCertificateOutcome(outcome.error()); +} + +void CasClient::deleteUserCertificateAsync(const DeleteUserCertificateRequest& request, const DeleteUserCertificateAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteUserCertificate(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CasClient::DeleteUserCertificateOutcomeCallable CasClient::deleteUserCertificateCallable(const DeleteUserCertificateRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteUserCertificate(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CasClient::DescribeCertificateStateOutcome CasClient::describeCertificateState(const DescribeCertificateStateRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -519,6 +555,42 @@ CasClient::GetCertWarehouseQuotaOutcomeCallable CasClient::getCertWarehouseQuota return task->get_future(); } +CasClient::GetUserCertificateDetailOutcome CasClient::getUserCertificateDetail(const GetUserCertificateDetailRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetUserCertificateDetailOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetUserCertificateDetailOutcome(GetUserCertificateDetailResult(outcome.result())); + else + return GetUserCertificateDetailOutcome(outcome.error()); +} + +void CasClient::getUserCertificateDetailAsync(const GetUserCertificateDetailRequest& request, const GetUserCertificateDetailAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getUserCertificateDetail(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CasClient::GetUserCertificateDetailOutcomeCallable CasClient::getUserCertificateDetailCallable(const GetUserCertificateDetailRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getUserCertificateDetail(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CasClient::ListCertOutcome CasClient::listCert(const ListCertRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -771,6 +843,42 @@ CasClient::UploadPCACertOutcomeCallable CasClient::uploadPCACertCallable(const U return task->get_future(); } +CasClient::UploadUserCertificateOutcome CasClient::uploadUserCertificate(const UploadUserCertificateRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UploadUserCertificateOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UploadUserCertificateOutcome(UploadUserCertificateResult(outcome.result())); + else + return UploadUserCertificateOutcome(outcome.error()); +} + +void CasClient::uploadUserCertificateAsync(const UploadUserCertificateRequest& request, const UploadUserCertificateAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, uploadUserCertificate(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CasClient::UploadUserCertificateOutcomeCallable CasClient::uploadUserCertificateCallable(const UploadUserCertificateRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->uploadUserCertificate(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CasClient::VerifyOutcome CasClient::verify(const VerifyRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/cas/src/model/DeleteUserCertificateRequest.cc b/cas/src/model/DeleteUserCertificateRequest.cc new file mode 100644 index 000000000..e396b6395 --- /dev/null +++ b/cas/src/model/DeleteUserCertificateRequest.cc @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Cas::Model::DeleteUserCertificateRequest; + +DeleteUserCertificateRequest::DeleteUserCertificateRequest() + : RpcServiceRequest("cas", "2020-04-07", "DeleteUserCertificate") { + setMethod(HttpRequest::Method::Post); +} + +DeleteUserCertificateRequest::~DeleteUserCertificateRequest() {} + +long DeleteUserCertificateRequest::getCertId() const { + return certId_; +} + +void DeleteUserCertificateRequest::setCertId(long certId) { + certId_ = certId; + setParameter(std::string("CertId"), std::to_string(certId)); +} + +std::string DeleteUserCertificateRequest::getSourceIp() const { + return sourceIp_; +} + +void DeleteUserCertificateRequest::setSourceIp(const std::string &sourceIp) { + sourceIp_ = sourceIp; + setParameter(std::string("SourceIp"), sourceIp); +} + diff --git a/cas/src/model/DeleteUserCertificateResult.cc b/cas/src/model/DeleteUserCertificateResult.cc new file mode 100644 index 000000000..476709f70 --- /dev/null +++ b/cas/src/model/DeleteUserCertificateResult.cc @@ -0,0 +1,44 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Cas; +using namespace AlibabaCloud::Cas::Model; + +DeleteUserCertificateResult::DeleteUserCertificateResult() : + ServiceResult() +{} + +DeleteUserCertificateResult::DeleteUserCertificateResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteUserCertificateResult::~DeleteUserCertificateResult() +{} + +void DeleteUserCertificateResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/cas/src/model/GetUserCertificateDetailRequest.cc b/cas/src/model/GetUserCertificateDetailRequest.cc new file mode 100644 index 000000000..0d0d99183 --- /dev/null +++ b/cas/src/model/GetUserCertificateDetailRequest.cc @@ -0,0 +1,45 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Cas::Model::GetUserCertificateDetailRequest; + +GetUserCertificateDetailRequest::GetUserCertificateDetailRequest() + : RpcServiceRequest("cas", "2020-04-07", "GetUserCertificateDetail") { + setMethod(HttpRequest::Method::Post); +} + +GetUserCertificateDetailRequest::~GetUserCertificateDetailRequest() {} + +long GetUserCertificateDetailRequest::getCertId() const { + return certId_; +} + +void GetUserCertificateDetailRequest::setCertId(long certId) { + certId_ = certId; + setParameter(std::string("CertId"), std::to_string(certId)); +} + +std::string GetUserCertificateDetailRequest::getSourceIp() const { + return sourceIp_; +} + +void GetUserCertificateDetailRequest::setSourceIp(const std::string &sourceIp) { + sourceIp_ = sourceIp; + setParameter(std::string("SourceIp"), sourceIp); +} + diff --git a/cas/src/model/GetUserCertificateDetailResult.cc b/cas/src/model/GetUserCertificateDetailResult.cc new file mode 100644 index 000000000..52e9591bd --- /dev/null +++ b/cas/src/model/GetUserCertificateDetailResult.cc @@ -0,0 +1,156 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Cas; +using namespace AlibabaCloud::Cas::Model; + +GetUserCertificateDetailResult::GetUserCertificateDetailResult() : + ServiceResult() +{} + +GetUserCertificateDetailResult::GetUserCertificateDetailResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetUserCertificateDetailResult::~GetUserCertificateDetailResult() +{} + +void GetUserCertificateDetailResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Cert"].isNull()) + cert_ = value["Cert"].asString(); + if(!value["Key"].isNull()) + key_ = value["Key"].asString(); + if(!value["Id"].isNull()) + id_ = std::stol(value["Id"].asString()); + if(!value["Name"].isNull()) + name_ = value["Name"].asString(); + if(!value["Common"].isNull()) + common_ = value["Common"].asString(); + if(!value["Fingerprint"].isNull()) + fingerprint_ = value["Fingerprint"].asString(); + if(!value["Issuer"].isNull()) + issuer_ = value["Issuer"].asString(); + if(!value["OrgName"].isNull()) + orgName_ = value["OrgName"].asString(); + if(!value["Province"].isNull()) + province_ = value["Province"].asString(); + if(!value["City"].isNull()) + city_ = value["City"].asString(); + if(!value["Country"].isNull()) + country_ = value["Country"].asString(); + if(!value["StartDate"].isNull()) + startDate_ = value["StartDate"].asString(); + if(!value["EndDate"].isNull()) + endDate_ = value["EndDate"].asString(); + if(!value["Sans"].isNull()) + sans_ = value["Sans"].asString(); + if(!value["Expired"].isNull()) + expired_ = value["Expired"].asString() == "true"; + if(!value["BuyInAliyun"].isNull()) + buyInAliyun_ = value["BuyInAliyun"].asString() == "true"; + +} + +std::string GetUserCertificateDetailResult::getFingerprint()const +{ + return fingerprint_; +} + +std::string GetUserCertificateDetailResult::getIssuer()const +{ + return issuer_; +} + +std::string GetUserCertificateDetailResult::getOrgName()const +{ + return orgName_; +} + +bool GetUserCertificateDetailResult::getExpired()const +{ + return expired_; +} + +std::string GetUserCertificateDetailResult::getCity()const +{ + return city_; +} + +std::string GetUserCertificateDetailResult::getEndDate()const +{ + return endDate_; +} + +std::string GetUserCertificateDetailResult::getProvince()const +{ + return province_; +} + +std::string GetUserCertificateDetailResult::getName()const +{ + return name_; +} + +std::string GetUserCertificateDetailResult::getCommon()const +{ + return common_; +} + +bool GetUserCertificateDetailResult::getBuyInAliyun()const +{ + return buyInAliyun_; +} + +std::string GetUserCertificateDetailResult::getStartDate()const +{ + return startDate_; +} + +std::string GetUserCertificateDetailResult::getSans()const +{ + return sans_; +} + +std::string GetUserCertificateDetailResult::getCountry()const +{ + return country_; +} + +std::string GetUserCertificateDetailResult::getCert()const +{ + return cert_; +} + +long GetUserCertificateDetailResult::getId()const +{ + return id_; +} + +std::string GetUserCertificateDetailResult::getKey()const +{ + return key_; +} + diff --git a/cas/src/model/UploadUserCertificateRequest.cc b/cas/src/model/UploadUserCertificateRequest.cc new file mode 100644 index 000000000..c2d20e913 --- /dev/null +++ b/cas/src/model/UploadUserCertificateRequest.cc @@ -0,0 +1,99 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Cas::Model::UploadUserCertificateRequest; + +UploadUserCertificateRequest::UploadUserCertificateRequest() + : RpcServiceRequest("cas", "2020-04-07", "UploadUserCertificate") { + setMethod(HttpRequest::Method::Post); +} + +UploadUserCertificateRequest::~UploadUserCertificateRequest() {} + +std::string UploadUserCertificateRequest::getEncryptCert() const { + return encryptCert_; +} + +void UploadUserCertificateRequest::setEncryptCert(const std::string &encryptCert) { + encryptCert_ = encryptCert; + setParameter(std::string("EncryptCert"), encryptCert); +} + +std::string UploadUserCertificateRequest::getCert() const { + return cert_; +} + +void UploadUserCertificateRequest::setCert(const std::string &cert) { + cert_ = cert; + setParameter(std::string("Cert"), cert); +} + +std::string UploadUserCertificateRequest::getSourceIp() const { + return sourceIp_; +} + +void UploadUserCertificateRequest::setSourceIp(const std::string &sourceIp) { + sourceIp_ = sourceIp; + setParameter(std::string("SourceIp"), sourceIp); +} + +std::string UploadUserCertificateRequest::getKey() const { + return key_; +} + +void UploadUserCertificateRequest::setKey(const std::string &key) { + key_ = key; + setParameter(std::string("Key"), key); +} + +std::string UploadUserCertificateRequest::getEncryptPrivateKey() const { + return encryptPrivateKey_; +} + +void UploadUserCertificateRequest::setEncryptPrivateKey(const std::string &encryptPrivateKey) { + encryptPrivateKey_ = encryptPrivateKey; + setParameter(std::string("EncryptPrivateKey"), encryptPrivateKey); +} + +std::string UploadUserCertificateRequest::getSignPrivateKey() const { + return signPrivateKey_; +} + +void UploadUserCertificateRequest::setSignPrivateKey(const std::string &signPrivateKey) { + signPrivateKey_ = signPrivateKey; + setParameter(std::string("SignPrivateKey"), signPrivateKey); +} + +std::string UploadUserCertificateRequest::getSignCert() const { + return signCert_; +} + +void UploadUserCertificateRequest::setSignCert(const std::string &signCert) { + signCert_ = signCert; + setParameter(std::string("SignCert"), signCert); +} + +std::string UploadUserCertificateRequest::getName() const { + return name_; +} + +void UploadUserCertificateRequest::setName(const std::string &name) { + name_ = name; + setParameter(std::string("Name"), name); +} + diff --git a/cas/src/model/UploadUserCertificateResult.cc b/cas/src/model/UploadUserCertificateResult.cc new file mode 100644 index 000000000..e992464ab --- /dev/null +++ b/cas/src/model/UploadUserCertificateResult.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Cas; +using namespace AlibabaCloud::Cas::Model; + +UploadUserCertificateResult::UploadUserCertificateResult() : + ServiceResult() +{} + +UploadUserCertificateResult::UploadUserCertificateResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UploadUserCertificateResult::~UploadUserCertificateResult() +{} + +void UploadUserCertificateResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["CertId"].isNull()) + certId_ = std::stol(value["CertId"].asString()); + +} + +long UploadUserCertificateResult::getCertId()const +{ + return certId_; +} +