Credentials.cc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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/Credentials.h>
  17. namespace AlibabaCloud {
  18. Credentials::Credentials(const std::string &accessKeyId,
  19. const std::string &accessKeySecret,
  20. const std::string &sessionToken) :
  21. accessKeyId_(accessKeyId),
  22. accessKeySecret_(accessKeySecret),
  23. sessionToken_(sessionToken) {
  24. }
  25. Credentials::~Credentials() {
  26. }
  27. std::string Credentials::accessKeyId() const {
  28. return accessKeyId_;
  29. }
  30. std::string Credentials::accessKeySecret() const {
  31. return accessKeySecret_;
  32. }
  33. void Credentials::setAccessKeyId(const std::string &accessKeyId) {
  34. accessKeyId_ = accessKeyId;
  35. }
  36. void Credentials::setAccessKeySecret(const std::string &accessKeySecret) {
  37. accessKeySecret_ = accessKeySecret;
  38. }
  39. void Credentials::setSessionToken(const std::string &sessionToken) {
  40. sessionToken_ = sessionToken;
  41. }
  42. std::string Credentials::sessionToken() const {
  43. return sessionToken_;
  44. }
  45. } // namespace AlibabaCloud