NetworkProxy.cc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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/NetworkProxy.h>
  17. namespace AlibabaCloud {
  18. NetworkProxy::NetworkProxy(Type type,
  19. const std::string &hostName,
  20. uint16_t port,
  21. const std::string &user,
  22. const std::string &password)
  23. : hostName_(hostName),
  24. password_(password),
  25. port_(port),
  26. type_(type),
  27. user_(user) {
  28. }
  29. NetworkProxy::~NetworkProxy() {
  30. }
  31. std::string NetworkProxy::hostName() const {
  32. return hostName_;
  33. }
  34. std::string NetworkProxy::password() const {
  35. return password_;
  36. }
  37. uint16_t NetworkProxy::port() const {
  38. return port_;
  39. }
  40. void NetworkProxy::setHostName(const std::string &hostName) {
  41. hostName_ = hostName;
  42. }
  43. void NetworkProxy::setPassword(const std::string &password) {
  44. password_ = password;
  45. }
  46. void NetworkProxy::setPort(uint16_t port) {
  47. port_ = port;
  48. }
  49. void NetworkProxy::setType(NetworkProxy::Type type) {
  50. type_ = type;
  51. }
  52. void NetworkProxy::setUser(const std::string &user) {
  53. user_ = user;
  54. }
  55. NetworkProxy::Type NetworkProxy::type() const {
  56. return type_;
  57. }
  58. std::string NetworkProxy::user() const {
  59. return user_;
  60. }
  61. } // namespace AlibabaCloud