1 /* 2 * Copyright 1999-2019 Alibaba Cloud All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef CORE_INCLUDE_ALIBABACLOUD_CORE_CLIENTCONFIGURATION_H_ 18 #define CORE_INCLUDE_ALIBABACLOUD_CORE_CLIENTCONFIGURATION_H_ 19 20 #include "CoreExport.h" 21 #include "CredentialsProvider.h" 22 #include "NetworkProxy.h" 23 #include "Signer.h" 24 #include <memory> 25 #include <string> 26 27 namespace AlibabaCloud { 28 class ALIBABACLOUD_CORE_EXPORT ClientConfiguration { 29 public: 30 explicit ClientConfiguration(const std::string ®ionId = "cn-hangzhou", 31 const NetworkProxy &proxy = NetworkProxy()); 32 ~ClientConfiguration(); 33 34 std::string endpoint() const; 35 NetworkProxy proxy() const; 36 std::string regionId() const; 37 void setEndpoint(const std::string &endpoint); 38 void setProxy(const NetworkProxy &proxy); 39 void setRegionId(const std::string ®ionId); 40 41 long connectTimeout() const; 42 long readTimeout() const; 43 void setConnectTimeout(const long connectTimeout); 44 void setReadTimeout(const long readTimeout); 45 46 bool rejectUnauthorized() const; 47 void setRejectUnauthorized(const bool rejectUnauthorized); 48 49 private: 50 std::string endpoint_; 51 NetworkProxy proxy_; 52 std::string regionId_; 53 long connectTimeout_; 54 long readTimeout_; 55 bool rejectUnauthorized_ = true; 56 }; 57 } // namespace AlibabaCloud 58 59 #endif // CORE_INCLUDE_ALIBABACLOUD_CORE_CLIENTCONFIGURATION_H_ 60