No Description

AWSSTSModel.m 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. //
  2. // Copyright 2010-2019 Amazon.com, Inc. or its affiliates. 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. // A copy of the License is located at
  7. //
  8. // http://aws.amazon.com/apache2.0
  9. //
  10. // or in the "license" file accompanying this file. This file is distributed
  11. // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. // express or implied. See the License for the specific language governing
  13. // permissions and limitations under the License.
  14. //
  15. #import "AWSSTSModel.h"
  16. #import "AWSCategory.h"
  17. NSString *const AWSSTSErrorDomain = @"com.amazonaws.AWSSTSErrorDomain";
  18. @implementation AWSSTSAssumeRoleRequest
  19. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  20. return @{
  21. @"durationSeconds" : @"DurationSeconds",
  22. @"externalId" : @"ExternalId",
  23. @"policy" : @"Policy",
  24. @"roleArn" : @"RoleArn",
  25. @"roleSessionName" : @"RoleSessionName",
  26. @"serialNumber" : @"SerialNumber",
  27. @"tokenCode" : @"TokenCode",
  28. };
  29. }
  30. @end
  31. @implementation AWSSTSAssumeRoleResponse
  32. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  33. return @{
  34. @"assumedRoleUser" : @"AssumedRoleUser",
  35. @"credentials" : @"Credentials",
  36. @"packedPolicySize" : @"PackedPolicySize",
  37. };
  38. }
  39. + (NSValueTransformer *)assumedRoleUserJSONTransformer {
  40. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSAssumedRoleUser class]];
  41. }
  42. + (NSValueTransformer *)credentialsJSONTransformer {
  43. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSCredentials class]];
  44. }
  45. @end
  46. @implementation AWSSTSAssumeRoleWithSAMLRequest
  47. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  48. return @{
  49. @"durationSeconds" : @"DurationSeconds",
  50. @"policy" : @"Policy",
  51. @"principalArn" : @"PrincipalArn",
  52. @"roleArn" : @"RoleArn",
  53. @"SAMLAssertion" : @"SAMLAssertion",
  54. };
  55. }
  56. @end
  57. @implementation AWSSTSAssumeRoleWithSAMLResponse
  58. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  59. return @{
  60. @"assumedRoleUser" : @"AssumedRoleUser",
  61. @"audience" : @"Audience",
  62. @"credentials" : @"Credentials",
  63. @"issuer" : @"Issuer",
  64. @"nameQualifier" : @"NameQualifier",
  65. @"packedPolicySize" : @"PackedPolicySize",
  66. @"subject" : @"Subject",
  67. @"subjectType" : @"SubjectType",
  68. };
  69. }
  70. + (NSValueTransformer *)assumedRoleUserJSONTransformer {
  71. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSAssumedRoleUser class]];
  72. }
  73. + (NSValueTransformer *)credentialsJSONTransformer {
  74. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSCredentials class]];
  75. }
  76. @end
  77. @implementation AWSSTSAssumeRoleWithWebIdentityRequest
  78. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  79. return @{
  80. @"durationSeconds" : @"DurationSeconds",
  81. @"policy" : @"Policy",
  82. @"providerId" : @"ProviderId",
  83. @"roleArn" : @"RoleArn",
  84. @"roleSessionName" : @"RoleSessionName",
  85. @"webIdentityToken" : @"WebIdentityToken",
  86. };
  87. }
  88. @end
  89. @implementation AWSSTSAssumeRoleWithWebIdentityResponse
  90. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  91. return @{
  92. @"assumedRoleUser" : @"AssumedRoleUser",
  93. @"audience" : @"Audience",
  94. @"credentials" : @"Credentials",
  95. @"packedPolicySize" : @"PackedPolicySize",
  96. @"provider" : @"Provider",
  97. @"subjectFromWebIdentityToken" : @"SubjectFromWebIdentityToken",
  98. };
  99. }
  100. + (NSValueTransformer *)assumedRoleUserJSONTransformer {
  101. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSAssumedRoleUser class]];
  102. }
  103. + (NSValueTransformer *)credentialsJSONTransformer {
  104. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSCredentials class]];
  105. }
  106. @end
  107. @implementation AWSSTSAssumedRoleUser
  108. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  109. return @{
  110. @"arn" : @"Arn",
  111. @"assumedRoleId" : @"AssumedRoleId",
  112. };
  113. }
  114. @end
  115. @implementation AWSSTSCredentials
  116. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  117. return @{
  118. @"accessKeyId" : @"AccessKeyId",
  119. @"expiration" : @"Expiration",
  120. @"secretAccessKey" : @"SecretAccessKey",
  121. @"sessionToken" : @"SessionToken",
  122. };
  123. }
  124. + (NSValueTransformer *)expirationJSONTransformer {
  125. return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *str) {
  126. return [NSDate aws_dateFromString:str];
  127. } reverseBlock:^id(NSDate *date) {
  128. return [date aws_stringValue:AWSDateISO8601DateFormat1];
  129. }];
  130. }
  131. @end
  132. @implementation AWSSTSDecodeAuthorizationMessageRequest
  133. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  134. return @{
  135. @"encodedMessage" : @"EncodedMessage",
  136. };
  137. }
  138. @end
  139. @implementation AWSSTSDecodeAuthorizationMessageResponse
  140. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  141. return @{
  142. @"decodedMessage" : @"DecodedMessage",
  143. };
  144. }
  145. @end
  146. @implementation AWSSTSFederatedUser
  147. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  148. return @{
  149. @"arn" : @"Arn",
  150. @"federatedUserId" : @"FederatedUserId",
  151. };
  152. }
  153. @end
  154. @implementation AWSSTSGetCallerIdentityRequest
  155. @end
  156. @implementation AWSSTSGetCallerIdentityResponse
  157. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  158. return @{
  159. @"account" : @"Account",
  160. @"arn" : @"Arn",
  161. @"userId" : @"UserId",
  162. };
  163. }
  164. @end
  165. @implementation AWSSTSGetFederationTokenRequest
  166. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  167. return @{
  168. @"durationSeconds" : @"DurationSeconds",
  169. @"name" : @"Name",
  170. @"policy" : @"Policy",
  171. };
  172. }
  173. @end
  174. @implementation AWSSTSGetFederationTokenResponse
  175. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  176. return @{
  177. @"credentials" : @"Credentials",
  178. @"federatedUser" : @"FederatedUser",
  179. @"packedPolicySize" : @"PackedPolicySize",
  180. };
  181. }
  182. + (NSValueTransformer *)credentialsJSONTransformer {
  183. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSCredentials class]];
  184. }
  185. + (NSValueTransformer *)federatedUserJSONTransformer {
  186. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSFederatedUser class]];
  187. }
  188. @end
  189. @implementation AWSSTSGetSessionTokenRequest
  190. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  191. return @{
  192. @"durationSeconds" : @"DurationSeconds",
  193. @"serialNumber" : @"SerialNumber",
  194. @"tokenCode" : @"TokenCode",
  195. };
  196. }
  197. @end
  198. @implementation AWSSTSGetSessionTokenResponse
  199. + (NSDictionary *)JSONKeyPathsByPropertyKey {
  200. return @{
  201. @"credentials" : @"Credentials",
  202. };
  203. }
  204. + (NSValueTransformer *)credentialsJSONTransformer {
  205. return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSSTSCredentials class]];
  206. }
  207. @end