Credentials.cc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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), accessKeySecret_(accessKeySecret),
  22. sessionToken_(sessionToken) {}
  23. Credentials::~Credentials() {}
  24. std::string Credentials::accessKeyId() const { return accessKeyId_; }
  25. std::string Credentials::accessKeySecret() const { return accessKeySecret_; }
  26. void Credentials::setAccessKeyId(const std::string &accessKeyId) {
  27. accessKeyId_ = accessKeyId;
  28. }
  29. void Credentials::setAccessKeySecret(const std::string &accessKeySecret) {
  30. accessKeySecret_ = accessKeySecret;
  31. }
  32. void Credentials::setSessionToken(const std::string &sessionToken) {
  33. sessionToken_ = sessionToken;
  34. }
  35. std::string Credentials::sessionToken() const { return sessionToken_; }
  36. } // namespace AlibabaCloud