api.go 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package resourcegroups
  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/request"
  8. )
  9. const opCreateGroup = "CreateGroup"
  10. // CreateGroupRequest generates a "aws/request.Request" representing the
  11. // client's request for the CreateGroup operation. The "output" return
  12. // value will be populated with the request's response once the request completes
  13. // successfully.
  14. //
  15. // Use "Send" method on the returned Request to send the API call to the service.
  16. // the "output" return value is not valid until after Send returns without error.
  17. //
  18. // See CreateGroup for more information on using the CreateGroup
  19. // API call, and error handling.
  20. //
  21. // This method is useful when you want to inject custom logic or configuration
  22. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  23. //
  24. //
  25. // // Example sending a request using the CreateGroupRequest method.
  26. // req, resp := client.CreateGroupRequest(params)
  27. //
  28. // err := req.Send()
  29. // if err == nil { // resp is now filled
  30. // fmt.Println(resp)
  31. // }
  32. //
  33. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroup
  34. func (c *ResourceGroups) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) {
  35. op := &request.Operation{
  36. Name: opCreateGroup,
  37. HTTPMethod: "POST",
  38. HTTPPath: "/groups",
  39. }
  40. if input == nil {
  41. input = &CreateGroupInput{}
  42. }
  43. output = &CreateGroupOutput{}
  44. req = c.newRequest(op, input, output)
  45. return
  46. }
  47. // CreateGroup API operation for AWS Resource Groups.
  48. //
  49. // Creates a group with a specified name, description, and resource query.
  50. //
  51. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  52. // with awserr.Error's Code and Message methods to get detailed information about
  53. // the error.
  54. //
  55. // See the AWS API reference guide for AWS Resource Groups's
  56. // API operation CreateGroup for usage and error information.
  57. //
  58. // Returned Error Codes:
  59. // * ErrCodeBadRequestException "BadRequestException"
  60. // The request does not comply with validation rules that are defined for the
  61. // request parameters.
  62. //
  63. // * ErrCodeForbiddenException "ForbiddenException"
  64. // The caller is not authorized to make the request.
  65. //
  66. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  67. // The request uses an HTTP method which is not allowed for the specified resource.
  68. //
  69. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  70. // The caller has exceeded throttling limits.
  71. //
  72. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  73. // An internal error occurred while processing the request.
  74. //
  75. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroup
  76. func (c *ResourceGroups) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) {
  77. req, out := c.CreateGroupRequest(input)
  78. return out, req.Send()
  79. }
  80. // CreateGroupWithContext is the same as CreateGroup with the addition of
  81. // the ability to pass a context and additional request options.
  82. //
  83. // See CreateGroup for details on how to use this API operation.
  84. //
  85. // The context must be non-nil and will be used for request cancellation. If
  86. // the context is nil a panic will occur. In the future the SDK may create
  87. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  88. // for more information on using Contexts.
  89. func (c *ResourceGroups) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) {
  90. req, out := c.CreateGroupRequest(input)
  91. req.SetContext(ctx)
  92. req.ApplyOptions(opts...)
  93. return out, req.Send()
  94. }
  95. const opDeleteGroup = "DeleteGroup"
  96. // DeleteGroupRequest generates a "aws/request.Request" representing the
  97. // client's request for the DeleteGroup operation. The "output" return
  98. // value will be populated with the request's response once the request completes
  99. // successfully.
  100. //
  101. // Use "Send" method on the returned Request to send the API call to the service.
  102. // the "output" return value is not valid until after Send returns without error.
  103. //
  104. // See DeleteGroup for more information on using the DeleteGroup
  105. // API call, and error handling.
  106. //
  107. // This method is useful when you want to inject custom logic or configuration
  108. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  109. //
  110. //
  111. // // Example sending a request using the DeleteGroupRequest method.
  112. // req, resp := client.DeleteGroupRequest(params)
  113. //
  114. // err := req.Send()
  115. // if err == nil { // resp is now filled
  116. // fmt.Println(resp)
  117. // }
  118. //
  119. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/DeleteGroup
  120. func (c *ResourceGroups) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) {
  121. op := &request.Operation{
  122. Name: opDeleteGroup,
  123. HTTPMethod: "DELETE",
  124. HTTPPath: "/groups/{GroupName}",
  125. }
  126. if input == nil {
  127. input = &DeleteGroupInput{}
  128. }
  129. output = &DeleteGroupOutput{}
  130. req = c.newRequest(op, input, output)
  131. return
  132. }
  133. // DeleteGroup API operation for AWS Resource Groups.
  134. //
  135. // Deletes a specified resource group. Deleting a resource group does not delete
  136. // resources that are members of the group; it only deletes the group structure.
  137. //
  138. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  139. // with awserr.Error's Code and Message methods to get detailed information about
  140. // the error.
  141. //
  142. // See the AWS API reference guide for AWS Resource Groups's
  143. // API operation DeleteGroup for usage and error information.
  144. //
  145. // Returned Error Codes:
  146. // * ErrCodeBadRequestException "BadRequestException"
  147. // The request does not comply with validation rules that are defined for the
  148. // request parameters.
  149. //
  150. // * ErrCodeForbiddenException "ForbiddenException"
  151. // The caller is not authorized to make the request.
  152. //
  153. // * ErrCodeNotFoundException "NotFoundException"
  154. // One or more resources specified in the request do not exist.
  155. //
  156. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  157. // The request uses an HTTP method which is not allowed for the specified resource.
  158. //
  159. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  160. // The caller has exceeded throttling limits.
  161. //
  162. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  163. // An internal error occurred while processing the request.
  164. //
  165. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/DeleteGroup
  166. func (c *ResourceGroups) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) {
  167. req, out := c.DeleteGroupRequest(input)
  168. return out, req.Send()
  169. }
  170. // DeleteGroupWithContext is the same as DeleteGroup with the addition of
  171. // the ability to pass a context and additional request options.
  172. //
  173. // See DeleteGroup for details on how to use this API operation.
  174. //
  175. // The context must be non-nil and will be used for request cancellation. If
  176. // the context is nil a panic will occur. In the future the SDK may create
  177. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  178. // for more information on using Contexts.
  179. func (c *ResourceGroups) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) {
  180. req, out := c.DeleteGroupRequest(input)
  181. req.SetContext(ctx)
  182. req.ApplyOptions(opts...)
  183. return out, req.Send()
  184. }
  185. const opGetGroup = "GetGroup"
  186. // GetGroupRequest generates a "aws/request.Request" representing the
  187. // client's request for the GetGroup operation. The "output" return
  188. // value will be populated with the request's response once the request completes
  189. // successfully.
  190. //
  191. // Use "Send" method on the returned Request to send the API call to the service.
  192. // the "output" return value is not valid until after Send returns without error.
  193. //
  194. // See GetGroup for more information on using the GetGroup
  195. // API call, and error handling.
  196. //
  197. // This method is useful when you want to inject custom logic or configuration
  198. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  199. //
  200. //
  201. // // Example sending a request using the GetGroupRequest method.
  202. // req, resp := client.GetGroupRequest(params)
  203. //
  204. // err := req.Send()
  205. // if err == nil { // resp is now filled
  206. // fmt.Println(resp)
  207. // }
  208. //
  209. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroup
  210. func (c *ResourceGroups) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) {
  211. op := &request.Operation{
  212. Name: opGetGroup,
  213. HTTPMethod: "GET",
  214. HTTPPath: "/groups/{GroupName}",
  215. }
  216. if input == nil {
  217. input = &GetGroupInput{}
  218. }
  219. output = &GetGroupOutput{}
  220. req = c.newRequest(op, input, output)
  221. return
  222. }
  223. // GetGroup API operation for AWS Resource Groups.
  224. //
  225. // Returns information about a specified resource group.
  226. //
  227. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  228. // with awserr.Error's Code and Message methods to get detailed information about
  229. // the error.
  230. //
  231. // See the AWS API reference guide for AWS Resource Groups's
  232. // API operation GetGroup for usage and error information.
  233. //
  234. // Returned Error Codes:
  235. // * ErrCodeBadRequestException "BadRequestException"
  236. // The request does not comply with validation rules that are defined for the
  237. // request parameters.
  238. //
  239. // * ErrCodeForbiddenException "ForbiddenException"
  240. // The caller is not authorized to make the request.
  241. //
  242. // * ErrCodeNotFoundException "NotFoundException"
  243. // One or more resources specified in the request do not exist.
  244. //
  245. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  246. // The request uses an HTTP method which is not allowed for the specified resource.
  247. //
  248. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  249. // The caller has exceeded throttling limits.
  250. //
  251. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  252. // An internal error occurred while processing the request.
  253. //
  254. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroup
  255. func (c *ResourceGroups) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) {
  256. req, out := c.GetGroupRequest(input)
  257. return out, req.Send()
  258. }
  259. // GetGroupWithContext is the same as GetGroup with the addition of
  260. // the ability to pass a context and additional request options.
  261. //
  262. // See GetGroup for details on how to use this API operation.
  263. //
  264. // The context must be non-nil and will be used for request cancellation. If
  265. // the context is nil a panic will occur. In the future the SDK may create
  266. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  267. // for more information on using Contexts.
  268. func (c *ResourceGroups) GetGroupWithContext(ctx aws.Context, input *GetGroupInput, opts ...request.Option) (*GetGroupOutput, error) {
  269. req, out := c.GetGroupRequest(input)
  270. req.SetContext(ctx)
  271. req.ApplyOptions(opts...)
  272. return out, req.Send()
  273. }
  274. const opGetGroupQuery = "GetGroupQuery"
  275. // GetGroupQueryRequest generates a "aws/request.Request" representing the
  276. // client's request for the GetGroupQuery operation. The "output" return
  277. // value will be populated with the request's response once the request completes
  278. // successfully.
  279. //
  280. // Use "Send" method on the returned Request to send the API call to the service.
  281. // the "output" return value is not valid until after Send returns without error.
  282. //
  283. // See GetGroupQuery for more information on using the GetGroupQuery
  284. // API call, and error handling.
  285. //
  286. // This method is useful when you want to inject custom logic or configuration
  287. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  288. //
  289. //
  290. // // Example sending a request using the GetGroupQueryRequest method.
  291. // req, resp := client.GetGroupQueryRequest(params)
  292. //
  293. // err := req.Send()
  294. // if err == nil { // resp is now filled
  295. // fmt.Println(resp)
  296. // }
  297. //
  298. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroupQuery
  299. func (c *ResourceGroups) GetGroupQueryRequest(input *GetGroupQueryInput) (req *request.Request, output *GetGroupQueryOutput) {
  300. op := &request.Operation{
  301. Name: opGetGroupQuery,
  302. HTTPMethod: "GET",
  303. HTTPPath: "/groups/{GroupName}/query",
  304. }
  305. if input == nil {
  306. input = &GetGroupQueryInput{}
  307. }
  308. output = &GetGroupQueryOutput{}
  309. req = c.newRequest(op, input, output)
  310. return
  311. }
  312. // GetGroupQuery API operation for AWS Resource Groups.
  313. //
  314. // Returns the resource query associated with the specified resource group.
  315. //
  316. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  317. // with awserr.Error's Code and Message methods to get detailed information about
  318. // the error.
  319. //
  320. // See the AWS API reference guide for AWS Resource Groups's
  321. // API operation GetGroupQuery for usage and error information.
  322. //
  323. // Returned Error Codes:
  324. // * ErrCodeBadRequestException "BadRequestException"
  325. // The request does not comply with validation rules that are defined for the
  326. // request parameters.
  327. //
  328. // * ErrCodeForbiddenException "ForbiddenException"
  329. // The caller is not authorized to make the request.
  330. //
  331. // * ErrCodeNotFoundException "NotFoundException"
  332. // One or more resources specified in the request do not exist.
  333. //
  334. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  335. // The request uses an HTTP method which is not allowed for the specified resource.
  336. //
  337. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  338. // The caller has exceeded throttling limits.
  339. //
  340. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  341. // An internal error occurred while processing the request.
  342. //
  343. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroupQuery
  344. func (c *ResourceGroups) GetGroupQuery(input *GetGroupQueryInput) (*GetGroupQueryOutput, error) {
  345. req, out := c.GetGroupQueryRequest(input)
  346. return out, req.Send()
  347. }
  348. // GetGroupQueryWithContext is the same as GetGroupQuery with the addition of
  349. // the ability to pass a context and additional request options.
  350. //
  351. // See GetGroupQuery for details on how to use this API operation.
  352. //
  353. // The context must be non-nil and will be used for request cancellation. If
  354. // the context is nil a panic will occur. In the future the SDK may create
  355. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  356. // for more information on using Contexts.
  357. func (c *ResourceGroups) GetGroupQueryWithContext(ctx aws.Context, input *GetGroupQueryInput, opts ...request.Option) (*GetGroupQueryOutput, error) {
  358. req, out := c.GetGroupQueryRequest(input)
  359. req.SetContext(ctx)
  360. req.ApplyOptions(opts...)
  361. return out, req.Send()
  362. }
  363. const opGetTags = "GetTags"
  364. // GetTagsRequest generates a "aws/request.Request" representing the
  365. // client's request for the GetTags operation. The "output" return
  366. // value will be populated with the request's response once the request completes
  367. // successfully.
  368. //
  369. // Use "Send" method on the returned Request to send the API call to the service.
  370. // the "output" return value is not valid until after Send returns without error.
  371. //
  372. // See GetTags for more information on using the GetTags
  373. // API call, and error handling.
  374. //
  375. // This method is useful when you want to inject custom logic or configuration
  376. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  377. //
  378. //
  379. // // Example sending a request using the GetTagsRequest method.
  380. // req, resp := client.GetTagsRequest(params)
  381. //
  382. // err := req.Send()
  383. // if err == nil { // resp is now filled
  384. // fmt.Println(resp)
  385. // }
  386. //
  387. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetTags
  388. func (c *ResourceGroups) GetTagsRequest(input *GetTagsInput) (req *request.Request, output *GetTagsOutput) {
  389. op := &request.Operation{
  390. Name: opGetTags,
  391. HTTPMethod: "GET",
  392. HTTPPath: "/resources/{Arn}/tags",
  393. }
  394. if input == nil {
  395. input = &GetTagsInput{}
  396. }
  397. output = &GetTagsOutput{}
  398. req = c.newRequest(op, input, output)
  399. return
  400. }
  401. // GetTags API operation for AWS Resource Groups.
  402. //
  403. // Returns a list of tags that are associated with a resource, specified by
  404. // an ARN.
  405. //
  406. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  407. // with awserr.Error's Code and Message methods to get detailed information about
  408. // the error.
  409. //
  410. // See the AWS API reference guide for AWS Resource Groups's
  411. // API operation GetTags for usage and error information.
  412. //
  413. // Returned Error Codes:
  414. // * ErrCodeBadRequestException "BadRequestException"
  415. // The request does not comply with validation rules that are defined for the
  416. // request parameters.
  417. //
  418. // * ErrCodeForbiddenException "ForbiddenException"
  419. // The caller is not authorized to make the request.
  420. //
  421. // * ErrCodeNotFoundException "NotFoundException"
  422. // One or more resources specified in the request do not exist.
  423. //
  424. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  425. // The request uses an HTTP method which is not allowed for the specified resource.
  426. //
  427. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  428. // The caller has exceeded throttling limits.
  429. //
  430. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  431. // An internal error occurred while processing the request.
  432. //
  433. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetTags
  434. func (c *ResourceGroups) GetTags(input *GetTagsInput) (*GetTagsOutput, error) {
  435. req, out := c.GetTagsRequest(input)
  436. return out, req.Send()
  437. }
  438. // GetTagsWithContext is the same as GetTags with the addition of
  439. // the ability to pass a context and additional request options.
  440. //
  441. // See GetTags for details on how to use this API operation.
  442. //
  443. // The context must be non-nil and will be used for request cancellation. If
  444. // the context is nil a panic will occur. In the future the SDK may create
  445. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  446. // for more information on using Contexts.
  447. func (c *ResourceGroups) GetTagsWithContext(ctx aws.Context, input *GetTagsInput, opts ...request.Option) (*GetTagsOutput, error) {
  448. req, out := c.GetTagsRequest(input)
  449. req.SetContext(ctx)
  450. req.ApplyOptions(opts...)
  451. return out, req.Send()
  452. }
  453. const opListGroupResources = "ListGroupResources"
  454. // ListGroupResourcesRequest generates a "aws/request.Request" representing the
  455. // client's request for the ListGroupResources operation. The "output" return
  456. // value will be populated with the request's response once the request completes
  457. // successfully.
  458. //
  459. // Use "Send" method on the returned Request to send the API call to the service.
  460. // the "output" return value is not valid until after Send returns without error.
  461. //
  462. // See ListGroupResources for more information on using the ListGroupResources
  463. // API call, and error handling.
  464. //
  465. // This method is useful when you want to inject custom logic or configuration
  466. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  467. //
  468. //
  469. // // Example sending a request using the ListGroupResourcesRequest method.
  470. // req, resp := client.ListGroupResourcesRequest(params)
  471. //
  472. // err := req.Send()
  473. // if err == nil { // resp is now filled
  474. // fmt.Println(resp)
  475. // }
  476. //
  477. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroupResources
  478. func (c *ResourceGroups) ListGroupResourcesRequest(input *ListGroupResourcesInput) (req *request.Request, output *ListGroupResourcesOutput) {
  479. op := &request.Operation{
  480. Name: opListGroupResources,
  481. HTTPMethod: "POST",
  482. HTTPPath: "/groups/{GroupName}/resource-identifiers-list",
  483. Paginator: &request.Paginator{
  484. InputTokens: []string{"NextToken"},
  485. OutputTokens: []string{"NextToken"},
  486. LimitToken: "MaxResults",
  487. TruncationToken: "",
  488. },
  489. }
  490. if input == nil {
  491. input = &ListGroupResourcesInput{}
  492. }
  493. output = &ListGroupResourcesOutput{}
  494. req = c.newRequest(op, input, output)
  495. return
  496. }
  497. // ListGroupResources API operation for AWS Resource Groups.
  498. //
  499. // Returns a list of ARNs of resources that are members of a specified resource
  500. // group.
  501. //
  502. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  503. // with awserr.Error's Code and Message methods to get detailed information about
  504. // the error.
  505. //
  506. // See the AWS API reference guide for AWS Resource Groups's
  507. // API operation ListGroupResources for usage and error information.
  508. //
  509. // Returned Error Codes:
  510. // * ErrCodeUnauthorizedException "UnauthorizedException"
  511. // The request has not been applied because it lacks valid authentication credentials
  512. // for the target resource.
  513. //
  514. // * ErrCodeBadRequestException "BadRequestException"
  515. // The request does not comply with validation rules that are defined for the
  516. // request parameters.
  517. //
  518. // * ErrCodeForbiddenException "ForbiddenException"
  519. // The caller is not authorized to make the request.
  520. //
  521. // * ErrCodeNotFoundException "NotFoundException"
  522. // One or more resources specified in the request do not exist.
  523. //
  524. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  525. // The request uses an HTTP method which is not allowed for the specified resource.
  526. //
  527. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  528. // The caller has exceeded throttling limits.
  529. //
  530. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  531. // An internal error occurred while processing the request.
  532. //
  533. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroupResources
  534. func (c *ResourceGroups) ListGroupResources(input *ListGroupResourcesInput) (*ListGroupResourcesOutput, error) {
  535. req, out := c.ListGroupResourcesRequest(input)
  536. return out, req.Send()
  537. }
  538. // ListGroupResourcesWithContext is the same as ListGroupResources with the addition of
  539. // the ability to pass a context and additional request options.
  540. //
  541. // See ListGroupResources for details on how to use this API operation.
  542. //
  543. // The context must be non-nil and will be used for request cancellation. If
  544. // the context is nil a panic will occur. In the future the SDK may create
  545. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  546. // for more information on using Contexts.
  547. func (c *ResourceGroups) ListGroupResourcesWithContext(ctx aws.Context, input *ListGroupResourcesInput, opts ...request.Option) (*ListGroupResourcesOutput, error) {
  548. req, out := c.ListGroupResourcesRequest(input)
  549. req.SetContext(ctx)
  550. req.ApplyOptions(opts...)
  551. return out, req.Send()
  552. }
  553. // ListGroupResourcesPages iterates over the pages of a ListGroupResources operation,
  554. // calling the "fn" function with the response data for each page. To stop
  555. // iterating, return false from the fn function.
  556. //
  557. // See ListGroupResources method for more information on how to use this operation.
  558. //
  559. // Note: This operation can generate multiple requests to a service.
  560. //
  561. // // Example iterating over at most 3 pages of a ListGroupResources operation.
  562. // pageNum := 0
  563. // err := client.ListGroupResourcesPages(params,
  564. // func(page *ListGroupResourcesOutput, lastPage bool) bool {
  565. // pageNum++
  566. // fmt.Println(page)
  567. // return pageNum <= 3
  568. // })
  569. //
  570. func (c *ResourceGroups) ListGroupResourcesPages(input *ListGroupResourcesInput, fn func(*ListGroupResourcesOutput, bool) bool) error {
  571. return c.ListGroupResourcesPagesWithContext(aws.BackgroundContext(), input, fn)
  572. }
  573. // ListGroupResourcesPagesWithContext same as ListGroupResourcesPages except
  574. // it takes a Context and allows setting request options on the pages.
  575. //
  576. // The context must be non-nil and will be used for request cancellation. If
  577. // the context is nil a panic will occur. In the future the SDK may create
  578. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  579. // for more information on using Contexts.
  580. func (c *ResourceGroups) ListGroupResourcesPagesWithContext(ctx aws.Context, input *ListGroupResourcesInput, fn func(*ListGroupResourcesOutput, bool) bool, opts ...request.Option) error {
  581. p := request.Pagination{
  582. NewRequest: func() (*request.Request, error) {
  583. var inCpy *ListGroupResourcesInput
  584. if input != nil {
  585. tmp := *input
  586. inCpy = &tmp
  587. }
  588. req, _ := c.ListGroupResourcesRequest(inCpy)
  589. req.SetContext(ctx)
  590. req.ApplyOptions(opts...)
  591. return req, nil
  592. },
  593. }
  594. cont := true
  595. for p.Next() && cont {
  596. cont = fn(p.Page().(*ListGroupResourcesOutput), !p.HasNextPage())
  597. }
  598. return p.Err()
  599. }
  600. const opListGroups = "ListGroups"
  601. // ListGroupsRequest generates a "aws/request.Request" representing the
  602. // client's request for the ListGroups operation. The "output" return
  603. // value will be populated with the request's response once the request completes
  604. // successfully.
  605. //
  606. // Use "Send" method on the returned Request to send the API call to the service.
  607. // the "output" return value is not valid until after Send returns without error.
  608. //
  609. // See ListGroups for more information on using the ListGroups
  610. // API call, and error handling.
  611. //
  612. // This method is useful when you want to inject custom logic or configuration
  613. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  614. //
  615. //
  616. // // Example sending a request using the ListGroupsRequest method.
  617. // req, resp := client.ListGroupsRequest(params)
  618. //
  619. // err := req.Send()
  620. // if err == nil { // resp is now filled
  621. // fmt.Println(resp)
  622. // }
  623. //
  624. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroups
  625. func (c *ResourceGroups) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) {
  626. op := &request.Operation{
  627. Name: opListGroups,
  628. HTTPMethod: "POST",
  629. HTTPPath: "/groups-list",
  630. Paginator: &request.Paginator{
  631. InputTokens: []string{"NextToken"},
  632. OutputTokens: []string{"NextToken"},
  633. LimitToken: "MaxResults",
  634. TruncationToken: "",
  635. },
  636. }
  637. if input == nil {
  638. input = &ListGroupsInput{}
  639. }
  640. output = &ListGroupsOutput{}
  641. req = c.newRequest(op, input, output)
  642. return
  643. }
  644. // ListGroups API operation for AWS Resource Groups.
  645. //
  646. // Returns a list of existing resource groups in your account.
  647. //
  648. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  649. // with awserr.Error's Code and Message methods to get detailed information about
  650. // the error.
  651. //
  652. // See the AWS API reference guide for AWS Resource Groups's
  653. // API operation ListGroups for usage and error information.
  654. //
  655. // Returned Error Codes:
  656. // * ErrCodeBadRequestException "BadRequestException"
  657. // The request does not comply with validation rules that are defined for the
  658. // request parameters.
  659. //
  660. // * ErrCodeForbiddenException "ForbiddenException"
  661. // The caller is not authorized to make the request.
  662. //
  663. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  664. // The request uses an HTTP method which is not allowed for the specified resource.
  665. //
  666. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  667. // The caller has exceeded throttling limits.
  668. //
  669. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  670. // An internal error occurred while processing the request.
  671. //
  672. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroups
  673. func (c *ResourceGroups) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) {
  674. req, out := c.ListGroupsRequest(input)
  675. return out, req.Send()
  676. }
  677. // ListGroupsWithContext is the same as ListGroups with the addition of
  678. // the ability to pass a context and additional request options.
  679. //
  680. // See ListGroups for details on how to use this API operation.
  681. //
  682. // The context must be non-nil and will be used for request cancellation. If
  683. // the context is nil a panic will occur. In the future the SDK may create
  684. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  685. // for more information on using Contexts.
  686. func (c *ResourceGroups) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) {
  687. req, out := c.ListGroupsRequest(input)
  688. req.SetContext(ctx)
  689. req.ApplyOptions(opts...)
  690. return out, req.Send()
  691. }
  692. // ListGroupsPages iterates over the pages of a ListGroups operation,
  693. // calling the "fn" function with the response data for each page. To stop
  694. // iterating, return false from the fn function.
  695. //
  696. // See ListGroups method for more information on how to use this operation.
  697. //
  698. // Note: This operation can generate multiple requests to a service.
  699. //
  700. // // Example iterating over at most 3 pages of a ListGroups operation.
  701. // pageNum := 0
  702. // err := client.ListGroupsPages(params,
  703. // func(page *ListGroupsOutput, lastPage bool) bool {
  704. // pageNum++
  705. // fmt.Println(page)
  706. // return pageNum <= 3
  707. // })
  708. //
  709. func (c *ResourceGroups) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error {
  710. return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn)
  711. }
  712. // ListGroupsPagesWithContext same as ListGroupsPages except
  713. // it takes a Context and allows setting request options on the pages.
  714. //
  715. // The context must be non-nil and will be used for request cancellation. If
  716. // the context is nil a panic will occur. In the future the SDK may create
  717. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  718. // for more information on using Contexts.
  719. func (c *ResourceGroups) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...request.Option) error {
  720. p := request.Pagination{
  721. NewRequest: func() (*request.Request, error) {
  722. var inCpy *ListGroupsInput
  723. if input != nil {
  724. tmp := *input
  725. inCpy = &tmp
  726. }
  727. req, _ := c.ListGroupsRequest(inCpy)
  728. req.SetContext(ctx)
  729. req.ApplyOptions(opts...)
  730. return req, nil
  731. },
  732. }
  733. cont := true
  734. for p.Next() && cont {
  735. cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage())
  736. }
  737. return p.Err()
  738. }
  739. const opSearchResources = "SearchResources"
  740. // SearchResourcesRequest generates a "aws/request.Request" representing the
  741. // client's request for the SearchResources operation. The "output" return
  742. // value will be populated with the request's response once the request completes
  743. // successfully.
  744. //
  745. // Use "Send" method on the returned Request to send the API call to the service.
  746. // the "output" return value is not valid until after Send returns without error.
  747. //
  748. // See SearchResources for more information on using the SearchResources
  749. // API call, and error handling.
  750. //
  751. // This method is useful when you want to inject custom logic or configuration
  752. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  753. //
  754. //
  755. // // Example sending a request using the SearchResourcesRequest method.
  756. // req, resp := client.SearchResourcesRequest(params)
  757. //
  758. // err := req.Send()
  759. // if err == nil { // resp is now filled
  760. // fmt.Println(resp)
  761. // }
  762. //
  763. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/SearchResources
  764. func (c *ResourceGroups) SearchResourcesRequest(input *SearchResourcesInput) (req *request.Request, output *SearchResourcesOutput) {
  765. op := &request.Operation{
  766. Name: opSearchResources,
  767. HTTPMethod: "POST",
  768. HTTPPath: "/resources/search",
  769. Paginator: &request.Paginator{
  770. InputTokens: []string{"NextToken"},
  771. OutputTokens: []string{"NextToken"},
  772. LimitToken: "MaxResults",
  773. TruncationToken: "",
  774. },
  775. }
  776. if input == nil {
  777. input = &SearchResourcesInput{}
  778. }
  779. output = &SearchResourcesOutput{}
  780. req = c.newRequest(op, input, output)
  781. return
  782. }
  783. // SearchResources API operation for AWS Resource Groups.
  784. //
  785. // Returns a list of AWS resource identifiers that matches a specified query.
  786. // The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery
  787. // operation.
  788. //
  789. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  790. // with awserr.Error's Code and Message methods to get detailed information about
  791. // the error.
  792. //
  793. // See the AWS API reference guide for AWS Resource Groups's
  794. // API operation SearchResources for usage and error information.
  795. //
  796. // Returned Error Codes:
  797. // * ErrCodeUnauthorizedException "UnauthorizedException"
  798. // The request has not been applied because it lacks valid authentication credentials
  799. // for the target resource.
  800. //
  801. // * ErrCodeBadRequestException "BadRequestException"
  802. // The request does not comply with validation rules that are defined for the
  803. // request parameters.
  804. //
  805. // * ErrCodeForbiddenException "ForbiddenException"
  806. // The caller is not authorized to make the request.
  807. //
  808. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  809. // The request uses an HTTP method which is not allowed for the specified resource.
  810. //
  811. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  812. // The caller has exceeded throttling limits.
  813. //
  814. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  815. // An internal error occurred while processing the request.
  816. //
  817. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/SearchResources
  818. func (c *ResourceGroups) SearchResources(input *SearchResourcesInput) (*SearchResourcesOutput, error) {
  819. req, out := c.SearchResourcesRequest(input)
  820. return out, req.Send()
  821. }
  822. // SearchResourcesWithContext is the same as SearchResources with the addition of
  823. // the ability to pass a context and additional request options.
  824. //
  825. // See SearchResources for details on how to use this API operation.
  826. //
  827. // The context must be non-nil and will be used for request cancellation. If
  828. // the context is nil a panic will occur. In the future the SDK may create
  829. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  830. // for more information on using Contexts.
  831. func (c *ResourceGroups) SearchResourcesWithContext(ctx aws.Context, input *SearchResourcesInput, opts ...request.Option) (*SearchResourcesOutput, error) {
  832. req, out := c.SearchResourcesRequest(input)
  833. req.SetContext(ctx)
  834. req.ApplyOptions(opts...)
  835. return out, req.Send()
  836. }
  837. // SearchResourcesPages iterates over the pages of a SearchResources operation,
  838. // calling the "fn" function with the response data for each page. To stop
  839. // iterating, return false from the fn function.
  840. //
  841. // See SearchResources method for more information on how to use this operation.
  842. //
  843. // Note: This operation can generate multiple requests to a service.
  844. //
  845. // // Example iterating over at most 3 pages of a SearchResources operation.
  846. // pageNum := 0
  847. // err := client.SearchResourcesPages(params,
  848. // func(page *SearchResourcesOutput, lastPage bool) bool {
  849. // pageNum++
  850. // fmt.Println(page)
  851. // return pageNum <= 3
  852. // })
  853. //
  854. func (c *ResourceGroups) SearchResourcesPages(input *SearchResourcesInput, fn func(*SearchResourcesOutput, bool) bool) error {
  855. return c.SearchResourcesPagesWithContext(aws.BackgroundContext(), input, fn)
  856. }
  857. // SearchResourcesPagesWithContext same as SearchResourcesPages except
  858. // it takes a Context and allows setting request options on the pages.
  859. //
  860. // The context must be non-nil and will be used for request cancellation. If
  861. // the context is nil a panic will occur. In the future the SDK may create
  862. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  863. // for more information on using Contexts.
  864. func (c *ResourceGroups) SearchResourcesPagesWithContext(ctx aws.Context, input *SearchResourcesInput, fn func(*SearchResourcesOutput, bool) bool, opts ...request.Option) error {
  865. p := request.Pagination{
  866. NewRequest: func() (*request.Request, error) {
  867. var inCpy *SearchResourcesInput
  868. if input != nil {
  869. tmp := *input
  870. inCpy = &tmp
  871. }
  872. req, _ := c.SearchResourcesRequest(inCpy)
  873. req.SetContext(ctx)
  874. req.ApplyOptions(opts...)
  875. return req, nil
  876. },
  877. }
  878. cont := true
  879. for p.Next() && cont {
  880. cont = fn(p.Page().(*SearchResourcesOutput), !p.HasNextPage())
  881. }
  882. return p.Err()
  883. }
  884. const opTag = "Tag"
  885. // TagRequest generates a "aws/request.Request" representing the
  886. // client's request for the Tag operation. The "output" return
  887. // value will be populated with the request's response once the request completes
  888. // successfully.
  889. //
  890. // Use "Send" method on the returned Request to send the API call to the service.
  891. // the "output" return value is not valid until after Send returns without error.
  892. //
  893. // See Tag for more information on using the Tag
  894. // API call, and error handling.
  895. //
  896. // This method is useful when you want to inject custom logic or configuration
  897. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  898. //
  899. //
  900. // // Example sending a request using the TagRequest method.
  901. // req, resp := client.TagRequest(params)
  902. //
  903. // err := req.Send()
  904. // if err == nil { // resp is now filled
  905. // fmt.Println(resp)
  906. // }
  907. //
  908. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Tag
  909. func (c *ResourceGroups) TagRequest(input *TagInput) (req *request.Request, output *TagOutput) {
  910. op := &request.Operation{
  911. Name: opTag,
  912. HTTPMethod: "PUT",
  913. HTTPPath: "/resources/{Arn}/tags",
  914. }
  915. if input == nil {
  916. input = &TagInput{}
  917. }
  918. output = &TagOutput{}
  919. req = c.newRequest(op, input, output)
  920. return
  921. }
  922. // Tag API operation for AWS Resource Groups.
  923. //
  924. // Adds specified tags to a resource with the specified ARN. Existing tags on
  925. // a resource are not changed if they are not specified in the request parameters.
  926. //
  927. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  928. // with awserr.Error's Code and Message methods to get detailed information about
  929. // the error.
  930. //
  931. // See the AWS API reference guide for AWS Resource Groups's
  932. // API operation Tag for usage and error information.
  933. //
  934. // Returned Error Codes:
  935. // * ErrCodeBadRequestException "BadRequestException"
  936. // The request does not comply with validation rules that are defined for the
  937. // request parameters.
  938. //
  939. // * ErrCodeForbiddenException "ForbiddenException"
  940. // The caller is not authorized to make the request.
  941. //
  942. // * ErrCodeNotFoundException "NotFoundException"
  943. // One or more resources specified in the request do not exist.
  944. //
  945. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  946. // The request uses an HTTP method which is not allowed for the specified resource.
  947. //
  948. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  949. // The caller has exceeded throttling limits.
  950. //
  951. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  952. // An internal error occurred while processing the request.
  953. //
  954. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Tag
  955. func (c *ResourceGroups) Tag(input *TagInput) (*TagOutput, error) {
  956. req, out := c.TagRequest(input)
  957. return out, req.Send()
  958. }
  959. // TagWithContext is the same as Tag with the addition of
  960. // the ability to pass a context and additional request options.
  961. //
  962. // See Tag for details on how to use this API operation.
  963. //
  964. // The context must be non-nil and will be used for request cancellation. If
  965. // the context is nil a panic will occur. In the future the SDK may create
  966. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  967. // for more information on using Contexts.
  968. func (c *ResourceGroups) TagWithContext(ctx aws.Context, input *TagInput, opts ...request.Option) (*TagOutput, error) {
  969. req, out := c.TagRequest(input)
  970. req.SetContext(ctx)
  971. req.ApplyOptions(opts...)
  972. return out, req.Send()
  973. }
  974. const opUntag = "Untag"
  975. // UntagRequest generates a "aws/request.Request" representing the
  976. // client's request for the Untag operation. The "output" return
  977. // value will be populated with the request's response once the request completes
  978. // successfully.
  979. //
  980. // Use "Send" method on the returned Request to send the API call to the service.
  981. // the "output" return value is not valid until after Send returns without error.
  982. //
  983. // See Untag for more information on using the Untag
  984. // API call, and error handling.
  985. //
  986. // This method is useful when you want to inject custom logic or configuration
  987. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  988. //
  989. //
  990. // // Example sending a request using the UntagRequest method.
  991. // req, resp := client.UntagRequest(params)
  992. //
  993. // err := req.Send()
  994. // if err == nil { // resp is now filled
  995. // fmt.Println(resp)
  996. // }
  997. //
  998. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Untag
  999. func (c *ResourceGroups) UntagRequest(input *UntagInput) (req *request.Request, output *UntagOutput) {
  1000. op := &request.Operation{
  1001. Name: opUntag,
  1002. HTTPMethod: "PATCH",
  1003. HTTPPath: "/resources/{Arn}/tags",
  1004. }
  1005. if input == nil {
  1006. input = &UntagInput{}
  1007. }
  1008. output = &UntagOutput{}
  1009. req = c.newRequest(op, input, output)
  1010. return
  1011. }
  1012. // Untag API operation for AWS Resource Groups.
  1013. //
  1014. // Deletes specified tags from a specified resource.
  1015. //
  1016. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1017. // with awserr.Error's Code and Message methods to get detailed information about
  1018. // the error.
  1019. //
  1020. // See the AWS API reference guide for AWS Resource Groups's
  1021. // API operation Untag for usage and error information.
  1022. //
  1023. // Returned Error Codes:
  1024. // * ErrCodeBadRequestException "BadRequestException"
  1025. // The request does not comply with validation rules that are defined for the
  1026. // request parameters.
  1027. //
  1028. // * ErrCodeForbiddenException "ForbiddenException"
  1029. // The caller is not authorized to make the request.
  1030. //
  1031. // * ErrCodeNotFoundException "NotFoundException"
  1032. // One or more resources specified in the request do not exist.
  1033. //
  1034. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  1035. // The request uses an HTTP method which is not allowed for the specified resource.
  1036. //
  1037. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  1038. // The caller has exceeded throttling limits.
  1039. //
  1040. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  1041. // An internal error occurred while processing the request.
  1042. //
  1043. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Untag
  1044. func (c *ResourceGroups) Untag(input *UntagInput) (*UntagOutput, error) {
  1045. req, out := c.UntagRequest(input)
  1046. return out, req.Send()
  1047. }
  1048. // UntagWithContext is the same as Untag with the addition of
  1049. // the ability to pass a context and additional request options.
  1050. //
  1051. // See Untag for details on how to use this API operation.
  1052. //
  1053. // The context must be non-nil and will be used for request cancellation. If
  1054. // the context is nil a panic will occur. In the future the SDK may create
  1055. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1056. // for more information on using Contexts.
  1057. func (c *ResourceGroups) UntagWithContext(ctx aws.Context, input *UntagInput, opts ...request.Option) (*UntagOutput, error) {
  1058. req, out := c.UntagRequest(input)
  1059. req.SetContext(ctx)
  1060. req.ApplyOptions(opts...)
  1061. return out, req.Send()
  1062. }
  1063. const opUpdateGroup = "UpdateGroup"
  1064. // UpdateGroupRequest generates a "aws/request.Request" representing the
  1065. // client's request for the UpdateGroup operation. The "output" return
  1066. // value will be populated with the request's response once the request completes
  1067. // successfully.
  1068. //
  1069. // Use "Send" method on the returned Request to send the API call to the service.
  1070. // the "output" return value is not valid until after Send returns without error.
  1071. //
  1072. // See UpdateGroup for more information on using the UpdateGroup
  1073. // API call, and error handling.
  1074. //
  1075. // This method is useful when you want to inject custom logic or configuration
  1076. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1077. //
  1078. //
  1079. // // Example sending a request using the UpdateGroupRequest method.
  1080. // req, resp := client.UpdateGroupRequest(params)
  1081. //
  1082. // err := req.Send()
  1083. // if err == nil { // resp is now filled
  1084. // fmt.Println(resp)
  1085. // }
  1086. //
  1087. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroup
  1088. func (c *ResourceGroups) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) {
  1089. op := &request.Operation{
  1090. Name: opUpdateGroup,
  1091. HTTPMethod: "PUT",
  1092. HTTPPath: "/groups/{GroupName}",
  1093. }
  1094. if input == nil {
  1095. input = &UpdateGroupInput{}
  1096. }
  1097. output = &UpdateGroupOutput{}
  1098. req = c.newRequest(op, input, output)
  1099. return
  1100. }
  1101. // UpdateGroup API operation for AWS Resource Groups.
  1102. //
  1103. // Updates an existing group with a new or changed description. You cannot update
  1104. // the name of a resource group.
  1105. //
  1106. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1107. // with awserr.Error's Code and Message methods to get detailed information about
  1108. // the error.
  1109. //
  1110. // See the AWS API reference guide for AWS Resource Groups's
  1111. // API operation UpdateGroup for usage and error information.
  1112. //
  1113. // Returned Error Codes:
  1114. // * ErrCodeBadRequestException "BadRequestException"
  1115. // The request does not comply with validation rules that are defined for the
  1116. // request parameters.
  1117. //
  1118. // * ErrCodeForbiddenException "ForbiddenException"
  1119. // The caller is not authorized to make the request.
  1120. //
  1121. // * ErrCodeNotFoundException "NotFoundException"
  1122. // One or more resources specified in the request do not exist.
  1123. //
  1124. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  1125. // The request uses an HTTP method which is not allowed for the specified resource.
  1126. //
  1127. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  1128. // The caller has exceeded throttling limits.
  1129. //
  1130. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  1131. // An internal error occurred while processing the request.
  1132. //
  1133. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroup
  1134. func (c *ResourceGroups) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) {
  1135. req, out := c.UpdateGroupRequest(input)
  1136. return out, req.Send()
  1137. }
  1138. // UpdateGroupWithContext is the same as UpdateGroup with the addition of
  1139. // the ability to pass a context and additional request options.
  1140. //
  1141. // See UpdateGroup for details on how to use this API operation.
  1142. //
  1143. // The context must be non-nil and will be used for request cancellation. If
  1144. // the context is nil a panic will occur. In the future the SDK may create
  1145. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1146. // for more information on using Contexts.
  1147. func (c *ResourceGroups) UpdateGroupWithContext(ctx aws.Context, input *UpdateGroupInput, opts ...request.Option) (*UpdateGroupOutput, error) {
  1148. req, out := c.UpdateGroupRequest(input)
  1149. req.SetContext(ctx)
  1150. req.ApplyOptions(opts...)
  1151. return out, req.Send()
  1152. }
  1153. const opUpdateGroupQuery = "UpdateGroupQuery"
  1154. // UpdateGroupQueryRequest generates a "aws/request.Request" representing the
  1155. // client's request for the UpdateGroupQuery operation. The "output" return
  1156. // value will be populated with the request's response once the request completes
  1157. // successfully.
  1158. //
  1159. // Use "Send" method on the returned Request to send the API call to the service.
  1160. // the "output" return value is not valid until after Send returns without error.
  1161. //
  1162. // See UpdateGroupQuery for more information on using the UpdateGroupQuery
  1163. // API call, and error handling.
  1164. //
  1165. // This method is useful when you want to inject custom logic or configuration
  1166. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1167. //
  1168. //
  1169. // // Example sending a request using the UpdateGroupQueryRequest method.
  1170. // req, resp := client.UpdateGroupQueryRequest(params)
  1171. //
  1172. // err := req.Send()
  1173. // if err == nil { // resp is now filled
  1174. // fmt.Println(resp)
  1175. // }
  1176. //
  1177. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroupQuery
  1178. func (c *ResourceGroups) UpdateGroupQueryRequest(input *UpdateGroupQueryInput) (req *request.Request, output *UpdateGroupQueryOutput) {
  1179. op := &request.Operation{
  1180. Name: opUpdateGroupQuery,
  1181. HTTPMethod: "PUT",
  1182. HTTPPath: "/groups/{GroupName}/query",
  1183. }
  1184. if input == nil {
  1185. input = &UpdateGroupQueryInput{}
  1186. }
  1187. output = &UpdateGroupQueryOutput{}
  1188. req = c.newRequest(op, input, output)
  1189. return
  1190. }
  1191. // UpdateGroupQuery API operation for AWS Resource Groups.
  1192. //
  1193. // Updates the resource query of a group.
  1194. //
  1195. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1196. // with awserr.Error's Code and Message methods to get detailed information about
  1197. // the error.
  1198. //
  1199. // See the AWS API reference guide for AWS Resource Groups's
  1200. // API operation UpdateGroupQuery for usage and error information.
  1201. //
  1202. // Returned Error Codes:
  1203. // * ErrCodeBadRequestException "BadRequestException"
  1204. // The request does not comply with validation rules that are defined for the
  1205. // request parameters.
  1206. //
  1207. // * ErrCodeForbiddenException "ForbiddenException"
  1208. // The caller is not authorized to make the request.
  1209. //
  1210. // * ErrCodeNotFoundException "NotFoundException"
  1211. // One or more resources specified in the request do not exist.
  1212. //
  1213. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  1214. // The request uses an HTTP method which is not allowed for the specified resource.
  1215. //
  1216. // * ErrCodeTooManyRequestsException "TooManyRequestsException"
  1217. // The caller has exceeded throttling limits.
  1218. //
  1219. // * ErrCodeInternalServerErrorException "InternalServerErrorException"
  1220. // An internal error occurred while processing the request.
  1221. //
  1222. // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroupQuery
  1223. func (c *ResourceGroups) UpdateGroupQuery(input *UpdateGroupQueryInput) (*UpdateGroupQueryOutput, error) {
  1224. req, out := c.UpdateGroupQueryRequest(input)
  1225. return out, req.Send()
  1226. }
  1227. // UpdateGroupQueryWithContext is the same as UpdateGroupQuery with the addition of
  1228. // the ability to pass a context and additional request options.
  1229. //
  1230. // See UpdateGroupQuery for details on how to use this API operation.
  1231. //
  1232. // The context must be non-nil and will be used for request cancellation. If
  1233. // the context is nil a panic will occur. In the future the SDK may create
  1234. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1235. // for more information on using Contexts.
  1236. func (c *ResourceGroups) UpdateGroupQueryWithContext(ctx aws.Context, input *UpdateGroupQueryInput, opts ...request.Option) (*UpdateGroupQueryOutput, error) {
  1237. req, out := c.UpdateGroupQueryRequest(input)
  1238. req.SetContext(ctx)
  1239. req.ApplyOptions(opts...)
  1240. return out, req.Send()
  1241. }
  1242. type CreateGroupInput struct {
  1243. _ struct{} `type:"structure"`
  1244. // The description of the resource group. Descriptions can have a maximum of
  1245. // 511 characters, including letters, numbers, hyphens, underscores, punctuation,
  1246. // and spaces.
  1247. Description *string `type:"string"`
  1248. // The name of the group, which is the identifier of the group in other operations.
  1249. // A resource group name cannot be updated after it is created. A resource group
  1250. // name can have a maximum of 128 characters, including letters, numbers, hyphens,
  1251. // dots, and underscores. The name cannot start with AWS or aws; these are reserved.
  1252. // A resource group name must be unique within your account.
  1253. //
  1254. // Name is a required field
  1255. Name *string `min:"1" type:"string" required:"true"`
  1256. // The resource query that determines which AWS resources are members of this
  1257. // group.
  1258. //
  1259. // ResourceQuery is a required field
  1260. ResourceQuery *ResourceQuery `type:"structure" required:"true"`
  1261. // The tags to add to the group. A tag is a string-to-string map of key-value
  1262. // pairs. Tag keys can have a maximum character length of 128 characters, and
  1263. // tag values can have a maximum length of 256 characters.
  1264. Tags map[string]*string `type:"map"`
  1265. }
  1266. // String returns the string representation
  1267. func (s CreateGroupInput) String() string {
  1268. return awsutil.Prettify(s)
  1269. }
  1270. // GoString returns the string representation
  1271. func (s CreateGroupInput) GoString() string {
  1272. return s.String()
  1273. }
  1274. // Validate inspects the fields of the type to determine if they are valid.
  1275. func (s *CreateGroupInput) Validate() error {
  1276. invalidParams := request.ErrInvalidParams{Context: "CreateGroupInput"}
  1277. if s.Name == nil {
  1278. invalidParams.Add(request.NewErrParamRequired("Name"))
  1279. }
  1280. if s.Name != nil && len(*s.Name) < 1 {
  1281. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  1282. }
  1283. if s.ResourceQuery == nil {
  1284. invalidParams.Add(request.NewErrParamRequired("ResourceQuery"))
  1285. }
  1286. if s.ResourceQuery != nil {
  1287. if err := s.ResourceQuery.Validate(); err != nil {
  1288. invalidParams.AddNested("ResourceQuery", err.(request.ErrInvalidParams))
  1289. }
  1290. }
  1291. if invalidParams.Len() > 0 {
  1292. return invalidParams
  1293. }
  1294. return nil
  1295. }
  1296. // SetDescription sets the Description field's value.
  1297. func (s *CreateGroupInput) SetDescription(v string) *CreateGroupInput {
  1298. s.Description = &v
  1299. return s
  1300. }
  1301. // SetName sets the Name field's value.
  1302. func (s *CreateGroupInput) SetName(v string) *CreateGroupInput {
  1303. s.Name = &v
  1304. return s
  1305. }
  1306. // SetResourceQuery sets the ResourceQuery field's value.
  1307. func (s *CreateGroupInput) SetResourceQuery(v *ResourceQuery) *CreateGroupInput {
  1308. s.ResourceQuery = v
  1309. return s
  1310. }
  1311. // SetTags sets the Tags field's value.
  1312. func (s *CreateGroupInput) SetTags(v map[string]*string) *CreateGroupInput {
  1313. s.Tags = v
  1314. return s
  1315. }
  1316. type CreateGroupOutput struct {
  1317. _ struct{} `type:"structure"`
  1318. // A full description of the resource group after it is created.
  1319. Group *Group `type:"structure"`
  1320. // The resource query associated with the group.
  1321. ResourceQuery *ResourceQuery `type:"structure"`
  1322. // The tags associated with the group.
  1323. Tags map[string]*string `type:"map"`
  1324. }
  1325. // String returns the string representation
  1326. func (s CreateGroupOutput) String() string {
  1327. return awsutil.Prettify(s)
  1328. }
  1329. // GoString returns the string representation
  1330. func (s CreateGroupOutput) GoString() string {
  1331. return s.String()
  1332. }
  1333. // SetGroup sets the Group field's value.
  1334. func (s *CreateGroupOutput) SetGroup(v *Group) *CreateGroupOutput {
  1335. s.Group = v
  1336. return s
  1337. }
  1338. // SetResourceQuery sets the ResourceQuery field's value.
  1339. func (s *CreateGroupOutput) SetResourceQuery(v *ResourceQuery) *CreateGroupOutput {
  1340. s.ResourceQuery = v
  1341. return s
  1342. }
  1343. // SetTags sets the Tags field's value.
  1344. func (s *CreateGroupOutput) SetTags(v map[string]*string) *CreateGroupOutput {
  1345. s.Tags = v
  1346. return s
  1347. }
  1348. type DeleteGroupInput struct {
  1349. _ struct{} `type:"structure"`
  1350. // The name of the resource group to delete.
  1351. //
  1352. // GroupName is a required field
  1353. GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
  1354. }
  1355. // String returns the string representation
  1356. func (s DeleteGroupInput) String() string {
  1357. return awsutil.Prettify(s)
  1358. }
  1359. // GoString returns the string representation
  1360. func (s DeleteGroupInput) GoString() string {
  1361. return s.String()
  1362. }
  1363. // Validate inspects the fields of the type to determine if they are valid.
  1364. func (s *DeleteGroupInput) Validate() error {
  1365. invalidParams := request.ErrInvalidParams{Context: "DeleteGroupInput"}
  1366. if s.GroupName == nil {
  1367. invalidParams.Add(request.NewErrParamRequired("GroupName"))
  1368. }
  1369. if s.GroupName != nil && len(*s.GroupName) < 1 {
  1370. invalidParams.Add(request.NewErrParamMinLen("GroupName", 1))
  1371. }
  1372. if invalidParams.Len() > 0 {
  1373. return invalidParams
  1374. }
  1375. return nil
  1376. }
  1377. // SetGroupName sets the GroupName field's value.
  1378. func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput {
  1379. s.GroupName = &v
  1380. return s
  1381. }
  1382. type DeleteGroupOutput struct {
  1383. _ struct{} `type:"structure"`
  1384. // A full description of the deleted resource group.
  1385. Group *Group `type:"structure"`
  1386. }
  1387. // String returns the string representation
  1388. func (s DeleteGroupOutput) String() string {
  1389. return awsutil.Prettify(s)
  1390. }
  1391. // GoString returns the string representation
  1392. func (s DeleteGroupOutput) GoString() string {
  1393. return s.String()
  1394. }
  1395. // SetGroup sets the Group field's value.
  1396. func (s *DeleteGroupOutput) SetGroup(v *Group) *DeleteGroupOutput {
  1397. s.Group = v
  1398. return s
  1399. }
  1400. type GetGroupInput struct {
  1401. _ struct{} `type:"structure"`
  1402. // The name of the resource group.
  1403. //
  1404. // GroupName is a required field
  1405. GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
  1406. }
  1407. // String returns the string representation
  1408. func (s GetGroupInput) String() string {
  1409. return awsutil.Prettify(s)
  1410. }
  1411. // GoString returns the string representation
  1412. func (s GetGroupInput) GoString() string {
  1413. return s.String()
  1414. }
  1415. // Validate inspects the fields of the type to determine if they are valid.
  1416. func (s *GetGroupInput) Validate() error {
  1417. invalidParams := request.ErrInvalidParams{Context: "GetGroupInput"}
  1418. if s.GroupName == nil {
  1419. invalidParams.Add(request.NewErrParamRequired("GroupName"))
  1420. }
  1421. if s.GroupName != nil && len(*s.GroupName) < 1 {
  1422. invalidParams.Add(request.NewErrParamMinLen("GroupName", 1))
  1423. }
  1424. if invalidParams.Len() > 0 {
  1425. return invalidParams
  1426. }
  1427. return nil
  1428. }
  1429. // SetGroupName sets the GroupName field's value.
  1430. func (s *GetGroupInput) SetGroupName(v string) *GetGroupInput {
  1431. s.GroupName = &v
  1432. return s
  1433. }
  1434. type GetGroupOutput struct {
  1435. _ struct{} `type:"structure"`
  1436. // A full description of the resource group.
  1437. Group *Group `type:"structure"`
  1438. }
  1439. // String returns the string representation
  1440. func (s GetGroupOutput) String() string {
  1441. return awsutil.Prettify(s)
  1442. }
  1443. // GoString returns the string representation
  1444. func (s GetGroupOutput) GoString() string {
  1445. return s.String()
  1446. }
  1447. // SetGroup sets the Group field's value.
  1448. func (s *GetGroupOutput) SetGroup(v *Group) *GetGroupOutput {
  1449. s.Group = v
  1450. return s
  1451. }
  1452. type GetGroupQueryInput struct {
  1453. _ struct{} `type:"structure"`
  1454. // The name of the resource group.
  1455. //
  1456. // GroupName is a required field
  1457. GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
  1458. }
  1459. // String returns the string representation
  1460. func (s GetGroupQueryInput) String() string {
  1461. return awsutil.Prettify(s)
  1462. }
  1463. // GoString returns the string representation
  1464. func (s GetGroupQueryInput) GoString() string {
  1465. return s.String()
  1466. }
  1467. // Validate inspects the fields of the type to determine if they are valid.
  1468. func (s *GetGroupQueryInput) Validate() error {
  1469. invalidParams := request.ErrInvalidParams{Context: "GetGroupQueryInput"}
  1470. if s.GroupName == nil {
  1471. invalidParams.Add(request.NewErrParamRequired("GroupName"))
  1472. }
  1473. if s.GroupName != nil && len(*s.GroupName) < 1 {
  1474. invalidParams.Add(request.NewErrParamMinLen("GroupName", 1))
  1475. }
  1476. if invalidParams.Len() > 0 {
  1477. return invalidParams
  1478. }
  1479. return nil
  1480. }
  1481. // SetGroupName sets the GroupName field's value.
  1482. func (s *GetGroupQueryInput) SetGroupName(v string) *GetGroupQueryInput {
  1483. s.GroupName = &v
  1484. return s
  1485. }
  1486. type GetGroupQueryOutput struct {
  1487. _ struct{} `type:"structure"`
  1488. // The resource query associated with the specified group.
  1489. GroupQuery *GroupQuery `type:"structure"`
  1490. }
  1491. // String returns the string representation
  1492. func (s GetGroupQueryOutput) String() string {
  1493. return awsutil.Prettify(s)
  1494. }
  1495. // GoString returns the string representation
  1496. func (s GetGroupQueryOutput) GoString() string {
  1497. return s.String()
  1498. }
  1499. // SetGroupQuery sets the GroupQuery field's value.
  1500. func (s *GetGroupQueryOutput) SetGroupQuery(v *GroupQuery) *GetGroupQueryOutput {
  1501. s.GroupQuery = v
  1502. return s
  1503. }
  1504. type GetTagsInput struct {
  1505. _ struct{} `type:"structure"`
  1506. // The ARN of the resource for which you want a list of tags. The resource must
  1507. // exist within the account you are using.
  1508. //
  1509. // Arn is a required field
  1510. Arn *string `location:"uri" locationName:"Arn" type:"string" required:"true"`
  1511. }
  1512. // String returns the string representation
  1513. func (s GetTagsInput) String() string {
  1514. return awsutil.Prettify(s)
  1515. }
  1516. // GoString returns the string representation
  1517. func (s GetTagsInput) GoString() string {
  1518. return s.String()
  1519. }
  1520. // Validate inspects the fields of the type to determine if they are valid.
  1521. func (s *GetTagsInput) Validate() error {
  1522. invalidParams := request.ErrInvalidParams{Context: "GetTagsInput"}
  1523. if s.Arn == nil {
  1524. invalidParams.Add(request.NewErrParamRequired("Arn"))
  1525. }
  1526. if s.Arn != nil && len(*s.Arn) < 1 {
  1527. invalidParams.Add(request.NewErrParamMinLen("Arn", 1))
  1528. }
  1529. if invalidParams.Len() > 0 {
  1530. return invalidParams
  1531. }
  1532. return nil
  1533. }
  1534. // SetArn sets the Arn field's value.
  1535. func (s *GetTagsInput) SetArn(v string) *GetTagsInput {
  1536. s.Arn = &v
  1537. return s
  1538. }
  1539. type GetTagsOutput struct {
  1540. _ struct{} `type:"structure"`
  1541. // The ARN of the tagged resource.
  1542. Arn *string `type:"string"`
  1543. // The tags associated with the specified resource.
  1544. Tags map[string]*string `type:"map"`
  1545. }
  1546. // String returns the string representation
  1547. func (s GetTagsOutput) String() string {
  1548. return awsutil.Prettify(s)
  1549. }
  1550. // GoString returns the string representation
  1551. func (s GetTagsOutput) GoString() string {
  1552. return s.String()
  1553. }
  1554. // SetArn sets the Arn field's value.
  1555. func (s *GetTagsOutput) SetArn(v string) *GetTagsOutput {
  1556. s.Arn = &v
  1557. return s
  1558. }
  1559. // SetTags sets the Tags field's value.
  1560. func (s *GetTagsOutput) SetTags(v map[string]*string) *GetTagsOutput {
  1561. s.Tags = v
  1562. return s
  1563. }
  1564. // A resource group.
  1565. type Group struct {
  1566. _ struct{} `type:"structure"`
  1567. // The description of the resource group.
  1568. Description *string `type:"string"`
  1569. // The ARN of a resource group.
  1570. //
  1571. // GroupArn is a required field
  1572. GroupArn *string `type:"string" required:"true"`
  1573. // The name of a resource group.
  1574. //
  1575. // Name is a required field
  1576. Name *string `min:"1" type:"string" required:"true"`
  1577. }
  1578. // String returns the string representation
  1579. func (s Group) String() string {
  1580. return awsutil.Prettify(s)
  1581. }
  1582. // GoString returns the string representation
  1583. func (s Group) GoString() string {
  1584. return s.String()
  1585. }
  1586. // SetDescription sets the Description field's value.
  1587. func (s *Group) SetDescription(v string) *Group {
  1588. s.Description = &v
  1589. return s
  1590. }
  1591. // SetGroupArn sets the GroupArn field's value.
  1592. func (s *Group) SetGroupArn(v string) *Group {
  1593. s.GroupArn = &v
  1594. return s
  1595. }
  1596. // SetName sets the Name field's value.
  1597. func (s *Group) SetName(v string) *Group {
  1598. s.Name = &v
  1599. return s
  1600. }
  1601. // A filter name and value pair that is used to obtain more specific results
  1602. // from a list of groups.
  1603. type GroupFilter struct {
  1604. _ struct{} `type:"structure"`
  1605. // The name of the filter. Filter names are case-sensitive.
  1606. //
  1607. // Name is a required field
  1608. Name *string `type:"string" required:"true" enum:"GroupFilterName"`
  1609. // One or more filter values. Allowed filter values vary by group filter name,
  1610. // and are case-sensitive.
  1611. //
  1612. // Values is a required field
  1613. Values []*string `min:"1" type:"list" required:"true"`
  1614. }
  1615. // String returns the string representation
  1616. func (s GroupFilter) String() string {
  1617. return awsutil.Prettify(s)
  1618. }
  1619. // GoString returns the string representation
  1620. func (s GroupFilter) GoString() string {
  1621. return s.String()
  1622. }
  1623. // Validate inspects the fields of the type to determine if they are valid.
  1624. func (s *GroupFilter) Validate() error {
  1625. invalidParams := request.ErrInvalidParams{Context: "GroupFilter"}
  1626. if s.Name == nil {
  1627. invalidParams.Add(request.NewErrParamRequired("Name"))
  1628. }
  1629. if s.Values == nil {
  1630. invalidParams.Add(request.NewErrParamRequired("Values"))
  1631. }
  1632. if s.Values != nil && len(s.Values) < 1 {
  1633. invalidParams.Add(request.NewErrParamMinLen("Values", 1))
  1634. }
  1635. if invalidParams.Len() > 0 {
  1636. return invalidParams
  1637. }
  1638. return nil
  1639. }
  1640. // SetName sets the Name field's value.
  1641. func (s *GroupFilter) SetName(v string) *GroupFilter {
  1642. s.Name = &v
  1643. return s
  1644. }
  1645. // SetValues sets the Values field's value.
  1646. func (s *GroupFilter) SetValues(v []*string) *GroupFilter {
  1647. s.Values = v
  1648. return s
  1649. }
  1650. // The ARN and group name of a group.
  1651. type GroupIdentifier struct {
  1652. _ struct{} `type:"structure"`
  1653. // The ARN of a resource group.
  1654. GroupArn *string `type:"string"`
  1655. // The name of a resource group.
  1656. GroupName *string `min:"1" type:"string"`
  1657. }
  1658. // String returns the string representation
  1659. func (s GroupIdentifier) String() string {
  1660. return awsutil.Prettify(s)
  1661. }
  1662. // GoString returns the string representation
  1663. func (s GroupIdentifier) GoString() string {
  1664. return s.String()
  1665. }
  1666. // SetGroupArn sets the GroupArn field's value.
  1667. func (s *GroupIdentifier) SetGroupArn(v string) *GroupIdentifier {
  1668. s.GroupArn = &v
  1669. return s
  1670. }
  1671. // SetGroupName sets the GroupName field's value.
  1672. func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier {
  1673. s.GroupName = &v
  1674. return s
  1675. }
  1676. // The underlying resource query of a resource group. Resources that match query
  1677. // results are part of the group.
  1678. type GroupQuery struct {
  1679. _ struct{} `type:"structure"`
  1680. // The name of a resource group that is associated with a specific resource
  1681. // query.
  1682. //
  1683. // GroupName is a required field
  1684. GroupName *string `min:"1" type:"string" required:"true"`
  1685. // The resource query which determines which AWS resources are members of the
  1686. // associated resource group.
  1687. //
  1688. // ResourceQuery is a required field
  1689. ResourceQuery *ResourceQuery `type:"structure" required:"true"`
  1690. }
  1691. // String returns the string representation
  1692. func (s GroupQuery) String() string {
  1693. return awsutil.Prettify(s)
  1694. }
  1695. // GoString returns the string representation
  1696. func (s GroupQuery) GoString() string {
  1697. return s.String()
  1698. }
  1699. // SetGroupName sets the GroupName field's value.
  1700. func (s *GroupQuery) SetGroupName(v string) *GroupQuery {
  1701. s.GroupName = &v
  1702. return s
  1703. }
  1704. // SetResourceQuery sets the ResourceQuery field's value.
  1705. func (s *GroupQuery) SetResourceQuery(v *ResourceQuery) *GroupQuery {
  1706. s.ResourceQuery = v
  1707. return s
  1708. }
  1709. type ListGroupResourcesInput struct {
  1710. _ struct{} `type:"structure"`
  1711. // Filters, formatted as ResourceFilter objects, that you want to apply to a
  1712. // ListGroupResources operation.
  1713. //
  1714. // * resource-type - Filter resources by their type. Specify up to five resource
  1715. // types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance,
  1716. // or AWS::S3::Bucket.
  1717. Filters []*ResourceFilter `type:"list"`
  1718. // The name of the resource group.
  1719. //
  1720. // GroupName is a required field
  1721. GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
  1722. // The maximum number of group member ARNs that are returned in a single call
  1723. // by ListGroupResources, in paginated output. By default, this number is 50.
  1724. MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"`
  1725. // The NextToken value that is returned in a paginated ListGroupResources request.
  1726. // To get the next page of results, run the call again, add the NextToken parameter,
  1727. // and specify the NextToken value.
  1728. NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
  1729. }
  1730. // String returns the string representation
  1731. func (s ListGroupResourcesInput) String() string {
  1732. return awsutil.Prettify(s)
  1733. }
  1734. // GoString returns the string representation
  1735. func (s ListGroupResourcesInput) GoString() string {
  1736. return s.String()
  1737. }
  1738. // Validate inspects the fields of the type to determine if they are valid.
  1739. func (s *ListGroupResourcesInput) Validate() error {
  1740. invalidParams := request.ErrInvalidParams{Context: "ListGroupResourcesInput"}
  1741. if s.GroupName == nil {
  1742. invalidParams.Add(request.NewErrParamRequired("GroupName"))
  1743. }
  1744. if s.GroupName != nil && len(*s.GroupName) < 1 {
  1745. invalidParams.Add(request.NewErrParamMinLen("GroupName", 1))
  1746. }
  1747. if s.MaxResults != nil && *s.MaxResults < 1 {
  1748. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  1749. }
  1750. if s.Filters != nil {
  1751. for i, v := range s.Filters {
  1752. if v == nil {
  1753. continue
  1754. }
  1755. if err := v.Validate(); err != nil {
  1756. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams))
  1757. }
  1758. }
  1759. }
  1760. if invalidParams.Len() > 0 {
  1761. return invalidParams
  1762. }
  1763. return nil
  1764. }
  1765. // SetFilters sets the Filters field's value.
  1766. func (s *ListGroupResourcesInput) SetFilters(v []*ResourceFilter) *ListGroupResourcesInput {
  1767. s.Filters = v
  1768. return s
  1769. }
  1770. // SetGroupName sets the GroupName field's value.
  1771. func (s *ListGroupResourcesInput) SetGroupName(v string) *ListGroupResourcesInput {
  1772. s.GroupName = &v
  1773. return s
  1774. }
  1775. // SetMaxResults sets the MaxResults field's value.
  1776. func (s *ListGroupResourcesInput) SetMaxResults(v int64) *ListGroupResourcesInput {
  1777. s.MaxResults = &v
  1778. return s
  1779. }
  1780. // SetNextToken sets the NextToken field's value.
  1781. func (s *ListGroupResourcesInput) SetNextToken(v string) *ListGroupResourcesInput {
  1782. s.NextToken = &v
  1783. return s
  1784. }
  1785. type ListGroupResourcesOutput struct {
  1786. _ struct{} `type:"structure"`
  1787. // The NextToken value to include in a subsequent ListGroupResources request,
  1788. // to get more results.
  1789. NextToken *string `type:"string"`
  1790. // A list of QueryError objects. Each error is an object that contains ErrorCode
  1791. // and Message structures. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE
  1792. // and CLOUDFORMATION_STACK_NOT_EXISTING.
  1793. QueryErrors []*QueryError `type:"list"`
  1794. // The ARNs and resource types of resources that are members of the group that
  1795. // you specified.
  1796. ResourceIdentifiers []*ResourceIdentifier `type:"list"`
  1797. }
  1798. // String returns the string representation
  1799. func (s ListGroupResourcesOutput) String() string {
  1800. return awsutil.Prettify(s)
  1801. }
  1802. // GoString returns the string representation
  1803. func (s ListGroupResourcesOutput) GoString() string {
  1804. return s.String()
  1805. }
  1806. // SetNextToken sets the NextToken field's value.
  1807. func (s *ListGroupResourcesOutput) SetNextToken(v string) *ListGroupResourcesOutput {
  1808. s.NextToken = &v
  1809. return s
  1810. }
  1811. // SetQueryErrors sets the QueryErrors field's value.
  1812. func (s *ListGroupResourcesOutput) SetQueryErrors(v []*QueryError) *ListGroupResourcesOutput {
  1813. s.QueryErrors = v
  1814. return s
  1815. }
  1816. // SetResourceIdentifiers sets the ResourceIdentifiers field's value.
  1817. func (s *ListGroupResourcesOutput) SetResourceIdentifiers(v []*ResourceIdentifier) *ListGroupResourcesOutput {
  1818. s.ResourceIdentifiers = v
  1819. return s
  1820. }
  1821. type ListGroupsInput struct {
  1822. _ struct{} `type:"structure"`
  1823. // Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups
  1824. // operation.
  1825. //
  1826. // * resource-type - Filter groups by resource type. Specify up to five resource
  1827. // types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance,
  1828. // or AWS::S3::Bucket.
  1829. Filters []*GroupFilter `type:"list"`
  1830. // The maximum number of resource group results that are returned by ListGroups
  1831. // in paginated output. By default, this number is 50.
  1832. MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"`
  1833. // The NextToken value that is returned in a paginated ListGroups request. To
  1834. // get the next page of results, run the call again, add the NextToken parameter,
  1835. // and specify the NextToken value.
  1836. NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
  1837. }
  1838. // String returns the string representation
  1839. func (s ListGroupsInput) String() string {
  1840. return awsutil.Prettify(s)
  1841. }
  1842. // GoString returns the string representation
  1843. func (s ListGroupsInput) GoString() string {
  1844. return s.String()
  1845. }
  1846. // Validate inspects the fields of the type to determine if they are valid.
  1847. func (s *ListGroupsInput) Validate() error {
  1848. invalidParams := request.ErrInvalidParams{Context: "ListGroupsInput"}
  1849. if s.MaxResults != nil && *s.MaxResults < 1 {
  1850. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  1851. }
  1852. if s.Filters != nil {
  1853. for i, v := range s.Filters {
  1854. if v == nil {
  1855. continue
  1856. }
  1857. if err := v.Validate(); err != nil {
  1858. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams))
  1859. }
  1860. }
  1861. }
  1862. if invalidParams.Len() > 0 {
  1863. return invalidParams
  1864. }
  1865. return nil
  1866. }
  1867. // SetFilters sets the Filters field's value.
  1868. func (s *ListGroupsInput) SetFilters(v []*GroupFilter) *ListGroupsInput {
  1869. s.Filters = v
  1870. return s
  1871. }
  1872. // SetMaxResults sets the MaxResults field's value.
  1873. func (s *ListGroupsInput) SetMaxResults(v int64) *ListGroupsInput {
  1874. s.MaxResults = &v
  1875. return s
  1876. }
  1877. // SetNextToken sets the NextToken field's value.
  1878. func (s *ListGroupsInput) SetNextToken(v string) *ListGroupsInput {
  1879. s.NextToken = &v
  1880. return s
  1881. }
  1882. type ListGroupsOutput struct {
  1883. _ struct{} `type:"structure"`
  1884. // A list of GroupIdentifier objects. Each identifier is an object that contains
  1885. // both the GroupName and the GroupArn.
  1886. GroupIdentifiers []*GroupIdentifier `type:"list"`
  1887. // A list of resource groups.
  1888. //
  1889. // Deprecated: This field is deprecated, use GroupIdentifiers instead.
  1890. Groups []*Group `deprecated:"true" type:"list"`
  1891. // The NextToken value to include in a subsequent ListGroups request, to get
  1892. // more results.
  1893. NextToken *string `type:"string"`
  1894. }
  1895. // String returns the string representation
  1896. func (s ListGroupsOutput) String() string {
  1897. return awsutil.Prettify(s)
  1898. }
  1899. // GoString returns the string representation
  1900. func (s ListGroupsOutput) GoString() string {
  1901. return s.String()
  1902. }
  1903. // SetGroupIdentifiers sets the GroupIdentifiers field's value.
  1904. func (s *ListGroupsOutput) SetGroupIdentifiers(v []*GroupIdentifier) *ListGroupsOutput {
  1905. s.GroupIdentifiers = v
  1906. return s
  1907. }
  1908. // SetGroups sets the Groups field's value.
  1909. func (s *ListGroupsOutput) SetGroups(v []*Group) *ListGroupsOutput {
  1910. s.Groups = v
  1911. return s
  1912. }
  1913. // SetNextToken sets the NextToken field's value.
  1914. func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput {
  1915. s.NextToken = &v
  1916. return s
  1917. }
  1918. // A two-part error structure that can occur in ListGroupResources or SearchResources
  1919. // operations on CloudFormation stack-based queries. The error occurs if the
  1920. // CloudFormation stack on which the query is based either does not exist, or
  1921. // has a status that renders the stack inactive. A QueryError occurrence does
  1922. // not necessarily mean that AWS Resource Groups could not complete the operation,
  1923. // but the resulting group might have no member resources.
  1924. type QueryError struct {
  1925. _ struct{} `type:"structure"`
  1926. // Possible values are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.
  1927. ErrorCode *string `type:"string" enum:"QueryErrorCode"`
  1928. // A message that explains the ErrorCode value. Messages might state that the
  1929. // specified CloudFormation stack does not exist (or no longer exists). For
  1930. // CLOUDFORMATION_STACK_INACTIVE, the message typically states that the CloudFormation
  1931. // stack has a status that is not (or no longer) active, such as CREATE_FAILED.
  1932. Message *string `type:"string"`
  1933. }
  1934. // String returns the string representation
  1935. func (s QueryError) String() string {
  1936. return awsutil.Prettify(s)
  1937. }
  1938. // GoString returns the string representation
  1939. func (s QueryError) GoString() string {
  1940. return s.String()
  1941. }
  1942. // SetErrorCode sets the ErrorCode field's value.
  1943. func (s *QueryError) SetErrorCode(v string) *QueryError {
  1944. s.ErrorCode = &v
  1945. return s
  1946. }
  1947. // SetMessage sets the Message field's value.
  1948. func (s *QueryError) SetMessage(v string) *QueryError {
  1949. s.Message = &v
  1950. return s
  1951. }
  1952. // A filter name and value pair that is used to obtain more specific results
  1953. // from a list of resources.
  1954. type ResourceFilter struct {
  1955. _ struct{} `type:"structure"`
  1956. // The name of the filter. Filter names are case-sensitive.
  1957. //
  1958. // Name is a required field
  1959. Name *string `type:"string" required:"true" enum:"ResourceFilterName"`
  1960. // One or more filter values. Allowed filter values vary by resource filter
  1961. // name, and are case-sensitive.
  1962. //
  1963. // Values is a required field
  1964. Values []*string `min:"1" type:"list" required:"true"`
  1965. }
  1966. // String returns the string representation
  1967. func (s ResourceFilter) String() string {
  1968. return awsutil.Prettify(s)
  1969. }
  1970. // GoString returns the string representation
  1971. func (s ResourceFilter) GoString() string {
  1972. return s.String()
  1973. }
  1974. // Validate inspects the fields of the type to determine if they are valid.
  1975. func (s *ResourceFilter) Validate() error {
  1976. invalidParams := request.ErrInvalidParams{Context: "ResourceFilter"}
  1977. if s.Name == nil {
  1978. invalidParams.Add(request.NewErrParamRequired("Name"))
  1979. }
  1980. if s.Values == nil {
  1981. invalidParams.Add(request.NewErrParamRequired("Values"))
  1982. }
  1983. if s.Values != nil && len(s.Values) < 1 {
  1984. invalidParams.Add(request.NewErrParamMinLen("Values", 1))
  1985. }
  1986. if invalidParams.Len() > 0 {
  1987. return invalidParams
  1988. }
  1989. return nil
  1990. }
  1991. // SetName sets the Name field's value.
  1992. func (s *ResourceFilter) SetName(v string) *ResourceFilter {
  1993. s.Name = &v
  1994. return s
  1995. }
  1996. // SetValues sets the Values field's value.
  1997. func (s *ResourceFilter) SetValues(v []*string) *ResourceFilter {
  1998. s.Values = v
  1999. return s
  2000. }
  2001. // The ARN of a resource, and its resource type.
  2002. type ResourceIdentifier struct {
  2003. _ struct{} `type:"structure"`
  2004. // The ARN of a resource.
  2005. ResourceArn *string `type:"string"`
  2006. // The resource type of a resource, such as AWS::EC2::Instance.
  2007. ResourceType *string `type:"string"`
  2008. }
  2009. // String returns the string representation
  2010. func (s ResourceIdentifier) String() string {
  2011. return awsutil.Prettify(s)
  2012. }
  2013. // GoString returns the string representation
  2014. func (s ResourceIdentifier) GoString() string {
  2015. return s.String()
  2016. }
  2017. // SetResourceArn sets the ResourceArn field's value.
  2018. func (s *ResourceIdentifier) SetResourceArn(v string) *ResourceIdentifier {
  2019. s.ResourceArn = &v
  2020. return s
  2021. }
  2022. // SetResourceType sets the ResourceType field's value.
  2023. func (s *ResourceIdentifier) SetResourceType(v string) *ResourceIdentifier {
  2024. s.ResourceType = &v
  2025. return s
  2026. }
  2027. // The query that is used to define a resource group or a search for resources.
  2028. type ResourceQuery struct {
  2029. _ struct{} `type:"structure"`
  2030. // The query that defines a group or a search.
  2031. //
  2032. // Query is a required field
  2033. Query *string `type:"string" required:"true"`
  2034. // The type of the query. The valid values in this release are TAG_FILTERS_1_0
  2035. // and CLOUDFORMATION_STACK_1_0.
  2036. //
  2037. // TAG_FILTERS_1_0: A JSON syntax that lets you specify a collection of simple
  2038. // tag filters for resource types and tags, as supported by the AWS Tagging
  2039. // API GetResources (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html)
  2040. // operation. If you specify more than one tag key, only resources that match
  2041. // all tag keys, and at least one value of each specified tag key, are returned
  2042. // in your query. If you specify more than one value for a tag key, a resource
  2043. // matches the filter if it has a tag key value that matches any of the specified
  2044. // values.
  2045. //
  2046. // For example, consider the following sample query for resources that have
  2047. // two tags, Stage and Version, with two values each. ([{"Key":"Stage","Values":["Test","Deploy"]},{"Key":"Version","Values":["1","2"]}])
  2048. // The results of this query might include the following.
  2049. //
  2050. // * An EC2 instance that has the following two tags: {"Key":"Stage","Values":["Deploy"]},
  2051. // and {"Key":"Version","Values":["2"]}
  2052. //
  2053. // * An S3 bucket that has the following two tags: {"Key":"Stage","Values":["Test","Deploy"]},
  2054. // and {"Key":"Version","Values":["1"]}
  2055. //
  2056. // The query would not return the following results, however. The following
  2057. // EC2 instance does not have all tag keys specified in the filter, so it is
  2058. // rejected. The RDS database has all of the tag keys, but no values that match
  2059. // at least one of the specified tag key values in the filter.
  2060. //
  2061. // * An EC2 instance that has only the following tag: {"Key":"Stage","Values":["Deploy"]}.
  2062. //
  2063. // * An RDS database that has the following two tags: {"Key":"Stage","Values":["Archived"]},
  2064. // and {"Key":"Version","Values":["4"]}
  2065. //
  2066. // CLOUDFORMATION_STACK_1_0: A JSON syntax that lets you specify a CloudFormation
  2067. // stack ARN.
  2068. //
  2069. // Type is a required field
  2070. Type *string `type:"string" required:"true" enum:"QueryType"`
  2071. }
  2072. // String returns the string representation
  2073. func (s ResourceQuery) String() string {
  2074. return awsutil.Prettify(s)
  2075. }
  2076. // GoString returns the string representation
  2077. func (s ResourceQuery) GoString() string {
  2078. return s.String()
  2079. }
  2080. // Validate inspects the fields of the type to determine if they are valid.
  2081. func (s *ResourceQuery) Validate() error {
  2082. invalidParams := request.ErrInvalidParams{Context: "ResourceQuery"}
  2083. if s.Query == nil {
  2084. invalidParams.Add(request.NewErrParamRequired("Query"))
  2085. }
  2086. if s.Type == nil {
  2087. invalidParams.Add(request.NewErrParamRequired("Type"))
  2088. }
  2089. if invalidParams.Len() > 0 {
  2090. return invalidParams
  2091. }
  2092. return nil
  2093. }
  2094. // SetQuery sets the Query field's value.
  2095. func (s *ResourceQuery) SetQuery(v string) *ResourceQuery {
  2096. s.Query = &v
  2097. return s
  2098. }
  2099. // SetType sets the Type field's value.
  2100. func (s *ResourceQuery) SetType(v string) *ResourceQuery {
  2101. s.Type = &v
  2102. return s
  2103. }
  2104. type SearchResourcesInput struct {
  2105. _ struct{} `type:"structure"`
  2106. // The maximum number of group member ARNs returned by SearchResources in paginated
  2107. // output. By default, this number is 50.
  2108. MaxResults *int64 `min:"1" type:"integer"`
  2109. // The NextToken value that is returned in a paginated SearchResources request.
  2110. // To get the next page of results, run the call again, add the NextToken parameter,
  2111. // and specify the NextToken value.
  2112. NextToken *string `type:"string"`
  2113. // The search query, using the same formats that are supported for resource
  2114. // group definition.
  2115. //
  2116. // ResourceQuery is a required field
  2117. ResourceQuery *ResourceQuery `type:"structure" required:"true"`
  2118. }
  2119. // String returns the string representation
  2120. func (s SearchResourcesInput) String() string {
  2121. return awsutil.Prettify(s)
  2122. }
  2123. // GoString returns the string representation
  2124. func (s SearchResourcesInput) GoString() string {
  2125. return s.String()
  2126. }
  2127. // Validate inspects the fields of the type to determine if they are valid.
  2128. func (s *SearchResourcesInput) Validate() error {
  2129. invalidParams := request.ErrInvalidParams{Context: "SearchResourcesInput"}
  2130. if s.MaxResults != nil && *s.MaxResults < 1 {
  2131. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  2132. }
  2133. if s.ResourceQuery == nil {
  2134. invalidParams.Add(request.NewErrParamRequired("ResourceQuery"))
  2135. }
  2136. if s.ResourceQuery != nil {
  2137. if err := s.ResourceQuery.Validate(); err != nil {
  2138. invalidParams.AddNested("ResourceQuery", err.(request.ErrInvalidParams))
  2139. }
  2140. }
  2141. if invalidParams.Len() > 0 {
  2142. return invalidParams
  2143. }
  2144. return nil
  2145. }
  2146. // SetMaxResults sets the MaxResults field's value.
  2147. func (s *SearchResourcesInput) SetMaxResults(v int64) *SearchResourcesInput {
  2148. s.MaxResults = &v
  2149. return s
  2150. }
  2151. // SetNextToken sets the NextToken field's value.
  2152. func (s *SearchResourcesInput) SetNextToken(v string) *SearchResourcesInput {
  2153. s.NextToken = &v
  2154. return s
  2155. }
  2156. // SetResourceQuery sets the ResourceQuery field's value.
  2157. func (s *SearchResourcesInput) SetResourceQuery(v *ResourceQuery) *SearchResourcesInput {
  2158. s.ResourceQuery = v
  2159. return s
  2160. }
  2161. type SearchResourcesOutput struct {
  2162. _ struct{} `type:"structure"`
  2163. // The NextToken value to include in a subsequent SearchResources request, to
  2164. // get more results.
  2165. NextToken *string `type:"string"`
  2166. // A list of QueryError objects. Each error is an object that contains ErrorCode
  2167. // and Message structures. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE
  2168. // and CLOUDFORMATION_STACK_NOT_EXISTING.
  2169. QueryErrors []*QueryError `type:"list"`
  2170. // The ARNs and resource types of resources that are members of the group that
  2171. // you specified.
  2172. ResourceIdentifiers []*ResourceIdentifier `type:"list"`
  2173. }
  2174. // String returns the string representation
  2175. func (s SearchResourcesOutput) String() string {
  2176. return awsutil.Prettify(s)
  2177. }
  2178. // GoString returns the string representation
  2179. func (s SearchResourcesOutput) GoString() string {
  2180. return s.String()
  2181. }
  2182. // SetNextToken sets the NextToken field's value.
  2183. func (s *SearchResourcesOutput) SetNextToken(v string) *SearchResourcesOutput {
  2184. s.NextToken = &v
  2185. return s
  2186. }
  2187. // SetQueryErrors sets the QueryErrors field's value.
  2188. func (s *SearchResourcesOutput) SetQueryErrors(v []*QueryError) *SearchResourcesOutput {
  2189. s.QueryErrors = v
  2190. return s
  2191. }
  2192. // SetResourceIdentifiers sets the ResourceIdentifiers field's value.
  2193. func (s *SearchResourcesOutput) SetResourceIdentifiers(v []*ResourceIdentifier) *SearchResourcesOutput {
  2194. s.ResourceIdentifiers = v
  2195. return s
  2196. }
  2197. type TagInput struct {
  2198. _ struct{} `type:"structure"`
  2199. // The ARN of the resource to which to add tags.
  2200. //
  2201. // Arn is a required field
  2202. Arn *string `location:"uri" locationName:"Arn" type:"string" required:"true"`
  2203. // The tags to add to the specified resource. A tag is a string-to-string map
  2204. // of key-value pairs. Tag keys can have a maximum character length of 128 characters,
  2205. // and tag values can have a maximum length of 256 characters.
  2206. //
  2207. // Tags is a required field
  2208. Tags map[string]*string `type:"map" required:"true"`
  2209. }
  2210. // String returns the string representation
  2211. func (s TagInput) String() string {
  2212. return awsutil.Prettify(s)
  2213. }
  2214. // GoString returns the string representation
  2215. func (s TagInput) GoString() string {
  2216. return s.String()
  2217. }
  2218. // Validate inspects the fields of the type to determine if they are valid.
  2219. func (s *TagInput) Validate() error {
  2220. invalidParams := request.ErrInvalidParams{Context: "TagInput"}
  2221. if s.Arn == nil {
  2222. invalidParams.Add(request.NewErrParamRequired("Arn"))
  2223. }
  2224. if s.Arn != nil && len(*s.Arn) < 1 {
  2225. invalidParams.Add(request.NewErrParamMinLen("Arn", 1))
  2226. }
  2227. if s.Tags == nil {
  2228. invalidParams.Add(request.NewErrParamRequired("Tags"))
  2229. }
  2230. if invalidParams.Len() > 0 {
  2231. return invalidParams
  2232. }
  2233. return nil
  2234. }
  2235. // SetArn sets the Arn field's value.
  2236. func (s *TagInput) SetArn(v string) *TagInput {
  2237. s.Arn = &v
  2238. return s
  2239. }
  2240. // SetTags sets the Tags field's value.
  2241. func (s *TagInput) SetTags(v map[string]*string) *TagInput {
  2242. s.Tags = v
  2243. return s
  2244. }
  2245. type TagOutput struct {
  2246. _ struct{} `type:"structure"`
  2247. // The ARN of the tagged resource.
  2248. Arn *string `type:"string"`
  2249. // The tags that have been added to the specified resource.
  2250. Tags map[string]*string `type:"map"`
  2251. }
  2252. // String returns the string representation
  2253. func (s TagOutput) String() string {
  2254. return awsutil.Prettify(s)
  2255. }
  2256. // GoString returns the string representation
  2257. func (s TagOutput) GoString() string {
  2258. return s.String()
  2259. }
  2260. // SetArn sets the Arn field's value.
  2261. func (s *TagOutput) SetArn(v string) *TagOutput {
  2262. s.Arn = &v
  2263. return s
  2264. }
  2265. // SetTags sets the Tags field's value.
  2266. func (s *TagOutput) SetTags(v map[string]*string) *TagOutput {
  2267. s.Tags = v
  2268. return s
  2269. }
  2270. type UntagInput struct {
  2271. _ struct{} `type:"structure"`
  2272. // The ARN of the resource from which to remove tags.
  2273. //
  2274. // Arn is a required field
  2275. Arn *string `location:"uri" locationName:"Arn" type:"string" required:"true"`
  2276. // The keys of the tags to be removed.
  2277. //
  2278. // Keys is a required field
  2279. Keys []*string `type:"list" required:"true"`
  2280. }
  2281. // String returns the string representation
  2282. func (s UntagInput) String() string {
  2283. return awsutil.Prettify(s)
  2284. }
  2285. // GoString returns the string representation
  2286. func (s UntagInput) GoString() string {
  2287. return s.String()
  2288. }
  2289. // Validate inspects the fields of the type to determine if they are valid.
  2290. func (s *UntagInput) Validate() error {
  2291. invalidParams := request.ErrInvalidParams{Context: "UntagInput"}
  2292. if s.Arn == nil {
  2293. invalidParams.Add(request.NewErrParamRequired("Arn"))
  2294. }
  2295. if s.Arn != nil && len(*s.Arn) < 1 {
  2296. invalidParams.Add(request.NewErrParamMinLen("Arn", 1))
  2297. }
  2298. if s.Keys == nil {
  2299. invalidParams.Add(request.NewErrParamRequired("Keys"))
  2300. }
  2301. if invalidParams.Len() > 0 {
  2302. return invalidParams
  2303. }
  2304. return nil
  2305. }
  2306. // SetArn sets the Arn field's value.
  2307. func (s *UntagInput) SetArn(v string) *UntagInput {
  2308. s.Arn = &v
  2309. return s
  2310. }
  2311. // SetKeys sets the Keys field's value.
  2312. func (s *UntagInput) SetKeys(v []*string) *UntagInput {
  2313. s.Keys = v
  2314. return s
  2315. }
  2316. type UntagOutput struct {
  2317. _ struct{} `type:"structure"`
  2318. // The ARN of the resource from which tags have been removed.
  2319. Arn *string `type:"string"`
  2320. // The keys of tags that have been removed.
  2321. Keys []*string `type:"list"`
  2322. }
  2323. // String returns the string representation
  2324. func (s UntagOutput) String() string {
  2325. return awsutil.Prettify(s)
  2326. }
  2327. // GoString returns the string representation
  2328. func (s UntagOutput) GoString() string {
  2329. return s.String()
  2330. }
  2331. // SetArn sets the Arn field's value.
  2332. func (s *UntagOutput) SetArn(v string) *UntagOutput {
  2333. s.Arn = &v
  2334. return s
  2335. }
  2336. // SetKeys sets the Keys field's value.
  2337. func (s *UntagOutput) SetKeys(v []*string) *UntagOutput {
  2338. s.Keys = v
  2339. return s
  2340. }
  2341. type UpdateGroupInput struct {
  2342. _ struct{} `type:"structure"`
  2343. // The description of the resource group. Descriptions can have a maximum of
  2344. // 511 characters, including letters, numbers, hyphens, underscores, punctuation,
  2345. // and spaces.
  2346. Description *string `type:"string"`
  2347. // The name of the resource group for which you want to update its description.
  2348. //
  2349. // GroupName is a required field
  2350. GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
  2351. }
  2352. // String returns the string representation
  2353. func (s UpdateGroupInput) String() string {
  2354. return awsutil.Prettify(s)
  2355. }
  2356. // GoString returns the string representation
  2357. func (s UpdateGroupInput) GoString() string {
  2358. return s.String()
  2359. }
  2360. // Validate inspects the fields of the type to determine if they are valid.
  2361. func (s *UpdateGroupInput) Validate() error {
  2362. invalidParams := request.ErrInvalidParams{Context: "UpdateGroupInput"}
  2363. if s.GroupName == nil {
  2364. invalidParams.Add(request.NewErrParamRequired("GroupName"))
  2365. }
  2366. if s.GroupName != nil && len(*s.GroupName) < 1 {
  2367. invalidParams.Add(request.NewErrParamMinLen("GroupName", 1))
  2368. }
  2369. if invalidParams.Len() > 0 {
  2370. return invalidParams
  2371. }
  2372. return nil
  2373. }
  2374. // SetDescription sets the Description field's value.
  2375. func (s *UpdateGroupInput) SetDescription(v string) *UpdateGroupInput {
  2376. s.Description = &v
  2377. return s
  2378. }
  2379. // SetGroupName sets the GroupName field's value.
  2380. func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput {
  2381. s.GroupName = &v
  2382. return s
  2383. }
  2384. type UpdateGroupOutput struct {
  2385. _ struct{} `type:"structure"`
  2386. // The full description of the resource group after it has been updated.
  2387. Group *Group `type:"structure"`
  2388. }
  2389. // String returns the string representation
  2390. func (s UpdateGroupOutput) String() string {
  2391. return awsutil.Prettify(s)
  2392. }
  2393. // GoString returns the string representation
  2394. func (s UpdateGroupOutput) GoString() string {
  2395. return s.String()
  2396. }
  2397. // SetGroup sets the Group field's value.
  2398. func (s *UpdateGroupOutput) SetGroup(v *Group) *UpdateGroupOutput {
  2399. s.Group = v
  2400. return s
  2401. }
  2402. type UpdateGroupQueryInput struct {
  2403. _ struct{} `type:"structure"`
  2404. // The name of the resource group for which you want to edit the query.
  2405. //
  2406. // GroupName is a required field
  2407. GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
  2408. // The resource query that determines which AWS resources are members of the
  2409. // resource group.
  2410. //
  2411. // ResourceQuery is a required field
  2412. ResourceQuery *ResourceQuery `type:"structure" required:"true"`
  2413. }
  2414. // String returns the string representation
  2415. func (s UpdateGroupQueryInput) String() string {
  2416. return awsutil.Prettify(s)
  2417. }
  2418. // GoString returns the string representation
  2419. func (s UpdateGroupQueryInput) GoString() string {
  2420. return s.String()
  2421. }
  2422. // Validate inspects the fields of the type to determine if they are valid.
  2423. func (s *UpdateGroupQueryInput) Validate() error {
  2424. invalidParams := request.ErrInvalidParams{Context: "UpdateGroupQueryInput"}
  2425. if s.GroupName == nil {
  2426. invalidParams.Add(request.NewErrParamRequired("GroupName"))
  2427. }
  2428. if s.GroupName != nil && len(*s.GroupName) < 1 {
  2429. invalidParams.Add(request.NewErrParamMinLen("GroupName", 1))
  2430. }
  2431. if s.ResourceQuery == nil {
  2432. invalidParams.Add(request.NewErrParamRequired("ResourceQuery"))
  2433. }
  2434. if s.ResourceQuery != nil {
  2435. if err := s.ResourceQuery.Validate(); err != nil {
  2436. invalidParams.AddNested("ResourceQuery", err.(request.ErrInvalidParams))
  2437. }
  2438. }
  2439. if invalidParams.Len() > 0 {
  2440. return invalidParams
  2441. }
  2442. return nil
  2443. }
  2444. // SetGroupName sets the GroupName field's value.
  2445. func (s *UpdateGroupQueryInput) SetGroupName(v string) *UpdateGroupQueryInput {
  2446. s.GroupName = &v
  2447. return s
  2448. }
  2449. // SetResourceQuery sets the ResourceQuery field's value.
  2450. func (s *UpdateGroupQueryInput) SetResourceQuery(v *ResourceQuery) *UpdateGroupQueryInput {
  2451. s.ResourceQuery = v
  2452. return s
  2453. }
  2454. type UpdateGroupQueryOutput struct {
  2455. _ struct{} `type:"structure"`
  2456. // The resource query associated with the resource group after the update.
  2457. GroupQuery *GroupQuery `type:"structure"`
  2458. }
  2459. // String returns the string representation
  2460. func (s UpdateGroupQueryOutput) String() string {
  2461. return awsutil.Prettify(s)
  2462. }
  2463. // GoString returns the string representation
  2464. func (s UpdateGroupQueryOutput) GoString() string {
  2465. return s.String()
  2466. }
  2467. // SetGroupQuery sets the GroupQuery field's value.
  2468. func (s *UpdateGroupQueryOutput) SetGroupQuery(v *GroupQuery) *UpdateGroupQueryOutput {
  2469. s.GroupQuery = v
  2470. return s
  2471. }
  2472. const (
  2473. // GroupFilterNameResourceType is a GroupFilterName enum value
  2474. GroupFilterNameResourceType = "resource-type"
  2475. )
  2476. const (
  2477. // QueryErrorCodeCloudformationStackInactive is a QueryErrorCode enum value
  2478. QueryErrorCodeCloudformationStackInactive = "CLOUDFORMATION_STACK_INACTIVE"
  2479. // QueryErrorCodeCloudformationStackNotExisting is a QueryErrorCode enum value
  2480. QueryErrorCodeCloudformationStackNotExisting = "CLOUDFORMATION_STACK_NOT_EXISTING"
  2481. )
  2482. const (
  2483. // QueryTypeTagFilters10 is a QueryType enum value
  2484. QueryTypeTagFilters10 = "TAG_FILTERS_1_0"
  2485. // QueryTypeCloudformationStack10 is a QueryType enum value
  2486. QueryTypeCloudformationStack10 = "CLOUDFORMATION_STACK_1_0"
  2487. )
  2488. const (
  2489. // ResourceFilterNameResourceType is a ResourceFilterName enum value
  2490. ResourceFilterNameResourceType = "resource-type"
  2491. )