api.go 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  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. //
  28. // // Example sending a request using the GetRoleCredentialsRequest method.
  29. // req, resp := client.GetRoleCredentialsRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/GetRoleCredentials
  37. func (c *SSO) GetRoleCredentialsRequest(input *GetRoleCredentialsInput) (req *request.Request, output *GetRoleCredentialsOutput) {
  38. op := &request.Operation{
  39. Name: opGetRoleCredentials,
  40. HTTPMethod: "GET",
  41. HTTPPath: "/federation/credentials",
  42. }
  43. if input == nil {
  44. input = &GetRoleCredentialsInput{}
  45. }
  46. output = &GetRoleCredentialsOutput{}
  47. req = c.newRequest(op, input, output)
  48. req.Config.Credentials = credentials.AnonymousCredentials
  49. return
  50. }
  51. // GetRoleCredentials API operation for AWS Single Sign-On.
  52. //
  53. // Returns the STS short-term credentials for a given role name that is assigned
  54. // to the user.
  55. //
  56. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  57. // with awserr.Error's Code and Message methods to get detailed information about
  58. // the error.
  59. //
  60. // See the AWS API reference guide for AWS Single Sign-On's
  61. // API operation GetRoleCredentials for usage and error information.
  62. //
  63. // Returned Error Types:
  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. //
  115. // // Example sending a request using the ListAccountRolesRequest method.
  116. // req, resp := client.ListAccountRolesRequest(params)
  117. //
  118. // err := req.Send()
  119. // if err == nil { // resp is now filled
  120. // fmt.Println(resp)
  121. // }
  122. //
  123. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccountRoles
  124. func (c *SSO) ListAccountRolesRequest(input *ListAccountRolesInput) (req *request.Request, output *ListAccountRolesOutput) {
  125. op := &request.Operation{
  126. Name: opListAccountRoles,
  127. HTTPMethod: "GET",
  128. HTTPPath: "/assignment/roles",
  129. Paginator: &request.Paginator{
  130. InputTokens: []string{"nextToken"},
  131. OutputTokens: []string{"nextToken"},
  132. LimitToken: "maxResults",
  133. TruncationToken: "",
  134. },
  135. }
  136. if input == nil {
  137. input = &ListAccountRolesInput{}
  138. }
  139. output = &ListAccountRolesOutput{}
  140. req = c.newRequest(op, input, output)
  141. req.Config.Credentials = credentials.AnonymousCredentials
  142. return
  143. }
  144. // ListAccountRoles API operation for AWS Single Sign-On.
  145. //
  146. // Lists all roles that are assigned to the user for a given AWS account.
  147. //
  148. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  149. // with awserr.Error's Code and Message methods to get detailed information about
  150. // the error.
  151. //
  152. // See the AWS API reference guide for AWS Single Sign-On's
  153. // API operation ListAccountRoles for usage and error information.
  154. //
  155. // Returned Error Types:
  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. //
  208. func (c *SSO) ListAccountRolesPages(input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool) error {
  209. return c.ListAccountRolesPagesWithContext(aws.BackgroundContext(), input, fn)
  210. }
  211. // ListAccountRolesPagesWithContext same as ListAccountRolesPages except
  212. // it takes a Context and allows setting request options on the pages.
  213. //
  214. // The context must be non-nil and will be used for request cancellation. If
  215. // the context is nil a panic will occur. In the future the SDK may create
  216. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  217. // for more information on using Contexts.
  218. func (c *SSO) ListAccountRolesPagesWithContext(ctx aws.Context, input *ListAccountRolesInput, fn func(*ListAccountRolesOutput, bool) bool, opts ...request.Option) error {
  219. p := request.Pagination{
  220. NewRequest: func() (*request.Request, error) {
  221. var inCpy *ListAccountRolesInput
  222. if input != nil {
  223. tmp := *input
  224. inCpy = &tmp
  225. }
  226. req, _ := c.ListAccountRolesRequest(inCpy)
  227. req.SetContext(ctx)
  228. req.ApplyOptions(opts...)
  229. return req, nil
  230. },
  231. }
  232. for p.Next() {
  233. if !fn(p.Page().(*ListAccountRolesOutput), !p.HasNextPage()) {
  234. break
  235. }
  236. }
  237. return p.Err()
  238. }
  239. const opListAccounts = "ListAccounts"
  240. // ListAccountsRequest generates a "aws/request.Request" representing the
  241. // client's request for the ListAccounts operation. The "output" return
  242. // value will be populated with the request's response once the request completes
  243. // successfully.
  244. //
  245. // Use "Send" method on the returned Request to send the API call to the service.
  246. // the "output" return value is not valid until after Send returns without error.
  247. //
  248. // See ListAccounts for more information on using the ListAccounts
  249. // API call, and error handling.
  250. //
  251. // This method is useful when you want to inject custom logic or configuration
  252. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  253. //
  254. //
  255. // // Example sending a request using the ListAccountsRequest method.
  256. // req, resp := client.ListAccountsRequest(params)
  257. //
  258. // err := req.Send()
  259. // if err == nil { // resp is now filled
  260. // fmt.Println(resp)
  261. // }
  262. //
  263. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/ListAccounts
  264. func (c *SSO) ListAccountsRequest(input *ListAccountsInput) (req *request.Request, output *ListAccountsOutput) {
  265. op := &request.Operation{
  266. Name: opListAccounts,
  267. HTTPMethod: "GET",
  268. HTTPPath: "/assignment/accounts",
  269. Paginator: &request.Paginator{
  270. InputTokens: []string{"nextToken"},
  271. OutputTokens: []string{"nextToken"},
  272. LimitToken: "maxResults",
  273. TruncationToken: "",
  274. },
  275. }
  276. if input == nil {
  277. input = &ListAccountsInput{}
  278. }
  279. output = &ListAccountsOutput{}
  280. req = c.newRequest(op, input, output)
  281. req.Config.Credentials = credentials.AnonymousCredentials
  282. return
  283. }
  284. // ListAccounts API operation for AWS Single Sign-On.
  285. //
  286. // Lists all AWS accounts assigned to the user. These AWS accounts are assigned
  287. // by the administrator of the account. For more information, see Assign User
  288. // Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers)
  289. // in the AWS SSO User Guide. This operation returns a paginated response.
  290. //
  291. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  292. // with awserr.Error's Code and Message methods to get detailed information about
  293. // the error.
  294. //
  295. // See the AWS API reference guide for AWS Single Sign-On's
  296. // API operation ListAccounts for usage and error information.
  297. //
  298. // Returned Error Types:
  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. //
  351. func (c *SSO) ListAccountsPages(input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool) error {
  352. return c.ListAccountsPagesWithContext(aws.BackgroundContext(), input, fn)
  353. }
  354. // ListAccountsPagesWithContext same as ListAccountsPages except
  355. // it takes a Context and allows setting request options on the pages.
  356. //
  357. // The context must be non-nil and will be used for request cancellation. If
  358. // the context is nil a panic will occur. In the future the SDK may create
  359. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  360. // for more information on using Contexts.
  361. func (c *SSO) ListAccountsPagesWithContext(ctx aws.Context, input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool, opts ...request.Option) error {
  362. p := request.Pagination{
  363. NewRequest: func() (*request.Request, error) {
  364. var inCpy *ListAccountsInput
  365. if input != nil {
  366. tmp := *input
  367. inCpy = &tmp
  368. }
  369. req, _ := c.ListAccountsRequest(inCpy)
  370. req.SetContext(ctx)
  371. req.ApplyOptions(opts...)
  372. return req, nil
  373. },
  374. }
  375. for p.Next() {
  376. if !fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) {
  377. break
  378. }
  379. }
  380. return p.Err()
  381. }
  382. const opLogout = "Logout"
  383. // LogoutRequest generates a "aws/request.Request" representing the
  384. // client's request for the Logout operation. The "output" return
  385. // value will be populated with the request's response once the request completes
  386. // successfully.
  387. //
  388. // Use "Send" method on the returned Request to send the API call to the service.
  389. // the "output" return value is not valid until after Send returns without error.
  390. //
  391. // See Logout for more information on using the Logout
  392. // API call, and error handling.
  393. //
  394. // This method is useful when you want to inject custom logic or configuration
  395. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  396. //
  397. //
  398. // // Example sending a request using the LogoutRequest method.
  399. // req, resp := client.LogoutRequest(params)
  400. //
  401. // err := req.Send()
  402. // if err == nil { // resp is now filled
  403. // fmt.Println(resp)
  404. // }
  405. //
  406. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout
  407. func (c *SSO) LogoutRequest(input *LogoutInput) (req *request.Request, output *LogoutOutput) {
  408. op := &request.Operation{
  409. Name: opLogout,
  410. HTTPMethod: "POST",
  411. HTTPPath: "/logout",
  412. }
  413. if input == nil {
  414. input = &LogoutInput{}
  415. }
  416. output = &LogoutOutput{}
  417. req = c.newRequest(op, input, output)
  418. req.Config.Credentials = credentials.AnonymousCredentials
  419. req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  420. return
  421. }
  422. // Logout API operation for AWS Single Sign-On.
  423. //
  424. // Removes the client- and server-side session that is associated with the user.
  425. //
  426. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  427. // with awserr.Error's Code and Message methods to get detailed information about
  428. // the error.
  429. //
  430. // See the AWS API reference guide for AWS Single Sign-On's
  431. // API operation Logout for usage and error information.
  432. //
  433. // Returned Error Types:
  434. // * InvalidRequestException
  435. // Indicates that a problem occurred with the input to the request. For example,
  436. // a required parameter might be missing or out of range.
  437. //
  438. // * UnauthorizedException
  439. // Indicates that the request is not authorized. This can happen due to an invalid
  440. // access token in the request.
  441. //
  442. // * TooManyRequestsException
  443. // Indicates that the request is being made too frequently and is more than
  444. // what the server can handle.
  445. //
  446. // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-2019-06-10/Logout
  447. func (c *SSO) Logout(input *LogoutInput) (*LogoutOutput, error) {
  448. req, out := c.LogoutRequest(input)
  449. return out, req.Send()
  450. }
  451. // LogoutWithContext is the same as Logout with the addition of
  452. // the ability to pass a context and additional request options.
  453. //
  454. // See Logout for details on how to use this API operation.
  455. //
  456. // The context must be non-nil and will be used for request cancellation. If
  457. // the context is nil a panic will occur. In the future the SDK may create
  458. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  459. // for more information on using Contexts.
  460. func (c *SSO) LogoutWithContext(ctx aws.Context, input *LogoutInput, opts ...request.Option) (*LogoutOutput, error) {
  461. req, out := c.LogoutRequest(input)
  462. req.SetContext(ctx)
  463. req.ApplyOptions(opts...)
  464. return out, req.Send()
  465. }
  466. // Provides information about your AWS account.
  467. type AccountInfo struct {
  468. _ struct{} `type:"structure"`
  469. // The identifier of the AWS account that is assigned to the user.
  470. AccountId *string `locationName:"accountId" type:"string"`
  471. // The display name of the AWS account that is assigned to the user.
  472. AccountName *string `locationName:"accountName" type:"string"`
  473. // The email address of the AWS account that is assigned to the user.
  474. EmailAddress *string `locationName:"emailAddress" min:"1" type:"string"`
  475. }
  476. // String returns the string representation
  477. func (s AccountInfo) String() string {
  478. return awsutil.Prettify(s)
  479. }
  480. // GoString returns the string representation
  481. func (s AccountInfo) GoString() string {
  482. return s.String()
  483. }
  484. // SetAccountId sets the AccountId field's value.
  485. func (s *AccountInfo) SetAccountId(v string) *AccountInfo {
  486. s.AccountId = &v
  487. return s
  488. }
  489. // SetAccountName sets the AccountName field's value.
  490. func (s *AccountInfo) SetAccountName(v string) *AccountInfo {
  491. s.AccountName = &v
  492. return s
  493. }
  494. // SetEmailAddress sets the EmailAddress field's value.
  495. func (s *AccountInfo) SetEmailAddress(v string) *AccountInfo {
  496. s.EmailAddress = &v
  497. return s
  498. }
  499. type GetRoleCredentialsInput struct {
  500. _ struct{} `type:"structure"`
  501. // The token issued by the CreateToken API call. For more information, see CreateToken
  502. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  503. // in the AWS SSO OIDC API Reference Guide.
  504. //
  505. // AccessToken is a required field
  506. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  507. // The identifier for the AWS account that is assigned to the user.
  508. //
  509. // AccountId is a required field
  510. AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"`
  511. // The friendly name of the role that is assigned to the user.
  512. //
  513. // RoleName is a required field
  514. RoleName *string `location:"querystring" locationName:"role_name" type:"string" required:"true"`
  515. }
  516. // String returns the string representation
  517. func (s GetRoleCredentialsInput) String() string {
  518. return awsutil.Prettify(s)
  519. }
  520. // GoString returns the string representation
  521. func (s GetRoleCredentialsInput) GoString() string {
  522. return s.String()
  523. }
  524. // Validate inspects the fields of the type to determine if they are valid.
  525. func (s *GetRoleCredentialsInput) Validate() error {
  526. invalidParams := request.ErrInvalidParams{Context: "GetRoleCredentialsInput"}
  527. if s.AccessToken == nil {
  528. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  529. }
  530. if s.AccountId == nil {
  531. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  532. }
  533. if s.RoleName == nil {
  534. invalidParams.Add(request.NewErrParamRequired("RoleName"))
  535. }
  536. if invalidParams.Len() > 0 {
  537. return invalidParams
  538. }
  539. return nil
  540. }
  541. // SetAccessToken sets the AccessToken field's value.
  542. func (s *GetRoleCredentialsInput) SetAccessToken(v string) *GetRoleCredentialsInput {
  543. s.AccessToken = &v
  544. return s
  545. }
  546. // SetAccountId sets the AccountId field's value.
  547. func (s *GetRoleCredentialsInput) SetAccountId(v string) *GetRoleCredentialsInput {
  548. s.AccountId = &v
  549. return s
  550. }
  551. // SetRoleName sets the RoleName field's value.
  552. func (s *GetRoleCredentialsInput) SetRoleName(v string) *GetRoleCredentialsInput {
  553. s.RoleName = &v
  554. return s
  555. }
  556. type GetRoleCredentialsOutput struct {
  557. _ struct{} `type:"structure"`
  558. // The credentials for the role that is assigned to the user.
  559. RoleCredentials *RoleCredentials `locationName:"roleCredentials" type:"structure"`
  560. }
  561. // String returns the string representation
  562. func (s GetRoleCredentialsOutput) String() string {
  563. return awsutil.Prettify(s)
  564. }
  565. // GoString returns the string representation
  566. func (s GetRoleCredentialsOutput) GoString() string {
  567. return s.String()
  568. }
  569. // SetRoleCredentials sets the RoleCredentials field's value.
  570. func (s *GetRoleCredentialsOutput) SetRoleCredentials(v *RoleCredentials) *GetRoleCredentialsOutput {
  571. s.RoleCredentials = v
  572. return s
  573. }
  574. // Indicates that a problem occurred with the input to the request. For example,
  575. // a required parameter might be missing or out of range.
  576. type InvalidRequestException struct {
  577. _ struct{} `type:"structure"`
  578. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  579. Message_ *string `locationName:"message" type:"string"`
  580. }
  581. // String returns the string representation
  582. func (s InvalidRequestException) String() string {
  583. return awsutil.Prettify(s)
  584. }
  585. // GoString returns the string representation
  586. func (s InvalidRequestException) GoString() string {
  587. return s.String()
  588. }
  589. func newErrorInvalidRequestException(v protocol.ResponseMetadata) error {
  590. return &InvalidRequestException{
  591. RespMetadata: v,
  592. }
  593. }
  594. // Code returns the exception type name.
  595. func (s *InvalidRequestException) Code() string {
  596. return "InvalidRequestException"
  597. }
  598. // Message returns the exception's message.
  599. func (s *InvalidRequestException) Message() string {
  600. if s.Message_ != nil {
  601. return *s.Message_
  602. }
  603. return ""
  604. }
  605. // OrigErr always returns nil, satisfies awserr.Error interface.
  606. func (s *InvalidRequestException) OrigErr() error {
  607. return nil
  608. }
  609. func (s *InvalidRequestException) Error() string {
  610. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  611. }
  612. // Status code returns the HTTP status code for the request's response error.
  613. func (s *InvalidRequestException) StatusCode() int {
  614. return s.RespMetadata.StatusCode
  615. }
  616. // RequestID returns the service's response RequestID for request.
  617. func (s *InvalidRequestException) RequestID() string {
  618. return s.RespMetadata.RequestID
  619. }
  620. type ListAccountRolesInput struct {
  621. _ struct{} `type:"structure"`
  622. // The token issued by the CreateToken API call. For more information, see CreateToken
  623. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  624. // in the AWS SSO OIDC API Reference Guide.
  625. //
  626. // AccessToken is a required field
  627. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  628. // The identifier for the AWS account that is assigned to the user.
  629. //
  630. // AccountId is a required field
  631. AccountId *string `location:"querystring" locationName:"account_id" type:"string" required:"true"`
  632. // The number of items that clients can request per page.
  633. MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"`
  634. // The page token from the previous response output when you request subsequent
  635. // pages.
  636. NextToken *string `location:"querystring" locationName:"next_token" type:"string"`
  637. }
  638. // String returns the string representation
  639. func (s ListAccountRolesInput) String() string {
  640. return awsutil.Prettify(s)
  641. }
  642. // GoString returns the string representation
  643. func (s ListAccountRolesInput) GoString() string {
  644. return s.String()
  645. }
  646. // Validate inspects the fields of the type to determine if they are valid.
  647. func (s *ListAccountRolesInput) Validate() error {
  648. invalidParams := request.ErrInvalidParams{Context: "ListAccountRolesInput"}
  649. if s.AccessToken == nil {
  650. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  651. }
  652. if s.AccountId == nil {
  653. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  654. }
  655. if s.MaxResults != nil && *s.MaxResults < 1 {
  656. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  657. }
  658. if invalidParams.Len() > 0 {
  659. return invalidParams
  660. }
  661. return nil
  662. }
  663. // SetAccessToken sets the AccessToken field's value.
  664. func (s *ListAccountRolesInput) SetAccessToken(v string) *ListAccountRolesInput {
  665. s.AccessToken = &v
  666. return s
  667. }
  668. // SetAccountId sets the AccountId field's value.
  669. func (s *ListAccountRolesInput) SetAccountId(v string) *ListAccountRolesInput {
  670. s.AccountId = &v
  671. return s
  672. }
  673. // SetMaxResults sets the MaxResults field's value.
  674. func (s *ListAccountRolesInput) SetMaxResults(v int64) *ListAccountRolesInput {
  675. s.MaxResults = &v
  676. return s
  677. }
  678. // SetNextToken sets the NextToken field's value.
  679. func (s *ListAccountRolesInput) SetNextToken(v string) *ListAccountRolesInput {
  680. s.NextToken = &v
  681. return s
  682. }
  683. type ListAccountRolesOutput struct {
  684. _ struct{} `type:"structure"`
  685. // The page token client that is used to retrieve the list of accounts.
  686. NextToken *string `locationName:"nextToken" type:"string"`
  687. // A paginated response with the list of roles and the next token if more results
  688. // are available.
  689. RoleList []*RoleInfo `locationName:"roleList" type:"list"`
  690. }
  691. // String returns the string representation
  692. func (s ListAccountRolesOutput) String() string {
  693. return awsutil.Prettify(s)
  694. }
  695. // GoString returns the string representation
  696. func (s ListAccountRolesOutput) GoString() string {
  697. return s.String()
  698. }
  699. // SetNextToken sets the NextToken field's value.
  700. func (s *ListAccountRolesOutput) SetNextToken(v string) *ListAccountRolesOutput {
  701. s.NextToken = &v
  702. return s
  703. }
  704. // SetRoleList sets the RoleList field's value.
  705. func (s *ListAccountRolesOutput) SetRoleList(v []*RoleInfo) *ListAccountRolesOutput {
  706. s.RoleList = v
  707. return s
  708. }
  709. type ListAccountsInput struct {
  710. _ struct{} `type:"structure"`
  711. // The token issued by the CreateToken API call. For more information, see CreateToken
  712. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  713. // in the AWS SSO OIDC API Reference Guide.
  714. //
  715. // AccessToken is a required field
  716. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  717. // This is the number of items clients can request per page.
  718. MaxResults *int64 `location:"querystring" locationName:"max_result" min:"1" type:"integer"`
  719. // (Optional) When requesting subsequent pages, this is the page token from
  720. // the previous response output.
  721. NextToken *string `location:"querystring" locationName:"next_token" type:"string"`
  722. }
  723. // String returns the string representation
  724. func (s ListAccountsInput) String() string {
  725. return awsutil.Prettify(s)
  726. }
  727. // GoString returns the string representation
  728. func (s ListAccountsInput) GoString() string {
  729. return s.String()
  730. }
  731. // Validate inspects the fields of the type to determine if they are valid.
  732. func (s *ListAccountsInput) Validate() error {
  733. invalidParams := request.ErrInvalidParams{Context: "ListAccountsInput"}
  734. if s.AccessToken == nil {
  735. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  736. }
  737. if s.MaxResults != nil && *s.MaxResults < 1 {
  738. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  739. }
  740. if invalidParams.Len() > 0 {
  741. return invalidParams
  742. }
  743. return nil
  744. }
  745. // SetAccessToken sets the AccessToken field's value.
  746. func (s *ListAccountsInput) SetAccessToken(v string) *ListAccountsInput {
  747. s.AccessToken = &v
  748. return s
  749. }
  750. // SetMaxResults sets the MaxResults field's value.
  751. func (s *ListAccountsInput) SetMaxResults(v int64) *ListAccountsInput {
  752. s.MaxResults = &v
  753. return s
  754. }
  755. // SetNextToken sets the NextToken field's value.
  756. func (s *ListAccountsInput) SetNextToken(v string) *ListAccountsInput {
  757. s.NextToken = &v
  758. return s
  759. }
  760. type ListAccountsOutput struct {
  761. _ struct{} `type:"structure"`
  762. // A paginated response with the list of account information and the next token
  763. // if more results are available.
  764. AccountList []*AccountInfo `locationName:"accountList" type:"list"`
  765. // The page token client that is used to retrieve the list of accounts.
  766. NextToken *string `locationName:"nextToken" type:"string"`
  767. }
  768. // String returns the string representation
  769. func (s ListAccountsOutput) String() string {
  770. return awsutil.Prettify(s)
  771. }
  772. // GoString returns the string representation
  773. func (s ListAccountsOutput) GoString() string {
  774. return s.String()
  775. }
  776. // SetAccountList sets the AccountList field's value.
  777. func (s *ListAccountsOutput) SetAccountList(v []*AccountInfo) *ListAccountsOutput {
  778. s.AccountList = v
  779. return s
  780. }
  781. // SetNextToken sets the NextToken field's value.
  782. func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput {
  783. s.NextToken = &v
  784. return s
  785. }
  786. type LogoutInput struct {
  787. _ struct{} `type:"structure"`
  788. // The token issued by the CreateToken API call. For more information, see CreateToken
  789. // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
  790. // in the AWS SSO OIDC API Reference Guide.
  791. //
  792. // AccessToken is a required field
  793. AccessToken *string `location:"header" locationName:"x-amz-sso_bearer_token" type:"string" required:"true" sensitive:"true"`
  794. }
  795. // String returns the string representation
  796. func (s LogoutInput) String() string {
  797. return awsutil.Prettify(s)
  798. }
  799. // GoString returns the string representation
  800. func (s LogoutInput) GoString() string {
  801. return s.String()
  802. }
  803. // Validate inspects the fields of the type to determine if they are valid.
  804. func (s *LogoutInput) Validate() error {
  805. invalidParams := request.ErrInvalidParams{Context: "LogoutInput"}
  806. if s.AccessToken == nil {
  807. invalidParams.Add(request.NewErrParamRequired("AccessToken"))
  808. }
  809. if invalidParams.Len() > 0 {
  810. return invalidParams
  811. }
  812. return nil
  813. }
  814. // SetAccessToken sets the AccessToken field's value.
  815. func (s *LogoutInput) SetAccessToken(v string) *LogoutInput {
  816. s.AccessToken = &v
  817. return s
  818. }
  819. type LogoutOutput struct {
  820. _ struct{} `type:"structure"`
  821. }
  822. // String returns the string representation
  823. func (s LogoutOutput) String() string {
  824. return awsutil.Prettify(s)
  825. }
  826. // GoString returns the string representation
  827. func (s LogoutOutput) GoString() string {
  828. return s.String()
  829. }
  830. // The specified resource doesn't exist.
  831. type ResourceNotFoundException struct {
  832. _ struct{} `type:"structure"`
  833. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  834. Message_ *string `locationName:"message" type:"string"`
  835. }
  836. // String returns the string representation
  837. func (s ResourceNotFoundException) String() string {
  838. return awsutil.Prettify(s)
  839. }
  840. // GoString returns the string representation
  841. func (s ResourceNotFoundException) GoString() string {
  842. return s.String()
  843. }
  844. func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error {
  845. return &ResourceNotFoundException{
  846. RespMetadata: v,
  847. }
  848. }
  849. // Code returns the exception type name.
  850. func (s *ResourceNotFoundException) Code() string {
  851. return "ResourceNotFoundException"
  852. }
  853. // Message returns the exception's message.
  854. func (s *ResourceNotFoundException) Message() string {
  855. if s.Message_ != nil {
  856. return *s.Message_
  857. }
  858. return ""
  859. }
  860. // OrigErr always returns nil, satisfies awserr.Error interface.
  861. func (s *ResourceNotFoundException) OrigErr() error {
  862. return nil
  863. }
  864. func (s *ResourceNotFoundException) Error() string {
  865. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  866. }
  867. // Status code returns the HTTP status code for the request's response error.
  868. func (s *ResourceNotFoundException) StatusCode() int {
  869. return s.RespMetadata.StatusCode
  870. }
  871. // RequestID returns the service's response RequestID for request.
  872. func (s *ResourceNotFoundException) RequestID() string {
  873. return s.RespMetadata.RequestID
  874. }
  875. // Provides information about the role credentials that are assigned to the
  876. // user.
  877. type RoleCredentials struct {
  878. _ struct{} `type:"structure"`
  879. // The identifier used for the temporary security credentials. For more information,
  880. // see Using Temporary Security Credentials to Request Access to AWS Resources
  881. // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
  882. // in the AWS IAM User Guide.
  883. AccessKeyId *string `locationName:"accessKeyId" type:"string"`
  884. // The date on which temporary security credentials expire.
  885. Expiration *int64 `locationName:"expiration" type:"long"`
  886. // The key that is used to sign the request. For more information, see Using
  887. // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
  888. // in the AWS IAM User Guide.
  889. SecretAccessKey *string `locationName:"secretAccessKey" type:"string" sensitive:"true"`
  890. // The token used for temporary credentials. For more information, see Using
  891. // Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
  892. // in the AWS IAM User Guide.
  893. SessionToken *string `locationName:"sessionToken" type:"string" sensitive:"true"`
  894. }
  895. // String returns the string representation
  896. func (s RoleCredentials) String() string {
  897. return awsutil.Prettify(s)
  898. }
  899. // GoString returns the string representation
  900. func (s RoleCredentials) GoString() string {
  901. return s.String()
  902. }
  903. // SetAccessKeyId sets the AccessKeyId field's value.
  904. func (s *RoleCredentials) SetAccessKeyId(v string) *RoleCredentials {
  905. s.AccessKeyId = &v
  906. return s
  907. }
  908. // SetExpiration sets the Expiration field's value.
  909. func (s *RoleCredentials) SetExpiration(v int64) *RoleCredentials {
  910. s.Expiration = &v
  911. return s
  912. }
  913. // SetSecretAccessKey sets the SecretAccessKey field's value.
  914. func (s *RoleCredentials) SetSecretAccessKey(v string) *RoleCredentials {
  915. s.SecretAccessKey = &v
  916. return s
  917. }
  918. // SetSessionToken sets the SessionToken field's value.
  919. func (s *RoleCredentials) SetSessionToken(v string) *RoleCredentials {
  920. s.SessionToken = &v
  921. return s
  922. }
  923. // Provides information about the role that is assigned to the user.
  924. type RoleInfo struct {
  925. _ struct{} `type:"structure"`
  926. // The identifier of the AWS account assigned to the user.
  927. AccountId *string `locationName:"accountId" type:"string"`
  928. // The friendly name of the role that is assigned to the user.
  929. RoleName *string `locationName:"roleName" type:"string"`
  930. }
  931. // String returns the string representation
  932. func (s RoleInfo) String() string {
  933. return awsutil.Prettify(s)
  934. }
  935. // GoString returns the string representation
  936. func (s RoleInfo) GoString() string {
  937. return s.String()
  938. }
  939. // SetAccountId sets the AccountId field's value.
  940. func (s *RoleInfo) SetAccountId(v string) *RoleInfo {
  941. s.AccountId = &v
  942. return s
  943. }
  944. // SetRoleName sets the RoleName field's value.
  945. func (s *RoleInfo) SetRoleName(v string) *RoleInfo {
  946. s.RoleName = &v
  947. return s
  948. }
  949. // Indicates that the request is being made too frequently and is more than
  950. // what the server can handle.
  951. type TooManyRequestsException struct {
  952. _ struct{} `type:"structure"`
  953. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  954. Message_ *string `locationName:"message" type:"string"`
  955. }
  956. // String returns the string representation
  957. func (s TooManyRequestsException) String() string {
  958. return awsutil.Prettify(s)
  959. }
  960. // GoString returns the string representation
  961. func (s TooManyRequestsException) GoString() string {
  962. return s.String()
  963. }
  964. func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error {
  965. return &TooManyRequestsException{
  966. RespMetadata: v,
  967. }
  968. }
  969. // Code returns the exception type name.
  970. func (s *TooManyRequestsException) Code() string {
  971. return "TooManyRequestsException"
  972. }
  973. // Message returns the exception's message.
  974. func (s *TooManyRequestsException) Message() string {
  975. if s.Message_ != nil {
  976. return *s.Message_
  977. }
  978. return ""
  979. }
  980. // OrigErr always returns nil, satisfies awserr.Error interface.
  981. func (s *TooManyRequestsException) OrigErr() error {
  982. return nil
  983. }
  984. func (s *TooManyRequestsException) Error() string {
  985. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  986. }
  987. // Status code returns the HTTP status code for the request's response error.
  988. func (s *TooManyRequestsException) StatusCode() int {
  989. return s.RespMetadata.StatusCode
  990. }
  991. // RequestID returns the service's response RequestID for request.
  992. func (s *TooManyRequestsException) RequestID() string {
  993. return s.RespMetadata.RequestID
  994. }
  995. // Indicates that the request is not authorized. This can happen due to an invalid
  996. // access token in the request.
  997. type UnauthorizedException struct {
  998. _ struct{} `type:"structure"`
  999. RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
  1000. Message_ *string `locationName:"message" type:"string"`
  1001. }
  1002. // String returns the string representation
  1003. func (s UnauthorizedException) String() string {
  1004. return awsutil.Prettify(s)
  1005. }
  1006. // GoString returns the string representation
  1007. func (s UnauthorizedException) GoString() string {
  1008. return s.String()
  1009. }
  1010. func newErrorUnauthorizedException(v protocol.ResponseMetadata) error {
  1011. return &UnauthorizedException{
  1012. RespMetadata: v,
  1013. }
  1014. }
  1015. // Code returns the exception type name.
  1016. func (s *UnauthorizedException) Code() string {
  1017. return "UnauthorizedException"
  1018. }
  1019. // Message returns the exception's message.
  1020. func (s *UnauthorizedException) Message() string {
  1021. if s.Message_ != nil {
  1022. return *s.Message_
  1023. }
  1024. return ""
  1025. }
  1026. // OrigErr always returns nil, satisfies awserr.Error interface.
  1027. func (s *UnauthorizedException) OrigErr() error {
  1028. return nil
  1029. }
  1030. func (s *UnauthorizedException) Error() string {
  1031. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  1032. }
  1033. // Status code returns the HTTP status code for the request's response error.
  1034. func (s *UnauthorizedException) StatusCode() int {
  1035. return s.RespMetadata.StatusCode
  1036. }
  1037. // RequestID returns the service's response RequestID for request.
  1038. func (s *UnauthorizedException) RequestID() string {
  1039. return s.RespMetadata.RequestID
  1040. }