api.go 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package sso
  3. import (
  4. "fmt"
  5. "github.com/aws/aws-sdk-go/aws"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/credentials"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/restjson"
  11. )
  12. const opGetRoleCredentials = "GetRoleCredentials"
  13. // GetRoleCredentialsRequest generates a "aws/request.Request" representing the
  14. // client's request for the GetRoleCredentials operation. The "output" return
  15. // value will be populated with the request's response once the request completes
  16. // successfully.
  17. //
  18. // Use "Send" method on the returned Request to send the API call to the service.
  19. // the "output" return value is not valid until after Send returns without error.
  20. //
  21. // See GetRoleCredentials for more information on using the GetRoleCredentials
  22. // API call, and error handling.
  23. //
  24. // This method is useful when you want to inject custom logic or configuration
  25. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  26. //
  27. // // Example sending a request using the GetRoleCredentialsRequest method.
  28. // req, resp := client.GetRoleCredentialsRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. //
  35. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials
  36. func (c *SSO) GetRoleCredentialsRequest(input *GetRoleCredentialsInput) (req *request.Request, output *GetRoleCredentialsOutput) {
  37. op := &request.Operation{
  38. Name: opGetRoleCredentials,
  39. HTTPMethod: "GET",
  40. HTTPPath: "/federation/credentials",
  41. }
  42. if input == nil {
  43. input = &GetRoleCredentialsInput{}
  44. }
  45. output = &GetRoleCredentialsOutput{}
  46. req = c.newRequest(op, input, output)
  47. req.Config.Credentials = credentials.AnonymousCredentials
  48. return
  49. }
  50. // GetRoleCredentials API operation for AWS Single Sign-On.
  51. //
  52. // Returns the STS short-term credentials for a given role name that is assigned
  53. // to the user.
  54. //
  55. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  56. // with awserr.Error's Code and Message methods to get detailed information about
  57. // the error.
  58. //
  59. // See the AWS API reference guide for AWS Single Sign-On's
  60. // API operation GetRoleCredentials for usage and error information.
  61. //
  62. // Returned Error Types:
  63. //
  64. // - InvalidRequestException
  65. // Indicates that a problem occurred with the input to the request. For example,
  66. // a required parameter might be missing or out of range.
  67. //
  68. // - UnauthorizedException
  69. // Indicates that the request is not authorized. This can happen due to an invalid
  70. // access token in the request.
  71. //
  72. // - TooManyRequestsException
  73. // Indicates that the request is being made too frequently and is more than
  74. // what the server can handle.
  75. //
  76. // - ResourceNotFoundException
  77. // The specified resource doesn't exist.
  78. //
  79. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials
  80. func (c *SSO) GetRoleCredentials(input *GetRoleCredentialsInput) (*GetRoleCredentialsOutput, error) {
  81. req, out := c.GetRoleCredentialsRequest(input)
  82. return out, req.Send()
  83. }
  84. // GetRoleCredentialsWithContext is the same as GetRoleCredentials with the addition of
  85. // the ability to pass a context and additional request options.
  86. //
  87. // See GetRoleCredentials for details on how to use this API operation.
  88. //
  89. // The context must be non-nil and will be used for request cancellation. If
  90. // the context is nil a panic will occur. In the future the SDK may create
  91. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  92. // for more information on using Contexts.
  93. func (c *SSO) GetRoleCredentialsWithContext(ctx aws.Context, input *GetRoleCredentialsInput, opts ...request.Option) (*GetRoleCredentialsOutput, error) {
  94. req, out := c.GetRoleCredentialsRequest(input)
  95. req.SetContext(ctx)
  96. req.ApplyOptions(opts...)
  97. return out, req.Send()
  98. }
  99. const opListAccountRoles = "ListAccountRoles"
  100. // ListAccountRolesRequest generates a "aws/request.Request" representing the
  101. // client's request for the ListAccountRoles operation. The "output" return
  102. // value will be populated with the request's response once the request completes
  103. // successfully.
  104. //
  105. // Use "Send" method on the returned Request to send the API call to the service.
  106. // the "output" return value is not valid until after Send returns without error.
  107. //
  108. // See ListAccountRoles for more information on using the ListAccountRoles
  109. // API call, and error handling.
  110. //
  111. // This method is useful when you want to inject custom logic or configuration
  112. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  113. //
  114. // // Example sending a request using the ListAccountRolesRequest method.
  115. // req, resp := client.ListAccountRolesRequest(params)
  116. //
  117. // err := req.Send()
  118. // if err == nil { // resp is now filled
  119. // fmt.Println(resp)
  120. // }
  121. //
  122. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles
  123. func (c *SSO) ListAccountRolesRequest(input *ListAccountRolesInput) (req *request.Request, output *ListAccountRolesOutput) {
  124. op := &request.Operation{
  125. Name: opListAccountRoles,
  126. HTTPMethod: "GET",
  127. HTTPPath: "/assignment/roles",
  128. Paginator: &request.Paginator{
  129. InputTokens: []string{"nextToken"},
  130. OutputTokens: []string{"nextToken"},
  131. LimitToken: "maxResults",
  132. TruncationToken: "",
  133. },
  134. }
  135. if input == nil {
  136. input = &ListAccountRolesInput{}
  137. }
  138. output = &ListAccountRolesOutput{}
  139. req = c.newRequest(op, input, output)
  140. req.Config.Credentials = credentials.AnonymousCredentials
  141. return
  142. }
  143. // ListAccountRoles API operation for AWS Single Sign-On.
  144. //
  145. // Lists all roles that are assigned to the user for a given AWS account.
  146. //
  147. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  148. // with awserr.Error's Code and Message methods to get detailed information about
  149. // the error.
  150. //
  151. // See the AWS API reference guide for AWS Single Sign-On's
  152. // API operation ListAccountRoles for usage and error information.
  153. //
  154. // Returned Error Types:
  155. //
  156. // - InvalidRequestException
  157. // Indicates that a problem occurred with the input to the request. For example,
  158. // a required parameter might be missing or out of range.
  159. //
  160. // - UnauthorizedException
  161. // Indicates that the request is not authorized. This can happen due to an invalid
  162. // access token in the request.
  163. //
  164. // - TooManyRequestsException
  165. // Indicates that the request is being made too frequently and is more than
  166. // what the server can handle.
  167. //
  168. // - ResourceNotFoundException
  169. // The specified resource doesn't exist.
  170. //
  171. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles
  172. func (c *SSO) ListAccountRoles(input *ListAccountRolesInput) (*ListAccountRolesOutput, error) {
  173. req, out := c.ListAccountRolesRequest(input)
  174. return out, req.Send()
  175. }
  176. // ListAccountRolesWithContext is the same as ListAccountRoles with the addition of
  177. // the ability to pass a context and additional request options.
  178. //
  179. // See ListAccountRoles for details on how to use this API operation.
  180. //
  181. // The context must be non-nil and will be used for request cancellation. If
  182. // the context is nil a panic will occur. In the future the SDK may create
  183. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  184. // for more information on using Contexts.
  185. func (c *SSO) ListAccountRolesWithContext(ctx aws.Context, input *ListAccountRolesInput, opts ...request.Option) (*ListAccountRolesOutput, error) {
  186. req, out := c.ListAccountRolesRequest(input)
  187. req.SetContext(ctx)
  188. req.ApplyOptions(opts...)
  189. return out, req.Send()
  190. }
  191. // ListAccountRolesPages iterates over the pages of a ListAccountRoles operation,
  192. // calling the "fn" function with the response data for each page. To stop
  193. // iterating, return false from the fn function.
  194. //
  195. // See ListAccountRoles method for more information on how to use this operation.
  196. //
  197. // Note: This operation can generate multiple requests to a service.
  198. //
  199. // // Example iterating over at most 3 pages of a ListAccountRoles operation.
  200. // pageNum := 0
  201. // err := client.ListAccountRolesPages(params,
  202. // func(page *sso.ListAccountRolesOutput, lastPage bool) bool {
  203. // pageNum++
  204. // fmt.Println(page)
  205. // return pageNum <= 3
  206. // })
  207. func (c *SSO) ListAccountRolesPages(input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool) error {
  208. return c.ListAccountRolesPagesWithContext(aws.BackgroundContext(), input, fn)
  209. }
  210. // ListAccountRolesPagesWithContext same as ListAccountRolesPages except
  211. // it takes a Context and allows setting request options on the pages.
  212. //
  213. // The context must be non-nil and will be used for request cancellation. If
  214. // the context is nil a panic will occur. In the future the SDK may create
  215. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  216. // for more information on using Contexts.
  217. func (c *SSO) ListAccountRolesPagesWithContext(ctx aws.Context, input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool, opts ...request.Option) error {
  218. p := request.Pagination{
  219. NewRequest: func() (*request.Request, error) {
  220. var inCpy *ListAccountRolesInput
  221. if input != nil {
  222. tmp := *input
  223. inCpy = &tmp
  224. }
  225. req, _ := c.ListAccountRolesRequest(inCpy)
  226. req.SetContext(ctx)
  227. req.ApplyOptions(opts...)
  228. return req, nil
  229. },
  230. }
  231. for p.Next() {
  232. if !fn(p.Page().(*ListAccountRolesOutput), !p.HasNextPage()) {
  233. break
  234. }
  235. }
  236. return p.Err()
  237. }
  238. const opListAccounts = "ListAccounts"
  239. // ListAccountsRequest generates a "aws/request.Request" representing the
  240. // client's request for the ListAccounts operation. The "output" return
  241. // value will be populated with the request's response once the request completes
  242. // successfully.
  243. //
  244. // Use "Send" method on the returned Request to send the API call to the service.
  245. // the "output" return value is not valid until after Send returns without error.
  246. //
  247. // See ListAccounts for more information on using the ListAccounts
  248. // API call, and error handling.
  249. //
  250. // This method is useful when you want to inject custom logic or configuration
  251. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  252. //
  253. // // Example sending a request using the ListAccountsRequest method.
  254. // req, resp := client.ListAccountsRequest(params)
  255. //
  256. // err := req.Send()
  257. // if err == nil { // resp is now filled
  258. // fmt.Println(resp)
  259. // }
  260. //
  261. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccounts
  262. func (c *SSO) ListAccountsRequest(input *ListAccountsInput) (req *request.Request, output *ListAccountsOutput) {
  263. op := &request.Operation{
  264. Name: opListAccounts,
  265. HTTPMethod: "GET",
  266. HTTPPath: "/assignment/accounts",
  267. Paginator: &request.Paginator{
  268. InputTokens: []string{"nextToken"},
  269. OutputTokens: []string{"nextToken"},
  270. LimitToken: "maxResults",
  271. TruncationToken: "",
  272. },
  273. }
  274. if input == nil {
  275. input = &ListAccountsInput{}
  276. }
  277. output = &ListAccountsOutput{}
  278. req = c.newRequest(op, input, output)
  279. req.Config.Credentials = credentials.AnonymousCredentials
  280. return
  281. }
  282. // ListAccounts API operation for AWS Single Sign-On.
  283. //
  284. // Lists all AWS accounts assigned to the user. These AWS accounts are assigned
  285. // by the administrator of the account. For more information, see Assign User
  286. // Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers)
  287. // in the IAM Identity Center User Guide. This operation returns a paginated
  288. // response.
  289. //
  290. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  291. // with awserr.Error's Code and Message methods to get detailed information about
  292. // the error.
  293. //
  294. // See the AWS API reference guide for AWS Single Sign-On's
  295. // API operation ListAccounts for usage and error information.
  296. //
  297. // Returned Error Types:
  298. //
  299. // - InvalidRequestException
  300. // Indicates that a problem occurred with the input to the request. For example,
  301. // a required parameter might be missing or out of range.
  302. //
  303. // - UnauthorizedException
  304. // Indicates that the request is not authorized. This can happen due to an invalid
  305. // access token in the request.
  306. //
  307. // - TooManyRequestsException
  308. // Indicates that the request is being made too frequently and is more than
  309. // what the server can handle.
  310. //
  311. // - ResourceNotFoundException
  312. // The specified resource doesn't exist.
  313. //
  314. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccounts
  315. func (c *SSO) ListAccounts(input *ListAccountsInput) (*ListAccountsOutput, error) {
  316. req, out := c.ListAccountsRequest(input)
  317. return out, req.Send()
  318. }
  319. // ListAccountsWithContext is the same as ListAccounts with the addition of
  320. // the ability to pass a context and additional request options.
  321. //
  322. // See ListAccounts for details on how to use this API operation.
  323. //
  324. // The context must be non-nil and will be used for request cancellation. If
  325. // the context is nil a panic will occur. In the future the SDK may create
  326. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  327. // for more information on using Contexts.
  328. func (c *SSO) ListAccountsWithContext(ctx aws.Context, input *ListAccountsInput, opts ...request.Option) (*ListAccountsOutput, error) {
  329. req, out := c.ListAccountsRequest(input)
  330. req.SetContext(ctx)
  331. req.ApplyOptions(opts...)
  332. return out, req.Send()
  333. }
  334. // ListAccountsPages iterates over the pages of a ListAccounts operation,
  335. // calling the "fn" function with the response data for each page. To stop
  336. // iterating, return false from the fn function.
  337. //
  338. // See ListAccounts method for more information on how to use this operation.
  339. //
  340. // Note: This operation can generate multiple requests to a service.
  341. //
  342. // // Example iterating over at most 3 pages of a ListAccounts operation.
  343. // pageNum := 0
  344. // err := client.ListAccountsPages(params,
  345. // func(page *sso.ListAccountsOutput, lastPage bool) bool {
  346. // pageNum++
  347. // fmt.Println(page)
  348. // return pageNum <= 3
  349. // })
  350. func (c *SSO) ListAccountsPages(input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool) error {
  351. return c.ListAccountsPagesWithContext(aws.BackgroundContext(), input, fn)
  352. }
  353. // ListAccountsPagesWithContext same as ListAccountsPages except
  354. // it takes a Context and allows setting request options on the pages.
  355. //
  356. // The context must be non-nil and will be used for request cancellation. If
  357. // the context is nil a panic will occur. In the future the SDK may create
  358. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  359. // for more information on using Contexts.
  360. func (c *SSO) ListAccountsPagesWithContext(ctx aws.Context, input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool, opts ...request.Option) error {
  361. p := request.Pagination{
  362. NewRequest: func() (*request.Request, error) {
  363. var inCpy *ListAccountsInput
  364. if input != nil {
  365. tmp := *input
  366. inCpy = &tmp
  367. }
  368. req, _ := c.ListAccountsRequest(inCpy)
  369. req.SetContext(ctx)
  370. req.ApplyOptions(opts...)
  371. return req, nil
  372. },
  373. }
  374. for p.Next() {
  375. if !fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) {
  376. break
  377. }
  378. }
  379. return p.Err()
  380. }
  381. const opLogout = "Logout"
  382. // LogoutRequest generates a "aws/request.Request" representing the
  383. // client's request for the Logout operation. The "output" return
  384. // value will be populated with the request's response once the request completes
  385. // successfully.
  386. //
  387. // Use "Send" method on the returned Request to send the API call to the service.
  388. // the "output" return value is not valid until after Send returns without error.
  389. //
  390. // See Logout for more information on using the Logout
  391. // API call, and error handling.
  392. //
  393. // This method is useful when you want to inject custom logic or configuration
  394. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  395. //
  396. // // Example sending a request using the LogoutRequest method.
  397. // req, resp := client.LogoutRequest(params)
  398. //
  399. // err := req.Send()
  400. // if err == nil { // resp is now filled
  401. // fmt.Println(resp)
  402. // }
  403. //
  404. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout
  405. func (c *SSO) LogoutRequest(input *LogoutInput) (req *request.Request, output *LogoutOutput) {
  406. op := &request.Operation{
  407. Name: opLogout,
  408. HTTPMethod: "POST",
  409. HTTPPath: "/logout",
  410. }
  411. if input == nil {
  412. input = &LogoutInput{}
  413. }
  414. output = &LogoutOutput{}
  415. req = c.newRequest(op, input, output)
  416. req.Config.Credentials = credentials.AnonymousCredentials
  417. req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  418. return
  419. }
  420. // Logout API operation for AWS Single Sign-On.
  421. //
  422. // Removes the locally stored SSO tokens from the client-side cache and sends
  423. // an API call to the IAM Identity Center service to invalidate the corresponding
  424. // server-side IAM Identity Center sign in session.
  425. //
  426. // If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM
  427. // Identity Center sign in session is used to obtain an IAM session, as specified
  428. // in the corresponding IAM Identity Center permission set. More specifically,
  429. // IAM Identity Center assumes an IAM role in the target account on behalf of
  430. // the user, and the corresponding temporary AWS credentials are returned to
  431. // the client.
  432. //
  433. // After user logout, any existing IAM role sessions that were created by using
  434. // IAM Identity Center permission sets continue based on the duration configured
  435. // in the permission set. For more information, see User authentications (https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html)
  436. // in the IAM Identity Center User Guide.
  437. //
  438. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  439. // with awserr.Error's Code and Message methods to get detailed information about
  440. // the error.
  441. //
  442. // See the AWS API reference guide for AWS Single Sign-On's
  443. // API operation Logout for usage and error information.
  444. //
  445. // Returned Error Types:
  446. //
  447. // - InvalidRequestException
  448. // Indicates that a problem occurred with the input to the request. For example,
  449. // a required parameter might be missing or out of range.
  450. //
  451. // - UnauthorizedException
  452. // Indicates that the request is not authorized. This can happen due to an invalid
  453. // access token in the request.
  454. //
  455. // - TooManyRequestsException
  456. // Indicates that the request is being made too frequently and is more than
  457. // what the server can handle.
  458. //
  459. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout
  460. func (c *SSO) Logout(input *LogoutInput) (*LogoutOutput, error) {
  461. req, out := c.LogoutRequest(input)
  462. return out, req.Send()
  463. }
  464. // LogoutWithContext is the same as Logout with the addition of
  465. // the ability to pass a context and additional request options.
  466. //
  467. // See Logout for details on how to use this API operation.
  468. //
  469. // The context must be non-nil and will be used for request cancellation. If
  470. // the context is nil a panic will occur. In the future the SDK may create
  471. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  472. // for more information on using Contexts.
  473. func (c *SSO) LogoutWithContext(ctx aws.Context, input *LogoutInput, opts ...request.Option) (*LogoutOutput, error) {
  474. req, out := c.LogoutRequest(input)
  475. req.SetContext(ctx)
  476. req.ApplyOptions(opts...)
  477. return out, req.Send()
  478. }
  479. // Provides information about your AWS account.
  480. type AccountInfo struct {
  481. _ struct{} `type:"structure"`
  482. // The identifier of the AWS account that is assigned to the user.
  483. AccountId *string `locationName:"accountId" type:"string"`
  484. // The display name of the AWS account that is assigned to the user.
  485. AccountName *string `locationName:"accountName" type:"string"`
  486. // The email address of the AWS account that is assigned to the user.
  487. EmailAddress *string `locationName:"emailAddress" min:"1" type:"string"`
  488. }
  489. // String returns the string representation.
  490. //
  491. // API parameter values that are decorated as "sensitive" in the API will not
  492. // be included in the string output. The member name will be present, but the
  493. // value will be replaced with "sensitive".
  494. func (s AccountInfo) String() string {
  495. return awsutil.Prettify(s)
  496. }
  497. // GoString returns the string representation.
  498. //
  499. // API parameter values that are decorated as "sensitive" in the API will not
  500. // be included in the string output. The member name will be present, but the
  501. // value will be replaced with "sensitive".
  502. func (s AccountInfo) GoString() string {
  503. return s.String()
  504. }
  505. // SetAccountId sets the AccountId field's value.
  506. func (s *AccountInfo) SetAccountId(v string) *AccountInfo {
  507. s.AccountId = &v
  508. return s
  509. }
  510. // SetAccountName sets the AccountName field's value.
  511. func (s *AccountInfo) SetAccountName(v string) *AccountInfo {
  512. s.AccountName = &v
  513. return s
  514. }
  515. // SetEmailAddress sets the EmailAddress field's value.
  516. func (s *AccountInfo) SetEmailAddress(v string) *AccountInfo {
  517. s.EmailAddress = &v
  518. return s
  519. }
  520. type GetRoleCredentialsInput struct {
  521. _ struct{} `type:"structure" nopayload:"true"`
  522. // The token issued by the CreateToken API call. For more information, see CreateToken
  523. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  524. // in the IAM Identity Center OIDC API Reference Guide.
  525. //
  526. // AccessToken is a sensitive parameter and its value will be
  527. // replaced with "sensitive" in string returned by GetRoleCredentialsInput's
  528. // String and GoString methods.
  529. //
  530. // AccessToken is a required field
  531. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  532. // The identifier for the AWS account that is assigned to the user.
  533. //
  534. // AccountId is a required field
  535. AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"`
  536. // The friendly name of the role that is assigned to the user.
  537. //
  538. // RoleName is a required field
  539. RoleName *string `location:"querystring" locationName:"role_name" type:"string" required:"true"`
  540. }
  541. // String returns the string representation.
  542. //
  543. // API parameter values that are decorated as "sensitive" in the API will not
  544. // be included in the string output. The member name will be present, but the
  545. // value will be replaced with "sensitive".
  546. func (s GetRoleCredentialsInput) String() string {
  547. return awsutil.Prettify(s)
  548. }
  549. // GoString returns the string representation.
  550. //
  551. // API parameter values that are decorated as "sensitive" in the API will not
  552. // be included in the string output. The member name will be present, but the
  553. // value will be replaced with "sensitive".
  554. func (s GetRoleCredentialsInput) GoString() string {
  555. return s.String()
  556. }
  557. // Validate inspects the fields of the type to determine if they are valid.
  558. func (s *GetRoleCredentialsInput) Validate() error {
  559. invalidParams := request.ErrInvalidParams{Context: "GetRoleCredentialsInput"}
  560. if s.AccessToken == nil {
  561. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  562. }
  563. if s.AccountId == nil {
  564. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  565. }
  566. if s.RoleName == nil {
  567. invalidParams.Add(request.NewErrParamRequired("RoleName"))
  568. }
  569. if invalidParams.Len() > 0 {
  570. return invalidParams
  571. }
  572. return nil
  573. }
  574. // SetAccessToken sets the AccessToken field's value.
  575. func (s *GetRoleCredentialsInput) SetAccessToken(v string) *GetRoleCredentialsInput {
  576. s.AccessToken = &v
  577. return s
  578. }
  579. // SetAccountId sets the AccountId field's value.
  580. func (s *GetRoleCredentialsInput) SetAccountId(v string) *GetRoleCredentialsInput {
  581. s.AccountId = &v
  582. return s
  583. }
  584. // SetRoleName sets the RoleName field's value.
  585. func (s *GetRoleCredentialsInput) SetRoleName(v string) *GetRoleCredentialsInput {
  586. s.RoleName = &v
  587. return s
  588. }
  589. type GetRoleCredentialsOutput struct {
  590. _ struct{} `type:"structure"`
  591. // The credentials for the role that is assigned to the user.
  592. RoleCredentials *RoleCredentials `locationName:"roleCredentials" type:"structure"`
  593. }
  594. // String returns the string representation.
  595. //
  596. // API parameter values that are decorated as "sensitive" in the API will not
  597. // be included in the string output. The member name will be present, but the
  598. // value will be replaced with "sensitive".
  599. func (s GetRoleCredentialsOutput) String() string {
  600. return awsutil.Prettify(s)
  601. }
  602. // GoString returns the string representation.
  603. //
  604. // API parameter values that are decorated as "sensitive" in the API will not
  605. // be included in the string output. The member name will be present, but the
  606. // value will be replaced with "sensitive".
  607. func (s GetRoleCredentialsOutput) GoString() string {
  608. return s.String()
  609. }
  610. // SetRoleCredentials sets the RoleCredentials field's value.
  611. func (s *GetRoleCredentialsOutput) SetRoleCredentials(v *RoleCredentials) *GetRoleCredentialsOutput {
  612. s.RoleCredentials = v
  613. return s
  614. }
  615. // Indicates that a problem occurred with the input to the request. For example,
  616. // a required parameter might be missing or out of range.
  617. type InvalidRequestException struct {
  618. _ struct{} `type:"structure"`
  619. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  620. Message_ *string `locationName:"message" type:"string"`
  621. }
  622. // String returns the string representation.
  623. //
  624. // API parameter values that are decorated as "sensitive" in the API will not
  625. // be included in the string output. The member name will be present, but the
  626. // value will be replaced with "sensitive".
  627. func (s InvalidRequestException) String() string {
  628. return awsutil.Prettify(s)
  629. }
  630. // GoString returns the string representation.
  631. //
  632. // API parameter values that are decorated as "sensitive" in the API will not
  633. // be included in the string output. The member name will be present, but the
  634. // value will be replaced with "sensitive".
  635. func (s InvalidRequestException) GoString() string {
  636. return s.String()
  637. }
  638. func newErrorInvalidRequestException(v protocol.ResponseMetadata) error {
  639. return &InvalidRequestException{
  640. RespMetadata: v,
  641. }
  642. }
  643. // Code returns the exception type name.
  644. func (s *InvalidRequestException) Code() string {
  645. return "InvalidRequestException"
  646. }
  647. // Message returns the exception's message.
  648. func (s *InvalidRequestException) Message() string {
  649. if s.Message_ != nil {
  650. return *s.Message_
  651. }
  652. return ""
  653. }
  654. // OrigErr always returns nil, satisfies awserr.Error interface.
  655. func (s *InvalidRequestException) OrigErr() error {
  656. return nil
  657. }
  658. func (s *InvalidRequestException) Error() string {
  659. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  660. }
  661. // Status code returns the HTTP status code for the request's response error.
  662. func (s *InvalidRequestException) StatusCode() int {
  663. return s.RespMetadata.StatusCode
  664. }
  665. // RequestID returns the service's response RequestID for request.
  666. func (s *InvalidRequestException) RequestID() string {
  667. return s.RespMetadata.RequestID
  668. }
  669. type ListAccountRolesInput struct {
  670. _ struct{} `type:"structure" nopayload:"true"`
  671. // The token issued by the CreateToken API call. For more information, see CreateToken
  672. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  673. // in the IAM Identity Center OIDC API Reference Guide.
  674. //
  675. // AccessToken is a sensitive parameter and its value will be
  676. // replaced with "sensitive" in string returned by ListAccountRolesInput's
  677. // String and GoString methods.
  678. //
  679. // AccessToken is a required field
  680. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  681. // The identifier for the AWS account that is assigned to the user.
  682. //
  683. // AccountId is a required field
  684. AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"`
  685. // The number of items that clients can request per page.
  686. MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"`
  687. // The page token from the previous response output when you request subsequent
  688. // pages.
  689. NextToken *string `location:"querystring" locationName:"next_token" type:"string"`
  690. }
  691. // String returns the string representation.
  692. //
  693. // API parameter values that are decorated as "sensitive" in the API will not
  694. // be included in the string output. The member name will be present, but the
  695. // value will be replaced with "sensitive".
  696. func (s ListAccountRolesInput) String() string {
  697. return awsutil.Prettify(s)
  698. }
  699. // GoString returns the string representation.
  700. //
  701. // API parameter values that are decorated as "sensitive" in the API will not
  702. // be included in the string output. The member name will be present, but the
  703. // value will be replaced with "sensitive".
  704. func (s ListAccountRolesInput) GoString() string {
  705. return s.String()
  706. }
  707. // Validate inspects the fields of the type to determine if they are valid.
  708. func (s *ListAccountRolesInput) Validate() error {
  709. invalidParams := request.ErrInvalidParams{Context: "ListAccountRolesInput"}
  710. if s.AccessToken == nil {
  711. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  712. }
  713. if s.AccountId == nil {
  714. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  715. }
  716. if s.MaxResults != nil && *s.MaxResults < 1 {
  717. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  718. }
  719. if invalidParams.Len() > 0 {
  720. return invalidParams
  721. }
  722. return nil
  723. }
  724. // SetAccessToken sets the AccessToken field's value.
  725. func (s *ListAccountRolesInput) SetAccessToken(v string) *ListAccountRolesInput {
  726. s.AccessToken = &v
  727. return s
  728. }
  729. // SetAccountId sets the AccountId field's value.
  730. func (s *ListAccountRolesInput) SetAccountId(v string) *ListAccountRolesInput {
  731. s.AccountId = &v
  732. return s
  733. }
  734. // SetMaxResults sets the MaxResults field's value.
  735. func (s *ListAccountRolesInput) SetMaxResults(v int64) *ListAccountRolesInput {
  736. s.MaxResults = &v
  737. return s
  738. }
  739. // SetNextToken sets the NextToken field's value.
  740. func (s *ListAccountRolesInput) SetNextToken(v string) *ListAccountRolesInput {
  741. s.NextToken = &v
  742. return s
  743. }
  744. type ListAccountRolesOutput struct {
  745. _ struct{} `type:"structure"`
  746. // The page token client that is used to retrieve the list of accounts.
  747. NextToken *string `locationName:"nextToken" type:"string"`
  748. // A paginated response with the list of roles and the next token if more results
  749. // are available.
  750. RoleList []*RoleInfo `locationName:"roleList" type:"list"`
  751. }
  752. // String returns the string representation.
  753. //
  754. // API parameter values that are decorated as "sensitive" in the API will not
  755. // be included in the string output. The member name will be present, but the
  756. // value will be replaced with "sensitive".
  757. func (s ListAccountRolesOutput) String() string {
  758. return awsutil.Prettify(s)
  759. }
  760. // GoString returns the string representation.
  761. //
  762. // API parameter values that are decorated as "sensitive" in the API will not
  763. // be included in the string output. The member name will be present, but the
  764. // value will be replaced with "sensitive".
  765. func (s ListAccountRolesOutput) GoString() string {
  766. return s.String()
  767. }
  768. // SetNextToken sets the NextToken field's value.
  769. func (s *ListAccountRolesOutput) SetNextToken(v string) *ListAccountRolesOutput {
  770. s.NextToken = &v
  771. return s
  772. }
  773. // SetRoleList sets the RoleList field's value.
  774. func (s *ListAccountRolesOutput) SetRoleList(v []*RoleInfo) *ListAccountRolesOutput {
  775. s.RoleList = v
  776. return s
  777. }
  778. type ListAccountsInput struct {
  779. _ struct{} `type:"structure" nopayload:"true"`
  780. // The token issued by the CreateToken API call. For more information, see CreateToken
  781. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  782. // in the IAM Identity Center OIDC API Reference Guide.
  783. //
  784. // AccessToken is a sensitive parameter and its value will be
  785. // replaced with "sensitive" in string returned by ListAccountsInput's
  786. // String and GoString methods.
  787. //
  788. // AccessToken is a required field
  789. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  790. // This is the number of items clients can request per page.
  791. MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"`
  792. // (Optional) When requesting subsequent pages, this is the page token from
  793. // the previous response output.
  794. NextToken *string `location:"querystring" locationName:"next_token" type:"string"`
  795. }
  796. // String returns the string representation.
  797. //
  798. // API parameter values that are decorated as "sensitive" in the API will not
  799. // be included in the string output. The member name will be present, but the
  800. // value will be replaced with "sensitive".
  801. func (s ListAccountsInput) String() string {
  802. return awsutil.Prettify(s)
  803. }
  804. // GoString returns the string representation.
  805. //
  806. // API parameter values that are decorated as "sensitive" in the API will not
  807. // be included in the string output. The member name will be present, but the
  808. // value will be replaced with "sensitive".
  809. func (s ListAccountsInput) GoString() string {
  810. return s.String()
  811. }
  812. // Validate inspects the fields of the type to determine if they are valid.
  813. func (s *ListAccountsInput) Validate() error {
  814. invalidParams := request.ErrInvalidParams{Context: "ListAccountsInput"}
  815. if s.AccessToken == nil {
  816. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  817. }
  818. if s.MaxResults != nil && *s.MaxResults < 1 {
  819. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  820. }
  821. if invalidParams.Len() > 0 {
  822. return invalidParams
  823. }
  824. return nil
  825. }
  826. // SetAccessToken sets the AccessToken field's value.
  827. func (s *ListAccountsInput) SetAccessToken(v string) *ListAccountsInput {
  828. s.AccessToken = &v
  829. return s
  830. }
  831. // SetMaxResults sets the MaxResults field's value.
  832. func (s *ListAccountsInput) SetMaxResults(v int64) *ListAccountsInput {
  833. s.MaxResults = &v
  834. return s
  835. }
  836. // SetNextToken sets the NextToken field's value.
  837. func (s *ListAccountsInput) SetNextToken(v string) *ListAccountsInput {
  838. s.NextToken = &v
  839. return s
  840. }
  841. type ListAccountsOutput struct {
  842. _ struct{} `type:"structure"`
  843. // A paginated response with the list of account information and the next token
  844. // if more results are available.
  845. AccountList []*AccountInfo `locationName:"accountList" type:"list"`
  846. // The page token client that is used to retrieve the list of accounts.
  847. NextToken *string `locationName:"nextToken" type:"string"`
  848. }
  849. // String returns the string representation.
  850. //
  851. // API parameter values that are decorated as "sensitive" in the API will not
  852. // be included in the string output. The member name will be present, but the
  853. // value will be replaced with "sensitive".
  854. func (s ListAccountsOutput) String() string {
  855. return awsutil.Prettify(s)
  856. }
  857. // GoString returns the string representation.
  858. //
  859. // API parameter values that are decorated as "sensitive" in the API will not
  860. // be included in the string output. The member name will be present, but the
  861. // value will be replaced with "sensitive".
  862. func (s ListAccountsOutput) GoString() string {
  863. return s.String()
  864. }
  865. // SetAccountList sets the AccountList field's value.
  866. func (s *ListAccountsOutput) SetAccountList(v []*AccountInfo) *ListAccountsOutput {
  867. s.AccountList = v
  868. return s
  869. }
  870. // SetNextToken sets the NextToken field's value.
  871. func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput {
  872. s.NextToken = &v
  873. return s
  874. }
  875. type LogoutInput struct {
  876. _ struct{} `type:"structure" nopayload:"true"`
  877. // The token issued by the CreateToken API call. For more information, see CreateToken
  878. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  879. // in the IAM Identity Center OIDC API Reference Guide.
  880. //
  881. // AccessToken is a sensitive parameter and its value will be
  882. // replaced with "sensitive" in string returned by LogoutInput's
  883. // String and GoString methods.
  884. //
  885. // AccessToken is a required field
  886. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  887. }
  888. // String returns the string representation.
  889. //
  890. // API parameter values that are decorated as "sensitive" in the API will not
  891. // be included in the string output. The member name will be present, but the
  892. // value will be replaced with "sensitive".
  893. func (s LogoutInput) String() string {
  894. return awsutil.Prettify(s)
  895. }
  896. // GoString returns the string representation.
  897. //
  898. // API parameter values that are decorated as "sensitive" in the API will not
  899. // be included in the string output. The member name will be present, but the
  900. // value will be replaced with "sensitive".
  901. func (s LogoutInput) GoString() string {
  902. return s.String()
  903. }
  904. // Validate inspects the fields of the type to determine if they are valid.
  905. func (s *LogoutInput) Validate() error {
  906. invalidParams := request.ErrInvalidParams{Context: "LogoutInput"}
  907. if s.AccessToken == nil {
  908. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  909. }
  910. if invalidParams.Len() > 0 {
  911. return invalidParams
  912. }
  913. return nil
  914. }
  915. // SetAccessToken sets the AccessToken field's value.
  916. func (s *LogoutInput) SetAccessToken(v string) *LogoutInput {
  917. s.AccessToken = &v
  918. return s
  919. }
  920. type LogoutOutput struct {
  921. _ struct{} `type:"structure"`
  922. }
  923. // String returns the string representation.
  924. //
  925. // API parameter values that are decorated as "sensitive" in the API will not
  926. // be included in the string output. The member name will be present, but the
  927. // value will be replaced with "sensitive".
  928. func (s LogoutOutput) String() string {
  929. return awsutil.Prettify(s)
  930. }
  931. // GoString returns the string representation.
  932. //
  933. // API parameter values that are decorated as "sensitive" in the API will not
  934. // be included in the string output. The member name will be present, but the
  935. // value will be replaced with "sensitive".
  936. func (s LogoutOutput) GoString() string {
  937. return s.String()
  938. }
  939. // The specified resource doesn't exist.
  940. type ResourceNotFoundException struct {
  941. _ struct{} `type:"structure"`
  942. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  943. Message_ *string `locationName:"message" type:"string"`
  944. }
  945. // String returns the string representation.
  946. //
  947. // API parameter values that are decorated as "sensitive" in the API will not
  948. // be included in the string output. The member name will be present, but the
  949. // value will be replaced with "sensitive".
  950. func (s ResourceNotFoundException) String() string {
  951. return awsutil.Prettify(s)
  952. }
  953. // GoString returns the string representation.
  954. //
  955. // API parameter values that are decorated as "sensitive" in the API will not
  956. // be included in the string output. The member name will be present, but the
  957. // value will be replaced with "sensitive".
  958. func (s ResourceNotFoundException) GoString() string {
  959. return s.String()
  960. }
  961. func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error {
  962. return &ResourceNotFoundException{
  963. RespMetadata: v,
  964. }
  965. }
  966. // Code returns the exception type name.
  967. func (s *ResourceNotFoundException) Code() string {
  968. return "ResourceNotFoundException"
  969. }
  970. // Message returns the exception's message.
  971. func (s *ResourceNotFoundException) Message() string {
  972. if s.Message_ != nil {
  973. return *s.Message_
  974. }
  975. return ""
  976. }
  977. // OrigErr always returns nil, satisfies awserr.Error interface.
  978. func (s *ResourceNotFoundException) OrigErr() error {
  979. return nil
  980. }
  981. func (s *ResourceNotFoundException) Error() string {
  982. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  983. }
  984. // Status code returns the HTTP status code for the request's response error.
  985. func (s *ResourceNotFoundException) StatusCode() int {
  986. return s.RespMetadata.StatusCode
  987. }
  988. // RequestID returns the service's response RequestID for request.
  989. func (s *ResourceNotFoundException) RequestID() string {
  990. return s.RespMetadata.RequestID
  991. }
  992. // Provides information about the role credentials that are assigned to the
  993. // user.
  994. type RoleCredentials struct {
  995. _ struct{} `type:"structure"`
  996. // The identifier used for the temporary security credentials. For more information,
  997. // see Using Temporary Security Credentials to Request Access to AWS Resources
  998. // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
  999. // in the AWS IAM User Guide.
  1000. AccessKeyId *string `locationName:"accessKeyId" type:"string"`
  1001. // The date on which temporary security credentials expire.
  1002. Expiration *int64 `locationName:"expiration" type:"long"`
  1003. // The key that is used to sign the request. For more information, see Using
  1004. // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
  1005. // in the AWS IAM User Guide.
  1006. //
  1007. // SecretAccessKey is a sensitive parameter and its value will be
  1008. // replaced with "sensitive" in string returned by RoleCredentials's
  1009. // String and GoString methods.
  1010. SecretAccessKey *string `locationName:"secretAccessKey" type:"string" sensitive:"true"`
  1011. // The token used for temporary credentials. For more information, see Using
  1012. // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
  1013. // in the AWS IAM User Guide.
  1014. //
  1015. // SessionToken is a sensitive parameter and its value will be
  1016. // replaced with "sensitive" in string returned by RoleCredentials's
  1017. // String and GoString methods.
  1018. SessionToken *string `locationName:"sessionToken" type:"string" sensitive:"true"`
  1019. }
  1020. // String returns the string representation.
  1021. //
  1022. // API parameter values that are decorated as "sensitive" in the API will not
  1023. // be included in the string output. The member name will be present, but the
  1024. // value will be replaced with "sensitive".
  1025. func (s RoleCredentials) String() string {
  1026. return awsutil.Prettify(s)
  1027. }
  1028. // GoString returns the string representation.
  1029. //
  1030. // API parameter values that are decorated as "sensitive" in the API will not
  1031. // be included in the string output. The member name will be present, but the
  1032. // value will be replaced with "sensitive".
  1033. func (s RoleCredentials) GoString() string {
  1034. return s.String()
  1035. }
  1036. // SetAccessKeyId sets the AccessKeyId field's value.
  1037. func (s *RoleCredentials) SetAccessKeyId(v string) *RoleCredentials {
  1038. s.AccessKeyId = &v
  1039. return s
  1040. }
  1041. // SetExpiration sets the Expiration field's value.
  1042. func (s *RoleCredentials) SetExpiration(v int64) *RoleCredentials {
  1043. s.Expiration = &v
  1044. return s
  1045. }
  1046. // SetSecretAccessKey sets the SecretAccessKey field's value.
  1047. func (s *RoleCredentials) SetSecretAccessKey(v string) *RoleCredentials {
  1048. s.SecretAccessKey = &v
  1049. return s
  1050. }
  1051. // SetSessionToken sets the SessionToken field's value.
  1052. func (s *RoleCredentials) SetSessionToken(v string) *RoleCredentials {
  1053. s.SessionToken = &v
  1054. return s
  1055. }
  1056. // Provides information about the role that is assigned to the user.
  1057. type RoleInfo struct {
  1058. _ struct{} `type:"structure"`
  1059. // The identifier of the AWS account assigned to the user.
  1060. AccountId *string `locationName:"accountId" type:"string"`
  1061. // The friendly name of the role that is assigned to the user.
  1062. RoleName *string `locationName:"roleName" type:"string"`
  1063. }
  1064. // String returns the string representation.
  1065. //
  1066. // API parameter values that are decorated as "sensitive" in the API will not
  1067. // be included in the string output. The member name will be present, but the
  1068. // value will be replaced with "sensitive".
  1069. func (s RoleInfo) String() string {
  1070. return awsutil.Prettify(s)
  1071. }
  1072. // GoString returns the string representation.
  1073. //
  1074. // API parameter values that are decorated as "sensitive" in the API will not
  1075. // be included in the string output. The member name will be present, but the
  1076. // value will be replaced with "sensitive".
  1077. func (s RoleInfo) GoString() string {
  1078. return s.String()
  1079. }
  1080. // SetAccountId sets the AccountId field's value.
  1081. func (s *RoleInfo) SetAccountId(v string) *RoleInfo {
  1082. s.AccountId = &v
  1083. return s
  1084. }
  1085. // SetRoleName sets the RoleName field's value.
  1086. func (s *RoleInfo) SetRoleName(v string) *RoleInfo {
  1087. s.RoleName = &v
  1088. return s
  1089. }
  1090. // Indicates that the request is being made too frequently and is more than
  1091. // what the server can handle.
  1092. type TooManyRequestsException struct {
  1093. _ struct{} `type:"structure"`
  1094. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  1095. Message_ *string `locationName:"message" type:"string"`
  1096. }
  1097. // String returns the string representation.
  1098. //
  1099. // API parameter values that are decorated as "sensitive" in the API will not
  1100. // be included in the string output. The member name will be present, but the
  1101. // value will be replaced with "sensitive".
  1102. func (s TooManyRequestsException) String() string {
  1103. return awsutil.Prettify(s)
  1104. }
  1105. // GoString returns the string representation.
  1106. //
  1107. // API parameter values that are decorated as "sensitive" in the API will not
  1108. // be included in the string output. The member name will be present, but the
  1109. // value will be replaced with "sensitive".
  1110. func (s TooManyRequestsException) GoString() string {
  1111. return s.String()
  1112. }
  1113. func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error {
  1114. return &TooManyRequestsException{
  1115. RespMetadata: v,
  1116. }
  1117. }
  1118. // Code returns the exception type name.
  1119. func (s *TooManyRequestsException) Code() string {
  1120. return "TooManyRequestsException"
  1121. }
  1122. // Message returns the exception's message.
  1123. func (s *TooManyRequestsException) Message() string {
  1124. if s.Message_ != nil {
  1125. return *s.Message_
  1126. }
  1127. return ""
  1128. }
  1129. // OrigErr always returns nil, satisfies awserr.Error interface.
  1130. func (s *TooManyRequestsException) OrigErr() error {
  1131. return nil
  1132. }
  1133. func (s *TooManyRequestsException) Error() string {
  1134. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  1135. }
  1136. // Status code returns the HTTP status code for the request's response error.
  1137. func (s *TooManyRequestsException) StatusCode() int {
  1138. return s.RespMetadata.StatusCode
  1139. }
  1140. // RequestID returns the service's response RequestID for request.
  1141. func (s *TooManyRequestsException) RequestID() string {
  1142. return s.RespMetadata.RequestID
  1143. }
  1144. // Indicates that the request is not authorized. This can happen due to an invalid
  1145. // access token in the request.
  1146. type UnauthorizedException struct {
  1147. _ struct{} `type:"structure"`
  1148. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  1149. Message_ *string `locationName:"message" type:"string"`
  1150. }
  1151. // String returns the string representation.
  1152. //
  1153. // API parameter values that are decorated as "sensitive" in the API will not
  1154. // be included in the string output. The member name will be present, but the
  1155. // value will be replaced with "sensitive".
  1156. func (s UnauthorizedException) String() string {
  1157. return awsutil.Prettify(s)
  1158. }
  1159. // GoString returns the string representation.
  1160. //
  1161. // API parameter values that are decorated as "sensitive" in the API will not
  1162. // be included in the string output. The member name will be present, but the
  1163. // value will be replaced with "sensitive".
  1164. func (s UnauthorizedException) GoString() string {
  1165. return s.String()
  1166. }
  1167. func newErrorUnauthorizedException(v protocol.ResponseMetadata) error {
  1168. return &UnauthorizedException{
  1169. RespMetadata: v,
  1170. }
  1171. }
  1172. // Code returns the exception type name.
  1173. func (s *UnauthorizedException) Code() string {
  1174. return "UnauthorizedException"
  1175. }
  1176. // Message returns the exception's message.
  1177. func (s *UnauthorizedException) Message() string {
  1178. if s.Message_ != nil {
  1179. return *s.Message_
  1180. }
  1181. return ""
  1182. }
  1183. // OrigErr always returns nil, satisfies awserr.Error interface.
  1184. func (s *UnauthorizedException) OrigErr() error {
  1185. return nil
  1186. }
  1187. func (s *UnauthorizedException) Error() string {
  1188. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  1189. }
  1190. // Status code returns the HTTP status code for the request's response error.
  1191. func (s *UnauthorizedException) StatusCode() int {
  1192. return s.RespMetadata.StatusCode
  1193. }
  1194. // RequestID returns the service's response RequestID for request.
  1195. func (s *UnauthorizedException) RequestID() string {
  1196. return s.RespMetadata.RequestID
  1197. }