Credentials.cc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2009-2017 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. using 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. }
  26. Credentials::~Credentials()
  27. {
  28. }
  29. std::string Credentials::accessKeyId () const
  30. {
  31. return accessKeyId_;
  32. }
  33. std::string Credentials::accessKeySecret () const
  34. {
  35. return accessKeySecret_;
  36. }
  37. void Credentials::setAccessKeyId(const std::string &accessKeyId)
  38. {
  39. accessKeyId_ = accessKeyId;
  40. }
  41. void Credentials::setAccessKeySecret(const std::string &accessKeySecret)
  42. {
  43. accessKeySecret_ = accessKeySecret;
  44. }
  45. void Credentials::setSessionToken (const std::string &sessionToken)
  46. {
  47. sessionToken_ = sessionToken;
  48. }
  49. std::string Credentials::sessionToken () const
  50. {
  51. return sessionToken_;
  52. }