ClientConfiguration.cc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #include <alibabacloud/core/ClientConfiguration.h>
  17. #include <alibabacloud/core/AlibabaCloud.h>
  18. namespace AlibabaCloud {
  19. ClientConfiguration::ClientConfiguration(const std::string &regionId,
  20. const NetworkProxy &proxy):
  21. regionId_(regionId),
  22. proxy_(proxy),
  23. endpoint_(),
  24. connectTimeout_(kDefaultConnectTimeout),
  25. readTimeout_(kDefaultReadTimeout) {
  26. }
  27. ClientConfiguration::~ClientConfiguration() {
  28. }
  29. std::string ClientConfiguration::endpoint() const {
  30. return endpoint_;
  31. }
  32. NetworkProxy ClientConfiguration::proxy()const {
  33. return proxy_;
  34. }
  35. std::string ClientConfiguration::regionId()const {
  36. return regionId_;
  37. }
  38. void ClientConfiguration::setEndpoint(const std::string & endpoint) {
  39. endpoint_ = endpoint;
  40. }
  41. void ClientConfiguration::setProxy(const NetworkProxy &proxy) {
  42. proxy_ = proxy;
  43. }
  44. void ClientConfiguration::setRegionId(const std::string &regionId) {
  45. regionId_ = regionId;
  46. }
  47. long ClientConfiguration::connectTimeout() const {
  48. return connectTimeout_;
  49. }
  50. long ClientConfiguration::readTimeout() const {
  51. return readTimeout_;
  52. }
  53. void ClientConfiguration::setConnectTimeout(const long connectTimeout) {
  54. connectTimeout_ = connectTimeout;
  55. }
  56. void ClientConfiguration::setReadTimeout(const long readTimeout) {
  57. readTimeout_ = readTimeout;
  58. }
  59. } // namespace AlibabaCloud