api.go 119 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package budgets
  3. import (
  4. "fmt"
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  11. )
  12. const opCreateBudget = "CreateBudget"
  13. // CreateBudgetRequest generates a "aws/request.Request" representing the
  14. // client's request for the CreateBudget operation. The "output" return
  15. // value will be populated with the request's response once the request completes
  16. // successfully.
  17. //
  18. // Use "Send" method on the returned Request to send the API call to the service.
  19. // the "output" return value is not valid until after Send returns without error.
  20. //
  21. // See CreateBudget for more information on using the CreateBudget
  22. // API call, and error handling.
  23. //
  24. // This method is useful when you want to inject custom logic or configuration
  25. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  26. //
  27. //
  28. // // Example sending a request using the CreateBudgetRequest method.
  29. // req, resp := client.CreateBudgetRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. func (c *Budgets) CreateBudgetRequest(input *CreateBudgetInput) (req *request.Request, output *CreateBudgetOutput) {
  36. op := &request.Operation{
  37. Name: opCreateBudget,
  38. HTTPMethod: "POST",
  39. HTTPPath: "/",
  40. }
  41. if input == nil {
  42. input = &CreateBudgetInput{}
  43. }
  44. output = &CreateBudgetOutput{}
  45. req = c.newRequest(op, input, output)
  46. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  47. return
  48. }
  49. // CreateBudget API operation for AWS Budgets.
  50. //
  51. // Creates a budget and, if included, notifications and subscribers.
  52. //
  53. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  54. // with awserr.Error's Code and Message methods to get detailed information about
  55. // the error.
  56. //
  57. // See the AWS API reference guide for AWS Budgets's
  58. // API operation CreateBudget for usage and error information.
  59. //
  60. // Returned Error Codes:
  61. // * ErrCodeInvalidParameterException "InvalidParameterException"
  62. // An error on the client occurred. Typically, the cause is an invalid input
  63. // value.
  64. //
  65. // * ErrCodeInternalErrorException "InternalErrorException"
  66. // An error on the server occurred during the processing of your request. Try
  67. // again later.
  68. //
  69. // * ErrCodeCreationLimitExceededException "CreationLimitExceededException"
  70. // You've exceeded the notification or subscriber limit.
  71. //
  72. // * ErrCodeDuplicateRecordException "DuplicateRecordException"
  73. // The budget name already exists. Budget names must be unique within an account.
  74. //
  75. func (c *Budgets) CreateBudget(input *CreateBudgetInput) (*CreateBudgetOutput, error) {
  76. req, out := c.CreateBudgetRequest(input)
  77. return out, req.Send()
  78. }
  79. // CreateBudgetWithContext is the same as CreateBudget with the addition of
  80. // the ability to pass a context and additional request options.
  81. //
  82. // See CreateBudget for details on how to use this API operation.
  83. //
  84. // The context must be non-nil and will be used for request cancellation. If
  85. // the context is nil a panic will occur. In the future the SDK may create
  86. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  87. // for more information on using Contexts.
  88. func (c *Budgets) CreateBudgetWithContext(ctx aws.Context, input *CreateBudgetInput, opts ...request.Option) (*CreateBudgetOutput, error) {
  89. req, out := c.CreateBudgetRequest(input)
  90. req.SetContext(ctx)
  91. req.ApplyOptions(opts...)
  92. return out, req.Send()
  93. }
  94. const opCreateNotification = "CreateNotification"
  95. // CreateNotificationRequest generates a "aws/request.Request" representing the
  96. // client's request for the CreateNotification operation. The "output" return
  97. // value will be populated with the request's response once the request completes
  98. // successfully.
  99. //
  100. // Use "Send" method on the returned Request to send the API call to the service.
  101. // the "output" return value is not valid until after Send returns without error.
  102. //
  103. // See CreateNotification for more information on using the CreateNotification
  104. // API call, and error handling.
  105. //
  106. // This method is useful when you want to inject custom logic or configuration
  107. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  108. //
  109. //
  110. // // Example sending a request using the CreateNotificationRequest method.
  111. // req, resp := client.CreateNotificationRequest(params)
  112. //
  113. // err := req.Send()
  114. // if err == nil { // resp is now filled
  115. // fmt.Println(resp)
  116. // }
  117. func (c *Budgets) CreateNotificationRequest(input *CreateNotificationInput) (req *request.Request, output *CreateNotificationOutput) {
  118. op := &request.Operation{
  119. Name: opCreateNotification,
  120. HTTPMethod: "POST",
  121. HTTPPath: "/",
  122. }
  123. if input == nil {
  124. input = &CreateNotificationInput{}
  125. }
  126. output = &CreateNotificationOutput{}
  127. req = c.newRequest(op, input, output)
  128. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  129. return
  130. }
  131. // CreateNotification API operation for AWS Budgets.
  132. //
  133. // Creates a notification. You must create the budget before you create the
  134. // associated notification.
  135. //
  136. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  137. // with awserr.Error's Code and Message methods to get detailed information about
  138. // the error.
  139. //
  140. // See the AWS API reference guide for AWS Budgets's
  141. // API operation CreateNotification for usage and error information.
  142. //
  143. // Returned Error Codes:
  144. // * ErrCodeInternalErrorException "InternalErrorException"
  145. // An error on the server occurred during the processing of your request. Try
  146. // again later.
  147. //
  148. // * ErrCodeInvalidParameterException "InvalidParameterException"
  149. // An error on the client occurred. Typically, the cause is an invalid input
  150. // value.
  151. //
  152. // * ErrCodeNotFoundException "NotFoundException"
  153. // We can’t locate the resource that you specified.
  154. //
  155. // * ErrCodeCreationLimitExceededException "CreationLimitExceededException"
  156. // You've exceeded the notification or subscriber limit.
  157. //
  158. // * ErrCodeDuplicateRecordException "DuplicateRecordException"
  159. // The budget name already exists. Budget names must be unique within an account.
  160. //
  161. func (c *Budgets) CreateNotification(input *CreateNotificationInput) (*CreateNotificationOutput, error) {
  162. req, out := c.CreateNotificationRequest(input)
  163. return out, req.Send()
  164. }
  165. // CreateNotificationWithContext is the same as CreateNotification with the addition of
  166. // the ability to pass a context and additional request options.
  167. //
  168. // See CreateNotification for details on how to use this API operation.
  169. //
  170. // The context must be non-nil and will be used for request cancellation. If
  171. // the context is nil a panic will occur. In the future the SDK may create
  172. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  173. // for more information on using Contexts.
  174. func (c *Budgets) CreateNotificationWithContext(ctx aws.Context, input *CreateNotificationInput, opts ...request.Option) (*CreateNotificationOutput, error) {
  175. req, out := c.CreateNotificationRequest(input)
  176. req.SetContext(ctx)
  177. req.ApplyOptions(opts...)
  178. return out, req.Send()
  179. }
  180. const opCreateSubscriber = "CreateSubscriber"
  181. // CreateSubscriberRequest generates a "aws/request.Request" representing the
  182. // client's request for the CreateSubscriber operation. The "output" return
  183. // value will be populated with the request's response once the request completes
  184. // successfully.
  185. //
  186. // Use "Send" method on the returned Request to send the API call to the service.
  187. // the "output" return value is not valid until after Send returns without error.
  188. //
  189. // See CreateSubscriber for more information on using the CreateSubscriber
  190. // API call, and error handling.
  191. //
  192. // This method is useful when you want to inject custom logic or configuration
  193. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  194. //
  195. //
  196. // // Example sending a request using the CreateSubscriberRequest method.
  197. // req, resp := client.CreateSubscriberRequest(params)
  198. //
  199. // err := req.Send()
  200. // if err == nil { // resp is now filled
  201. // fmt.Println(resp)
  202. // }
  203. func (c *Budgets) CreateSubscriberRequest(input *CreateSubscriberInput) (req *request.Request, output *CreateSubscriberOutput) {
  204. op := &request.Operation{
  205. Name: opCreateSubscriber,
  206. HTTPMethod: "POST",
  207. HTTPPath: "/",
  208. }
  209. if input == nil {
  210. input = &CreateSubscriberInput{}
  211. }
  212. output = &CreateSubscriberOutput{}
  213. req = c.newRequest(op, input, output)
  214. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  215. return
  216. }
  217. // CreateSubscriber API operation for AWS Budgets.
  218. //
  219. // Creates a subscriber. You must create the associated budget and notification
  220. // before you create the subscriber.
  221. //
  222. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  223. // with awserr.Error's Code and Message methods to get detailed information about
  224. // the error.
  225. //
  226. // See the AWS API reference guide for AWS Budgets's
  227. // API operation CreateSubscriber for usage and error information.
  228. //
  229. // Returned Error Codes:
  230. // * ErrCodeInternalErrorException "InternalErrorException"
  231. // An error on the server occurred during the processing of your request. Try
  232. // again later.
  233. //
  234. // * ErrCodeInvalidParameterException "InvalidParameterException"
  235. // An error on the client occurred. Typically, the cause is an invalid input
  236. // value.
  237. //
  238. // * ErrCodeCreationLimitExceededException "CreationLimitExceededException"
  239. // You've exceeded the notification or subscriber limit.
  240. //
  241. // * ErrCodeDuplicateRecordException "DuplicateRecordException"
  242. // The budget name already exists. Budget names must be unique within an account.
  243. //
  244. // * ErrCodeNotFoundException "NotFoundException"
  245. // We can’t locate the resource that you specified.
  246. //
  247. func (c *Budgets) CreateSubscriber(input *CreateSubscriberInput) (*CreateSubscriberOutput, error) {
  248. req, out := c.CreateSubscriberRequest(input)
  249. return out, req.Send()
  250. }
  251. // CreateSubscriberWithContext is the same as CreateSubscriber with the addition of
  252. // the ability to pass a context and additional request options.
  253. //
  254. // See CreateSubscriber for details on how to use this API operation.
  255. //
  256. // The context must be non-nil and will be used for request cancellation. If
  257. // the context is nil a panic will occur. In the future the SDK may create
  258. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  259. // for more information on using Contexts.
  260. func (c *Budgets) CreateSubscriberWithContext(ctx aws.Context, input *CreateSubscriberInput, opts ...request.Option) (*CreateSubscriberOutput, error) {
  261. req, out := c.CreateSubscriberRequest(input)
  262. req.SetContext(ctx)
  263. req.ApplyOptions(opts...)
  264. return out, req.Send()
  265. }
  266. const opDeleteBudget = "DeleteBudget"
  267. // DeleteBudgetRequest generates a "aws/request.Request" representing the
  268. // client's request for the DeleteBudget operation. The "output" return
  269. // value will be populated with the request's response once the request completes
  270. // successfully.
  271. //
  272. // Use "Send" method on the returned Request to send the API call to the service.
  273. // the "output" return value is not valid until after Send returns without error.
  274. //
  275. // See DeleteBudget for more information on using the DeleteBudget
  276. // API call, and error handling.
  277. //
  278. // This method is useful when you want to inject custom logic or configuration
  279. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  280. //
  281. //
  282. // // Example sending a request using the DeleteBudgetRequest method.
  283. // req, resp := client.DeleteBudgetRequest(params)
  284. //
  285. // err := req.Send()
  286. // if err == nil { // resp is now filled
  287. // fmt.Println(resp)
  288. // }
  289. func (c *Budgets) DeleteBudgetRequest(input *DeleteBudgetInput) (req *request.Request, output *DeleteBudgetOutput) {
  290. op := &request.Operation{
  291. Name: opDeleteBudget,
  292. HTTPMethod: "POST",
  293. HTTPPath: "/",
  294. }
  295. if input == nil {
  296. input = &DeleteBudgetInput{}
  297. }
  298. output = &DeleteBudgetOutput{}
  299. req = c.newRequest(op, input, output)
  300. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  301. return
  302. }
  303. // DeleteBudget API operation for AWS Budgets.
  304. //
  305. // Deletes a budget. You can delete your budget at any time.
  306. //
  307. // Deleting a budget also deletes the notifications and subscribers that are
  308. // associated with that budget.
  309. //
  310. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  311. // with awserr.Error's Code and Message methods to get detailed information about
  312. // the error.
  313. //
  314. // See the AWS API reference guide for AWS Budgets's
  315. // API operation DeleteBudget for usage and error information.
  316. //
  317. // Returned Error Codes:
  318. // * ErrCodeInternalErrorException "InternalErrorException"
  319. // An error on the server occurred during the processing of your request. Try
  320. // again later.
  321. //
  322. // * ErrCodeInvalidParameterException "InvalidParameterException"
  323. // An error on the client occurred. Typically, the cause is an invalid input
  324. // value.
  325. //
  326. // * ErrCodeNotFoundException "NotFoundException"
  327. // We can’t locate the resource that you specified.
  328. //
  329. func (c *Budgets) DeleteBudget(input *DeleteBudgetInput) (*DeleteBudgetOutput, error) {
  330. req, out := c.DeleteBudgetRequest(input)
  331. return out, req.Send()
  332. }
  333. // DeleteBudgetWithContext is the same as DeleteBudget with the addition of
  334. // the ability to pass a context and additional request options.
  335. //
  336. // See DeleteBudget for details on how to use this API operation.
  337. //
  338. // The context must be non-nil and will be used for request cancellation. If
  339. // the context is nil a panic will occur. In the future the SDK may create
  340. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  341. // for more information on using Contexts.
  342. func (c *Budgets) DeleteBudgetWithContext(ctx aws.Context, input *DeleteBudgetInput, opts ...request.Option) (*DeleteBudgetOutput, error) {
  343. req, out := c.DeleteBudgetRequest(input)
  344. req.SetContext(ctx)
  345. req.ApplyOptions(opts...)
  346. return out, req.Send()
  347. }
  348. const opDeleteNotification = "DeleteNotification"
  349. // DeleteNotificationRequest generates a "aws/request.Request" representing the
  350. // client's request for the DeleteNotification operation. The "output" return
  351. // value will be populated with the request's response once the request completes
  352. // successfully.
  353. //
  354. // Use "Send" method on the returned Request to send the API call to the service.
  355. // the "output" return value is not valid until after Send returns without error.
  356. //
  357. // See DeleteNotification for more information on using the DeleteNotification
  358. // API call, and error handling.
  359. //
  360. // This method is useful when you want to inject custom logic or configuration
  361. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  362. //
  363. //
  364. // // Example sending a request using the DeleteNotificationRequest method.
  365. // req, resp := client.DeleteNotificationRequest(params)
  366. //
  367. // err := req.Send()
  368. // if err == nil { // resp is now filled
  369. // fmt.Println(resp)
  370. // }
  371. func (c *Budgets) DeleteNotificationRequest(input *DeleteNotificationInput) (req *request.Request, output *DeleteNotificationOutput) {
  372. op := &request.Operation{
  373. Name: opDeleteNotification,
  374. HTTPMethod: "POST",
  375. HTTPPath: "/",
  376. }
  377. if input == nil {
  378. input = &DeleteNotificationInput{}
  379. }
  380. output = &DeleteNotificationOutput{}
  381. req = c.newRequest(op, input, output)
  382. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  383. return
  384. }
  385. // DeleteNotification API operation for AWS Budgets.
  386. //
  387. // Deletes a notification.
  388. //
  389. // Deleting a notification also deletes the subscribers that are associated
  390. // with the notification.
  391. //
  392. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  393. // with awserr.Error's Code and Message methods to get detailed information about
  394. // the error.
  395. //
  396. // See the AWS API reference guide for AWS Budgets's
  397. // API operation DeleteNotification for usage and error information.
  398. //
  399. // Returned Error Codes:
  400. // * ErrCodeInvalidParameterException "InvalidParameterException"
  401. // An error on the client occurred. Typically, the cause is an invalid input
  402. // value.
  403. //
  404. // * ErrCodeInternalErrorException "InternalErrorException"
  405. // An error on the server occurred during the processing of your request. Try
  406. // again later.
  407. //
  408. // * ErrCodeNotFoundException "NotFoundException"
  409. // We can’t locate the resource that you specified.
  410. //
  411. func (c *Budgets) DeleteNotification(input *DeleteNotificationInput) (*DeleteNotificationOutput, error) {
  412. req, out := c.DeleteNotificationRequest(input)
  413. return out, req.Send()
  414. }
  415. // DeleteNotificationWithContext is the same as DeleteNotification with the addition of
  416. // the ability to pass a context and additional request options.
  417. //
  418. // See DeleteNotification for details on how to use this API operation.
  419. //
  420. // The context must be non-nil and will be used for request cancellation. If
  421. // the context is nil a panic will occur. In the future the SDK may create
  422. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  423. // for more information on using Contexts.
  424. func (c *Budgets) DeleteNotificationWithContext(ctx aws.Context, input *DeleteNotificationInput, opts ...request.Option) (*DeleteNotificationOutput, error) {
  425. req, out := c.DeleteNotificationRequest(input)
  426. req.SetContext(ctx)
  427. req.ApplyOptions(opts...)
  428. return out, req.Send()
  429. }
  430. const opDeleteSubscriber = "DeleteSubscriber"
  431. // DeleteSubscriberRequest generates a "aws/request.Request" representing the
  432. // client's request for the DeleteSubscriber operation. The "output" return
  433. // value will be populated with the request's response once the request completes
  434. // successfully.
  435. //
  436. // Use "Send" method on the returned Request to send the API call to the service.
  437. // the "output" return value is not valid until after Send returns without error.
  438. //
  439. // See DeleteSubscriber for more information on using the DeleteSubscriber
  440. // API call, and error handling.
  441. //
  442. // This method is useful when you want to inject custom logic or configuration
  443. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  444. //
  445. //
  446. // // Example sending a request using the DeleteSubscriberRequest method.
  447. // req, resp := client.DeleteSubscriberRequest(params)
  448. //
  449. // err := req.Send()
  450. // if err == nil { // resp is now filled
  451. // fmt.Println(resp)
  452. // }
  453. func (c *Budgets) DeleteSubscriberRequest(input *DeleteSubscriberInput) (req *request.Request, output *DeleteSubscriberOutput) {
  454. op := &request.Operation{
  455. Name: opDeleteSubscriber,
  456. HTTPMethod: "POST",
  457. HTTPPath: "/",
  458. }
  459. if input == nil {
  460. input = &DeleteSubscriberInput{}
  461. }
  462. output = &DeleteSubscriberOutput{}
  463. req = c.newRequest(op, input, output)
  464. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  465. return
  466. }
  467. // DeleteSubscriber API operation for AWS Budgets.
  468. //
  469. // Deletes a subscriber.
  470. //
  471. // Deleting the last subscriber to a notification also deletes the notification.
  472. //
  473. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  474. // with awserr.Error's Code and Message methods to get detailed information about
  475. // the error.
  476. //
  477. // See the AWS API reference guide for AWS Budgets's
  478. // API operation DeleteSubscriber for usage and error information.
  479. //
  480. // Returned Error Codes:
  481. // * ErrCodeInternalErrorException "InternalErrorException"
  482. // An error on the server occurred during the processing of your request. Try
  483. // again later.
  484. //
  485. // * ErrCodeInvalidParameterException "InvalidParameterException"
  486. // An error on the client occurred. Typically, the cause is an invalid input
  487. // value.
  488. //
  489. // * ErrCodeNotFoundException "NotFoundException"
  490. // We can’t locate the resource that you specified.
  491. //
  492. func (c *Budgets) DeleteSubscriber(input *DeleteSubscriberInput) (*DeleteSubscriberOutput, error) {
  493. req, out := c.DeleteSubscriberRequest(input)
  494. return out, req.Send()
  495. }
  496. // DeleteSubscriberWithContext is the same as DeleteSubscriber with the addition of
  497. // the ability to pass a context and additional request options.
  498. //
  499. // See DeleteSubscriber for details on how to use this API operation.
  500. //
  501. // The context must be non-nil and will be used for request cancellation. If
  502. // the context is nil a panic will occur. In the future the SDK may create
  503. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  504. // for more information on using Contexts.
  505. func (c *Budgets) DeleteSubscriberWithContext(ctx aws.Context, input *DeleteSubscriberInput, opts ...request.Option) (*DeleteSubscriberOutput, error) {
  506. req, out := c.DeleteSubscriberRequest(input)
  507. req.SetContext(ctx)
  508. req.ApplyOptions(opts...)
  509. return out, req.Send()
  510. }
  511. const opDescribeBudget = "DescribeBudget"
  512. // DescribeBudgetRequest generates a "aws/request.Request" representing the
  513. // client's request for the DescribeBudget operation. The "output" return
  514. // value will be populated with the request's response once the request completes
  515. // successfully.
  516. //
  517. // Use "Send" method on the returned Request to send the API call to the service.
  518. // the "output" return value is not valid until after Send returns without error.
  519. //
  520. // See DescribeBudget for more information on using the DescribeBudget
  521. // API call, and error handling.
  522. //
  523. // This method is useful when you want to inject custom logic or configuration
  524. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  525. //
  526. //
  527. // // Example sending a request using the DescribeBudgetRequest method.
  528. // req, resp := client.DescribeBudgetRequest(params)
  529. //
  530. // err := req.Send()
  531. // if err == nil { // resp is now filled
  532. // fmt.Println(resp)
  533. // }
  534. func (c *Budgets) DescribeBudgetRequest(input *DescribeBudgetInput) (req *request.Request, output *DescribeBudgetOutput) {
  535. op := &request.Operation{
  536. Name: opDescribeBudget,
  537. HTTPMethod: "POST",
  538. HTTPPath: "/",
  539. }
  540. if input == nil {
  541. input = &DescribeBudgetInput{}
  542. }
  543. output = &DescribeBudgetOutput{}
  544. req = c.newRequest(op, input, output)
  545. return
  546. }
  547. // DescribeBudget API operation for AWS Budgets.
  548. //
  549. // Describes a budget.
  550. //
  551. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  552. // with awserr.Error's Code and Message methods to get detailed information about
  553. // the error.
  554. //
  555. // See the AWS API reference guide for AWS Budgets's
  556. // API operation DescribeBudget for usage and error information.
  557. //
  558. // Returned Error Codes:
  559. // * ErrCodeInternalErrorException "InternalErrorException"
  560. // An error on the server occurred during the processing of your request. Try
  561. // again later.
  562. //
  563. // * ErrCodeInvalidParameterException "InvalidParameterException"
  564. // An error on the client occurred. Typically, the cause is an invalid input
  565. // value.
  566. //
  567. // * ErrCodeNotFoundException "NotFoundException"
  568. // We can’t locate the resource that you specified.
  569. //
  570. func (c *Budgets) DescribeBudget(input *DescribeBudgetInput) (*DescribeBudgetOutput, error) {
  571. req, out := c.DescribeBudgetRequest(input)
  572. return out, req.Send()
  573. }
  574. // DescribeBudgetWithContext is the same as DescribeBudget with the addition of
  575. // the ability to pass a context and additional request options.
  576. //
  577. // See DescribeBudget for details on how to use this API operation.
  578. //
  579. // The context must be non-nil and will be used for request cancellation. If
  580. // the context is nil a panic will occur. In the future the SDK may create
  581. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  582. // for more information on using Contexts.
  583. func (c *Budgets) DescribeBudgetWithContext(ctx aws.Context, input *DescribeBudgetInput, opts ...request.Option) (*DescribeBudgetOutput, error) {
  584. req, out := c.DescribeBudgetRequest(input)
  585. req.SetContext(ctx)
  586. req.ApplyOptions(opts...)
  587. return out, req.Send()
  588. }
  589. const opDescribeBudgetPerformanceHistory = "DescribeBudgetPerformanceHistory"
  590. // DescribeBudgetPerformanceHistoryRequest generates a "aws/request.Request" representing the
  591. // client's request for the DescribeBudgetPerformanceHistory operation. The "output" return
  592. // value will be populated with the request's response once the request completes
  593. // successfully.
  594. //
  595. // Use "Send" method on the returned Request to send the API call to the service.
  596. // the "output" return value is not valid until after Send returns without error.
  597. //
  598. // See DescribeBudgetPerformanceHistory for more information on using the DescribeBudgetPerformanceHistory
  599. // API call, and error handling.
  600. //
  601. // This method is useful when you want to inject custom logic or configuration
  602. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  603. //
  604. //
  605. // // Example sending a request using the DescribeBudgetPerformanceHistoryRequest method.
  606. // req, resp := client.DescribeBudgetPerformanceHistoryRequest(params)
  607. //
  608. // err := req.Send()
  609. // if err == nil { // resp is now filled
  610. // fmt.Println(resp)
  611. // }
  612. func (c *Budgets) DescribeBudgetPerformanceHistoryRequest(input *DescribeBudgetPerformanceHistoryInput) (req *request.Request, output *DescribeBudgetPerformanceHistoryOutput) {
  613. op := &request.Operation{
  614. Name: opDescribeBudgetPerformanceHistory,
  615. HTTPMethod: "POST",
  616. HTTPPath: "/",
  617. }
  618. if input == nil {
  619. input = &DescribeBudgetPerformanceHistoryInput{}
  620. }
  621. output = &DescribeBudgetPerformanceHistoryOutput{}
  622. req = c.newRequest(op, input, output)
  623. return
  624. }
  625. // DescribeBudgetPerformanceHistory API operation for AWS Budgets.
  626. //
  627. // Describes the history for DAILY, MONTHLY, and QUARTERLY budgets. Budget history
  628. // isn't available for ANNUAL budgets.
  629. //
  630. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  631. // with awserr.Error's Code and Message methods to get detailed information about
  632. // the error.
  633. //
  634. // See the AWS API reference guide for AWS Budgets's
  635. // API operation DescribeBudgetPerformanceHistory for usage and error information.
  636. //
  637. // Returned Error Codes:
  638. // * ErrCodeInternalErrorException "InternalErrorException"
  639. // An error on the server occurred during the processing of your request. Try
  640. // again later.
  641. //
  642. // * ErrCodeInvalidParameterException "InvalidParameterException"
  643. // An error on the client occurred. Typically, the cause is an invalid input
  644. // value.
  645. //
  646. // * ErrCodeNotFoundException "NotFoundException"
  647. // We can’t locate the resource that you specified.
  648. //
  649. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  650. // The pagination token is invalid.
  651. //
  652. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  653. // The pagination token expired.
  654. //
  655. func (c *Budgets) DescribeBudgetPerformanceHistory(input *DescribeBudgetPerformanceHistoryInput) (*DescribeBudgetPerformanceHistoryOutput, error) {
  656. req, out := c.DescribeBudgetPerformanceHistoryRequest(input)
  657. return out, req.Send()
  658. }
  659. // DescribeBudgetPerformanceHistoryWithContext is the same as DescribeBudgetPerformanceHistory with the addition of
  660. // the ability to pass a context and additional request options.
  661. //
  662. // See DescribeBudgetPerformanceHistory for details on how to use this API operation.
  663. //
  664. // The context must be non-nil and will be used for request cancellation. If
  665. // the context is nil a panic will occur. In the future the SDK may create
  666. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  667. // for more information on using Contexts.
  668. func (c *Budgets) DescribeBudgetPerformanceHistoryWithContext(ctx aws.Context, input *DescribeBudgetPerformanceHistoryInput, opts ...request.Option) (*DescribeBudgetPerformanceHistoryOutput, error) {
  669. req, out := c.DescribeBudgetPerformanceHistoryRequest(input)
  670. req.SetContext(ctx)
  671. req.ApplyOptions(opts...)
  672. return out, req.Send()
  673. }
  674. const opDescribeBudgets = "DescribeBudgets"
  675. // DescribeBudgetsRequest generates a "aws/request.Request" representing the
  676. // client's request for the DescribeBudgets operation. The "output" return
  677. // value will be populated with the request's response once the request completes
  678. // successfully.
  679. //
  680. // Use "Send" method on the returned Request to send the API call to the service.
  681. // the "output" return value is not valid until after Send returns without error.
  682. //
  683. // See DescribeBudgets for more information on using the DescribeBudgets
  684. // API call, and error handling.
  685. //
  686. // This method is useful when you want to inject custom logic or configuration
  687. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  688. //
  689. //
  690. // // Example sending a request using the DescribeBudgetsRequest method.
  691. // req, resp := client.DescribeBudgetsRequest(params)
  692. //
  693. // err := req.Send()
  694. // if err == nil { // resp is now filled
  695. // fmt.Println(resp)
  696. // }
  697. func (c *Budgets) DescribeBudgetsRequest(input *DescribeBudgetsInput) (req *request.Request, output *DescribeBudgetsOutput) {
  698. op := &request.Operation{
  699. Name: opDescribeBudgets,
  700. HTTPMethod: "POST",
  701. HTTPPath: "/",
  702. }
  703. if input == nil {
  704. input = &DescribeBudgetsInput{}
  705. }
  706. output = &DescribeBudgetsOutput{}
  707. req = c.newRequest(op, input, output)
  708. return
  709. }
  710. // DescribeBudgets API operation for AWS Budgets.
  711. //
  712. // Lists the budgets that are associated with an account.
  713. //
  714. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  715. // with awserr.Error's Code and Message methods to get detailed information about
  716. // the error.
  717. //
  718. // See the AWS API reference guide for AWS Budgets's
  719. // API operation DescribeBudgets for usage and error information.
  720. //
  721. // Returned Error Codes:
  722. // * ErrCodeInternalErrorException "InternalErrorException"
  723. // An error on the server occurred during the processing of your request. Try
  724. // again later.
  725. //
  726. // * ErrCodeInvalidParameterException "InvalidParameterException"
  727. // An error on the client occurred. Typically, the cause is an invalid input
  728. // value.
  729. //
  730. // * ErrCodeNotFoundException "NotFoundException"
  731. // We can’t locate the resource that you specified.
  732. //
  733. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  734. // The pagination token is invalid.
  735. //
  736. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  737. // The pagination token expired.
  738. //
  739. func (c *Budgets) DescribeBudgets(input *DescribeBudgetsInput) (*DescribeBudgetsOutput, error) {
  740. req, out := c.DescribeBudgetsRequest(input)
  741. return out, req.Send()
  742. }
  743. // DescribeBudgetsWithContext is the same as DescribeBudgets with the addition of
  744. // the ability to pass a context and additional request options.
  745. //
  746. // See DescribeBudgets for details on how to use this API operation.
  747. //
  748. // The context must be non-nil and will be used for request cancellation. If
  749. // the context is nil a panic will occur. In the future the SDK may create
  750. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  751. // for more information on using Contexts.
  752. func (c *Budgets) DescribeBudgetsWithContext(ctx aws.Context, input *DescribeBudgetsInput, opts ...request.Option) (*DescribeBudgetsOutput, error) {
  753. req, out := c.DescribeBudgetsRequest(input)
  754. req.SetContext(ctx)
  755. req.ApplyOptions(opts...)
  756. return out, req.Send()
  757. }
  758. const opDescribeNotificationsForBudget = "DescribeNotificationsForBudget"
  759. // DescribeNotificationsForBudgetRequest generates a "aws/request.Request" representing the
  760. // client's request for the DescribeNotificationsForBudget operation. The "output" return
  761. // value will be populated with the request's response once the request completes
  762. // successfully.
  763. //
  764. // Use "Send" method on the returned Request to send the API call to the service.
  765. // the "output" return value is not valid until after Send returns without error.
  766. //
  767. // See DescribeNotificationsForBudget for more information on using the DescribeNotificationsForBudget
  768. // API call, and error handling.
  769. //
  770. // This method is useful when you want to inject custom logic or configuration
  771. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  772. //
  773. //
  774. // // Example sending a request using the DescribeNotificationsForBudgetRequest method.
  775. // req, resp := client.DescribeNotificationsForBudgetRequest(params)
  776. //
  777. // err := req.Send()
  778. // if err == nil { // resp is now filled
  779. // fmt.Println(resp)
  780. // }
  781. func (c *Budgets) DescribeNotificationsForBudgetRequest(input *DescribeNotificationsForBudgetInput) (req *request.Request, output *DescribeNotificationsForBudgetOutput) {
  782. op := &request.Operation{
  783. Name: opDescribeNotificationsForBudget,
  784. HTTPMethod: "POST",
  785. HTTPPath: "/",
  786. }
  787. if input == nil {
  788. input = &DescribeNotificationsForBudgetInput{}
  789. }
  790. output = &DescribeNotificationsForBudgetOutput{}
  791. req = c.newRequest(op, input, output)
  792. return
  793. }
  794. // DescribeNotificationsForBudget API operation for AWS Budgets.
  795. //
  796. // Lists the notifications that are associated with a budget.
  797. //
  798. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  799. // with awserr.Error's Code and Message methods to get detailed information about
  800. // the error.
  801. //
  802. // See the AWS API reference guide for AWS Budgets's
  803. // API operation DescribeNotificationsForBudget for usage and error information.
  804. //
  805. // Returned Error Codes:
  806. // * ErrCodeInternalErrorException "InternalErrorException"
  807. // An error on the server occurred during the processing of your request. Try
  808. // again later.
  809. //
  810. // * ErrCodeInvalidParameterException "InvalidParameterException"
  811. // An error on the client occurred. Typically, the cause is an invalid input
  812. // value.
  813. //
  814. // * ErrCodeNotFoundException "NotFoundException"
  815. // We can’t locate the resource that you specified.
  816. //
  817. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  818. // The pagination token is invalid.
  819. //
  820. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  821. // The pagination token expired.
  822. //
  823. func (c *Budgets) DescribeNotificationsForBudget(input *DescribeNotificationsForBudgetInput) (*DescribeNotificationsForBudgetOutput, error) {
  824. req, out := c.DescribeNotificationsForBudgetRequest(input)
  825. return out, req.Send()
  826. }
  827. // DescribeNotificationsForBudgetWithContext is the same as DescribeNotificationsForBudget with the addition of
  828. // the ability to pass a context and additional request options.
  829. //
  830. // See DescribeNotificationsForBudget for details on how to use this API operation.
  831. //
  832. // The context must be non-nil and will be used for request cancellation. If
  833. // the context is nil a panic will occur. In the future the SDK may create
  834. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  835. // for more information on using Contexts.
  836. func (c *Budgets) DescribeNotificationsForBudgetWithContext(ctx aws.Context, input *DescribeNotificationsForBudgetInput, opts ...request.Option) (*DescribeNotificationsForBudgetOutput, error) {
  837. req, out := c.DescribeNotificationsForBudgetRequest(input)
  838. req.SetContext(ctx)
  839. req.ApplyOptions(opts...)
  840. return out, req.Send()
  841. }
  842. const opDescribeSubscribersForNotification = "DescribeSubscribersForNotification"
  843. // DescribeSubscribersForNotificationRequest generates a "aws/request.Request" representing the
  844. // client's request for the DescribeSubscribersForNotification operation. The "output" return
  845. // value will be populated with the request's response once the request completes
  846. // successfully.
  847. //
  848. // Use "Send" method on the returned Request to send the API call to the service.
  849. // the "output" return value is not valid until after Send returns without error.
  850. //
  851. // See DescribeSubscribersForNotification for more information on using the DescribeSubscribersForNotification
  852. // API call, and error handling.
  853. //
  854. // This method is useful when you want to inject custom logic or configuration
  855. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  856. //
  857. //
  858. // // Example sending a request using the DescribeSubscribersForNotificationRequest method.
  859. // req, resp := client.DescribeSubscribersForNotificationRequest(params)
  860. //
  861. // err := req.Send()
  862. // if err == nil { // resp is now filled
  863. // fmt.Println(resp)
  864. // }
  865. func (c *Budgets) DescribeSubscribersForNotificationRequest(input *DescribeSubscribersForNotificationInput) (req *request.Request, output *DescribeSubscribersForNotificationOutput) {
  866. op := &request.Operation{
  867. Name: opDescribeSubscribersForNotification,
  868. HTTPMethod: "POST",
  869. HTTPPath: "/",
  870. }
  871. if input == nil {
  872. input = &DescribeSubscribersForNotificationInput{}
  873. }
  874. output = &DescribeSubscribersForNotificationOutput{}
  875. req = c.newRequest(op, input, output)
  876. return
  877. }
  878. // DescribeSubscribersForNotification API operation for AWS Budgets.
  879. //
  880. // Lists the subscribers that are associated with a notification.
  881. //
  882. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  883. // with awserr.Error's Code and Message methods to get detailed information about
  884. // the error.
  885. //
  886. // See the AWS API reference guide for AWS Budgets's
  887. // API operation DescribeSubscribersForNotification for usage and error information.
  888. //
  889. // Returned Error Codes:
  890. // * ErrCodeInternalErrorException "InternalErrorException"
  891. // An error on the server occurred during the processing of your request. Try
  892. // again later.
  893. //
  894. // * ErrCodeNotFoundException "NotFoundException"
  895. // We can’t locate the resource that you specified.
  896. //
  897. // * ErrCodeInvalidParameterException "InvalidParameterException"
  898. // An error on the client occurred. Typically, the cause is an invalid input
  899. // value.
  900. //
  901. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  902. // The pagination token is invalid.
  903. //
  904. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  905. // The pagination token expired.
  906. //
  907. func (c *Budgets) DescribeSubscribersForNotification(input *DescribeSubscribersForNotificationInput) (*DescribeSubscribersForNotificationOutput, error) {
  908. req, out := c.DescribeSubscribersForNotificationRequest(input)
  909. return out, req.Send()
  910. }
  911. // DescribeSubscribersForNotificationWithContext is the same as DescribeSubscribersForNotification with the addition of
  912. // the ability to pass a context and additional request options.
  913. //
  914. // See DescribeSubscribersForNotification for details on how to use this API operation.
  915. //
  916. // The context must be non-nil and will be used for request cancellation. If
  917. // the context is nil a panic will occur. In the future the SDK may create
  918. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  919. // for more information on using Contexts.
  920. func (c *Budgets) DescribeSubscribersForNotificationWithContext(ctx aws.Context, input *DescribeSubscribersForNotificationInput, opts ...request.Option) (*DescribeSubscribersForNotificationOutput, error) {
  921. req, out := c.DescribeSubscribersForNotificationRequest(input)
  922. req.SetContext(ctx)
  923. req.ApplyOptions(opts...)
  924. return out, req.Send()
  925. }
  926. const opUpdateBudget = "UpdateBudget"
  927. // UpdateBudgetRequest generates a "aws/request.Request" representing the
  928. // client's request for the UpdateBudget operation. The "output" return
  929. // value will be populated with the request's response once the request completes
  930. // successfully.
  931. //
  932. // Use "Send" method on the returned Request to send the API call to the service.
  933. // the "output" return value is not valid until after Send returns without error.
  934. //
  935. // See UpdateBudget for more information on using the UpdateBudget
  936. // API call, and error handling.
  937. //
  938. // This method is useful when you want to inject custom logic or configuration
  939. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  940. //
  941. //
  942. // // Example sending a request using the UpdateBudgetRequest method.
  943. // req, resp := client.UpdateBudgetRequest(params)
  944. //
  945. // err := req.Send()
  946. // if err == nil { // resp is now filled
  947. // fmt.Println(resp)
  948. // }
  949. func (c *Budgets) UpdateBudgetRequest(input *UpdateBudgetInput) (req *request.Request, output *UpdateBudgetOutput) {
  950. op := &request.Operation{
  951. Name: opUpdateBudget,
  952. HTTPMethod: "POST",
  953. HTTPPath: "/",
  954. }
  955. if input == nil {
  956. input = &UpdateBudgetInput{}
  957. }
  958. output = &UpdateBudgetOutput{}
  959. req = c.newRequest(op, input, output)
  960. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  961. return
  962. }
  963. // UpdateBudget API operation for AWS Budgets.
  964. //
  965. // Updates a budget. You can change every part of a budget except for the budgetName
  966. // and the calculatedSpend. When you modify a budget, the calculatedSpend drops
  967. // to zero until AWS has new usage data to use for forecasting.
  968. //
  969. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  970. // with awserr.Error's Code and Message methods to get detailed information about
  971. // the error.
  972. //
  973. // See the AWS API reference guide for AWS Budgets's
  974. // API operation UpdateBudget for usage and error information.
  975. //
  976. // Returned Error Codes:
  977. // * ErrCodeInternalErrorException "InternalErrorException"
  978. // An error on the server occurred during the processing of your request. Try
  979. // again later.
  980. //
  981. // * ErrCodeInvalidParameterException "InvalidParameterException"
  982. // An error on the client occurred. Typically, the cause is an invalid input
  983. // value.
  984. //
  985. // * ErrCodeNotFoundException "NotFoundException"
  986. // We can’t locate the resource that you specified.
  987. //
  988. func (c *Budgets) UpdateBudget(input *UpdateBudgetInput) (*UpdateBudgetOutput, error) {
  989. req, out := c.UpdateBudgetRequest(input)
  990. return out, req.Send()
  991. }
  992. // UpdateBudgetWithContext is the same as UpdateBudget with the addition of
  993. // the ability to pass a context and additional request options.
  994. //
  995. // See UpdateBudget for details on how to use this API operation.
  996. //
  997. // The context must be non-nil and will be used for request cancellation. If
  998. // the context is nil a panic will occur. In the future the SDK may create
  999. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1000. // for more information on using Contexts.
  1001. func (c *Budgets) UpdateBudgetWithContext(ctx aws.Context, input *UpdateBudgetInput, opts ...request.Option) (*UpdateBudgetOutput, error) {
  1002. req, out := c.UpdateBudgetRequest(input)
  1003. req.SetContext(ctx)
  1004. req.ApplyOptions(opts...)
  1005. return out, req.Send()
  1006. }
  1007. const opUpdateNotification = "UpdateNotification"
  1008. // UpdateNotificationRequest generates a "aws/request.Request" representing the
  1009. // client's request for the UpdateNotification operation. The "output" return
  1010. // value will be populated with the request's response once the request completes
  1011. // successfully.
  1012. //
  1013. // Use "Send" method on the returned Request to send the API call to the service.
  1014. // the "output" return value is not valid until after Send returns without error.
  1015. //
  1016. // See UpdateNotification for more information on using the UpdateNotification
  1017. // API call, and error handling.
  1018. //
  1019. // This method is useful when you want to inject custom logic or configuration
  1020. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1021. //
  1022. //
  1023. // // Example sending a request using the UpdateNotificationRequest method.
  1024. // req, resp := client.UpdateNotificationRequest(params)
  1025. //
  1026. // err := req.Send()
  1027. // if err == nil { // resp is now filled
  1028. // fmt.Println(resp)
  1029. // }
  1030. func (c *Budgets) UpdateNotificationRequest(input *UpdateNotificationInput) (req *request.Request, output *UpdateNotificationOutput) {
  1031. op := &request.Operation{
  1032. Name: opUpdateNotification,
  1033. HTTPMethod: "POST",
  1034. HTTPPath: "/",
  1035. }
  1036. if input == nil {
  1037. input = &UpdateNotificationInput{}
  1038. }
  1039. output = &UpdateNotificationOutput{}
  1040. req = c.newRequest(op, input, output)
  1041. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1042. return
  1043. }
  1044. // UpdateNotification API operation for AWS Budgets.
  1045. //
  1046. // Updates a notification.
  1047. //
  1048. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1049. // with awserr.Error's Code and Message methods to get detailed information about
  1050. // the error.
  1051. //
  1052. // See the AWS API reference guide for AWS Budgets's
  1053. // API operation UpdateNotification for usage and error information.
  1054. //
  1055. // Returned Error Codes:
  1056. // * ErrCodeInternalErrorException "InternalErrorException"
  1057. // An error on the server occurred during the processing of your request. Try
  1058. // again later.
  1059. //
  1060. // * ErrCodeInvalidParameterException "InvalidParameterException"
  1061. // An error on the client occurred. Typically, the cause is an invalid input
  1062. // value.
  1063. //
  1064. // * ErrCodeNotFoundException "NotFoundException"
  1065. // We can’t locate the resource that you specified.
  1066. //
  1067. // * ErrCodeDuplicateRecordException "DuplicateRecordException"
  1068. // The budget name already exists. Budget names must be unique within an account.
  1069. //
  1070. func (c *Budgets) UpdateNotification(input *UpdateNotificationInput) (*UpdateNotificationOutput, error) {
  1071. req, out := c.UpdateNotificationRequest(input)
  1072. return out, req.Send()
  1073. }
  1074. // UpdateNotificationWithContext is the same as UpdateNotification with the addition of
  1075. // the ability to pass a context and additional request options.
  1076. //
  1077. // See UpdateNotification for details on how to use this API operation.
  1078. //
  1079. // The context must be non-nil and will be used for request cancellation. If
  1080. // the context is nil a panic will occur. In the future the SDK may create
  1081. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1082. // for more information on using Contexts.
  1083. func (c *Budgets) UpdateNotificationWithContext(ctx aws.Context, input *UpdateNotificationInput, opts ...request.Option) (*UpdateNotificationOutput, error) {
  1084. req, out := c.UpdateNotificationRequest(input)
  1085. req.SetContext(ctx)
  1086. req.ApplyOptions(opts...)
  1087. return out, req.Send()
  1088. }
  1089. const opUpdateSubscriber = "UpdateSubscriber"
  1090. // UpdateSubscriberRequest generates a "aws/request.Request" representing the
  1091. // client's request for the UpdateSubscriber operation. The "output" return
  1092. // value will be populated with the request's response once the request completes
  1093. // successfully.
  1094. //
  1095. // Use "Send" method on the returned Request to send the API call to the service.
  1096. // the "output" return value is not valid until after Send returns without error.
  1097. //
  1098. // See UpdateSubscriber for more information on using the UpdateSubscriber
  1099. // API call, and error handling.
  1100. //
  1101. // This method is useful when you want to inject custom logic or configuration
  1102. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1103. //
  1104. //
  1105. // // Example sending a request using the UpdateSubscriberRequest method.
  1106. // req, resp := client.UpdateSubscriberRequest(params)
  1107. //
  1108. // err := req.Send()
  1109. // if err == nil { // resp is now filled
  1110. // fmt.Println(resp)
  1111. // }
  1112. func (c *Budgets) UpdateSubscriberRequest(input *UpdateSubscriberInput) (req *request.Request, output *UpdateSubscriberOutput) {
  1113. op := &request.Operation{
  1114. Name: opUpdateSubscriber,
  1115. HTTPMethod: "POST",
  1116. HTTPPath: "/",
  1117. }
  1118. if input == nil {
  1119. input = &UpdateSubscriberInput{}
  1120. }
  1121. output = &UpdateSubscriberOutput{}
  1122. req = c.newRequest(op, input, output)
  1123. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1124. return
  1125. }
  1126. // UpdateSubscriber API operation for AWS Budgets.
  1127. //
  1128. // Updates a subscriber.
  1129. //
  1130. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1131. // with awserr.Error's Code and Message methods to get detailed information about
  1132. // the error.
  1133. //
  1134. // See the AWS API reference guide for AWS Budgets's
  1135. // API operation UpdateSubscriber for usage and error information.
  1136. //
  1137. // Returned Error Codes:
  1138. // * ErrCodeInternalErrorException "InternalErrorException"
  1139. // An error on the server occurred during the processing of your request. Try
  1140. // again later.
  1141. //
  1142. // * ErrCodeInvalidParameterException "InvalidParameterException"
  1143. // An error on the client occurred. Typically, the cause is an invalid input
  1144. // value.
  1145. //
  1146. // * ErrCodeNotFoundException "NotFoundException"
  1147. // We can’t locate the resource that you specified.
  1148. //
  1149. // * ErrCodeDuplicateRecordException "DuplicateRecordException"
  1150. // The budget name already exists. Budget names must be unique within an account.
  1151. //
  1152. func (c *Budgets) UpdateSubscriber(input *UpdateSubscriberInput) (*UpdateSubscriberOutput, error) {
  1153. req, out := c.UpdateSubscriberRequest(input)
  1154. return out, req.Send()
  1155. }
  1156. // UpdateSubscriberWithContext is the same as UpdateSubscriber with the addition of
  1157. // the ability to pass a context and additional request options.
  1158. //
  1159. // See UpdateSubscriber for details on how to use this API operation.
  1160. //
  1161. // The context must be non-nil and will be used for request cancellation. If
  1162. // the context is nil a panic will occur. In the future the SDK may create
  1163. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1164. // for more information on using Contexts.
  1165. func (c *Budgets) UpdateSubscriberWithContext(ctx aws.Context, input *UpdateSubscriberInput, opts ...request.Option) (*UpdateSubscriberOutput, error) {
  1166. req, out := c.UpdateSubscriberRequest(input)
  1167. req.SetContext(ctx)
  1168. req.ApplyOptions(opts...)
  1169. return out, req.Send()
  1170. }
  1171. // Represents the output of the CreateBudget operation. The content consists
  1172. // of the detailed metadata and data file information, and the current status
  1173. // of the budget object.
  1174. //
  1175. // This is the ARN pattern for a budget:
  1176. //
  1177. // arn:aws:budgetservice::AccountId:budget/budgetName
  1178. type Budget struct {
  1179. _ struct{} `type:"structure"`
  1180. // The total amount of cost, usage, RI utilization, or RI coverage that you
  1181. // want to track with your budget.
  1182. //
  1183. // BudgetLimit is required for cost or usage budgets, but optional for RI utilization
  1184. // or coverage budgets. RI utilization or coverage budgets default to 100, which
  1185. // is the only valid value for RI utilization or coverage budgets.
  1186. BudgetLimit *Spend `type:"structure"`
  1187. // The name of a budget. The name must be unique within accounts. The : and
  1188. // \ characters aren't allowed in BudgetName.
  1189. //
  1190. // BudgetName is a required field
  1191. BudgetName *string `min:"1" type:"string" required:"true"`
  1192. // Whether this budget tracks monetary costs, usage, RI utilization, or RI coverage.
  1193. //
  1194. // BudgetType is a required field
  1195. BudgetType *string `type:"string" required:"true" enum:"BudgetType"`
  1196. // The actual and forecasted cost or usage that the budget tracks.
  1197. CalculatedSpend *CalculatedSpend `type:"structure"`
  1198. // The cost filters, such as service or region, that are applied to a budget.
  1199. //
  1200. // AWS Budgets supports the following services as a filter for RI budgets:
  1201. //
  1202. // * Amazon Elastic Compute Cloud - Compute
  1203. //
  1204. // * Amazon Redshift
  1205. //
  1206. // * Amazon Relational Database Service
  1207. //
  1208. // * Amazon ElastiCache
  1209. //
  1210. // * Amazon Elasticsearch Service
  1211. CostFilters map[string][]*string `type:"map"`
  1212. // The types of costs that are included in this COST budget.
  1213. //
  1214. // USAGE, RI_UTILIZATION, and RI_COVERAGE budgets do not have CostTypes.
  1215. CostTypes *CostTypes `type:"structure"`
  1216. // The last time that you updated this budget.
  1217. LastUpdatedTime *time.Time `type:"timestamp"`
  1218. // The period of time that is covered by a budget. The period has a start date
  1219. // and an end date. The start date must come before the end date. The end date
  1220. // must come before 06/15/87 00:00 UTC.
  1221. //
  1222. // If you create your budget and don't specify a start date, AWS defaults to
  1223. // the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY).
  1224. // For example, if you created your budget on January 24, 2018, chose DAILY,
  1225. // and didn't set a start date, AWS set your start date to 01/24/18 00:00 UTC.
  1226. // If you chose MONTHLY, AWS set your start date to 01/01/18 00:00 UTC. If you
  1227. // didn't specify an end date, AWS set your end date to 06/15/87 00:00 UTC.
  1228. // The defaults are the same for the AWS Billing and Cost Management console
  1229. // and the API.
  1230. //
  1231. // You can change either date with the UpdateBudget operation.
  1232. //
  1233. // After the end date, AWS deletes the budget and all associated notifications
  1234. // and subscribers.
  1235. TimePeriod *TimePeriod `type:"structure"`
  1236. // The length of time until a budget resets the actual and forecasted spend.
  1237. // DAILY is available only for RI_UTILIZATION and RI_COVERAGE budgets.
  1238. //
  1239. // TimeUnit is a required field
  1240. TimeUnit *string `type:"string" required:"true" enum:"TimeUnit"`
  1241. }
  1242. // String returns the string representation
  1243. func (s Budget) String() string {
  1244. return awsutil.Prettify(s)
  1245. }
  1246. // GoString returns the string representation
  1247. func (s Budget) GoString() string {
  1248. return s.String()
  1249. }
  1250. // Validate inspects the fields of the type to determine if they are valid.
  1251. func (s *Budget) Validate() error {
  1252. invalidParams := request.ErrInvalidParams{Context: "Budget"}
  1253. if s.BudgetName == nil {
  1254. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  1255. }
  1256. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  1257. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  1258. }
  1259. if s.BudgetType == nil {
  1260. invalidParams.Add(request.NewErrParamRequired("BudgetType"))
  1261. }
  1262. if s.TimeUnit == nil {
  1263. invalidParams.Add(request.NewErrParamRequired("TimeUnit"))
  1264. }
  1265. if s.BudgetLimit != nil {
  1266. if err := s.BudgetLimit.Validate(); err != nil {
  1267. invalidParams.AddNested("BudgetLimit", err.(request.ErrInvalidParams))
  1268. }
  1269. }
  1270. if s.CalculatedSpend != nil {
  1271. if err := s.CalculatedSpend.Validate(); err != nil {
  1272. invalidParams.AddNested("CalculatedSpend", err.(request.ErrInvalidParams))
  1273. }
  1274. }
  1275. if invalidParams.Len() > 0 {
  1276. return invalidParams
  1277. }
  1278. return nil
  1279. }
  1280. // SetBudgetLimit sets the BudgetLimit field's value.
  1281. func (s *Budget) SetBudgetLimit(v *Spend) *Budget {
  1282. s.BudgetLimit = v
  1283. return s
  1284. }
  1285. // SetBudgetName sets the BudgetName field's value.
  1286. func (s *Budget) SetBudgetName(v string) *Budget {
  1287. s.BudgetName = &v
  1288. return s
  1289. }
  1290. // SetBudgetType sets the BudgetType field's value.
  1291. func (s *Budget) SetBudgetType(v string) *Budget {
  1292. s.BudgetType = &v
  1293. return s
  1294. }
  1295. // SetCalculatedSpend sets the CalculatedSpend field's value.
  1296. func (s *Budget) SetCalculatedSpend(v *CalculatedSpend) *Budget {
  1297. s.CalculatedSpend = v
  1298. return s
  1299. }
  1300. // SetCostFilters sets the CostFilters field's value.
  1301. func (s *Budget) SetCostFilters(v map[string][]*string) *Budget {
  1302. s.CostFilters = v
  1303. return s
  1304. }
  1305. // SetCostTypes sets the CostTypes field's value.
  1306. func (s *Budget) SetCostTypes(v *CostTypes) *Budget {
  1307. s.CostTypes = v
  1308. return s
  1309. }
  1310. // SetLastUpdatedTime sets the LastUpdatedTime field's value.
  1311. func (s *Budget) SetLastUpdatedTime(v time.Time) *Budget {
  1312. s.LastUpdatedTime = &v
  1313. return s
  1314. }
  1315. // SetTimePeriod sets the TimePeriod field's value.
  1316. func (s *Budget) SetTimePeriod(v *TimePeriod) *Budget {
  1317. s.TimePeriod = v
  1318. return s
  1319. }
  1320. // SetTimeUnit sets the TimeUnit field's value.
  1321. func (s *Budget) SetTimeUnit(v string) *Budget {
  1322. s.TimeUnit = &v
  1323. return s
  1324. }
  1325. // A history of the state of a budget at the end of the budget's specified time
  1326. // period.
  1327. type BudgetPerformanceHistory struct {
  1328. _ struct{} `type:"structure"`
  1329. // A string that represents the budget name. The ":" and "\" characters aren't
  1330. // allowed.
  1331. BudgetName *string `min:"1" type:"string"`
  1332. // The type of a budget. It must be one of the following types:
  1333. //
  1334. // COST, USAGE, RI_UTILIZATION, or RI_COVERAGE.
  1335. BudgetType *string `type:"string" enum:"BudgetType"`
  1336. // A list of amounts of cost or usage that you created budgets for, compared
  1337. // to your actual costs or usage.
  1338. BudgetedAndActualAmountsList []*BudgetedAndActualAmounts `type:"list"`
  1339. // The history of the cost filters for a budget during the specified time period.
  1340. CostFilters map[string][]*string `type:"map"`
  1341. // The history of the cost types for a budget during the specified time period.
  1342. CostTypes *CostTypes `type:"structure"`
  1343. // The time unit of the budget, such as MONTHLY or QUARTERLY.
  1344. TimeUnit *string `type:"string" enum:"TimeUnit"`
  1345. }
  1346. // String returns the string representation
  1347. func (s BudgetPerformanceHistory) String() string {
  1348. return awsutil.Prettify(s)
  1349. }
  1350. // GoString returns the string representation
  1351. func (s BudgetPerformanceHistory) GoString() string {
  1352. return s.String()
  1353. }
  1354. // SetBudgetName sets the BudgetName field's value.
  1355. func (s *BudgetPerformanceHistory) SetBudgetName(v string) *BudgetPerformanceHistory {
  1356. s.BudgetName = &v
  1357. return s
  1358. }
  1359. // SetBudgetType sets the BudgetType field's value.
  1360. func (s *BudgetPerformanceHistory) SetBudgetType(v string) *BudgetPerformanceHistory {
  1361. s.BudgetType = &v
  1362. return s
  1363. }
  1364. // SetBudgetedAndActualAmountsList sets the BudgetedAndActualAmountsList field's value.
  1365. func (s *BudgetPerformanceHistory) SetBudgetedAndActualAmountsList(v []*BudgetedAndActualAmounts) *BudgetPerformanceHistory {
  1366. s.BudgetedAndActualAmountsList = v
  1367. return s
  1368. }
  1369. // SetCostFilters sets the CostFilters field's value.
  1370. func (s *BudgetPerformanceHistory) SetCostFilters(v map[string][]*string) *BudgetPerformanceHistory {
  1371. s.CostFilters = v
  1372. return s
  1373. }
  1374. // SetCostTypes sets the CostTypes field's value.
  1375. func (s *BudgetPerformanceHistory) SetCostTypes(v *CostTypes) *BudgetPerformanceHistory {
  1376. s.CostTypes = v
  1377. return s
  1378. }
  1379. // SetTimeUnit sets the TimeUnit field's value.
  1380. func (s *BudgetPerformanceHistory) SetTimeUnit(v string) *BudgetPerformanceHistory {
  1381. s.TimeUnit = &v
  1382. return s
  1383. }
  1384. // The amount of cost or usage that you created the budget for, compared to
  1385. // your actual costs or usage.
  1386. type BudgetedAndActualAmounts struct {
  1387. _ struct{} `type:"structure"`
  1388. // Your actual costs or usage for a budget period.
  1389. ActualAmount *Spend `type:"structure"`
  1390. // The amount of cost or usage that you created the budget for.
  1391. BudgetedAmount *Spend `type:"structure"`
  1392. // The time period covered by this budget comparison.
  1393. TimePeriod *TimePeriod `type:"structure"`
  1394. }
  1395. // String returns the string representation
  1396. func (s BudgetedAndActualAmounts) String() string {
  1397. return awsutil.Prettify(s)
  1398. }
  1399. // GoString returns the string representation
  1400. func (s BudgetedAndActualAmounts) GoString() string {
  1401. return s.String()
  1402. }
  1403. // SetActualAmount sets the ActualAmount field's value.
  1404. func (s *BudgetedAndActualAmounts) SetActualAmount(v *Spend) *BudgetedAndActualAmounts {
  1405. s.ActualAmount = v
  1406. return s
  1407. }
  1408. // SetBudgetedAmount sets the BudgetedAmount field's value.
  1409. func (s *BudgetedAndActualAmounts) SetBudgetedAmount(v *Spend) *BudgetedAndActualAmounts {
  1410. s.BudgetedAmount = v
  1411. return s
  1412. }
  1413. // SetTimePeriod sets the TimePeriod field's value.
  1414. func (s *BudgetedAndActualAmounts) SetTimePeriod(v *TimePeriod) *BudgetedAndActualAmounts {
  1415. s.TimePeriod = v
  1416. return s
  1417. }
  1418. // The spend objects that are associated with this budget. The actualSpend tracks
  1419. // how much you've used, cost, usage, or RI units, and the forecastedSpend tracks
  1420. // how much you are predicted to spend if your current usage remains steady.
  1421. //
  1422. // For example, if it is the 20th of the month and you have spent 50 dollars
  1423. // on Amazon EC2, your actualSpend is 50 USD, and your forecastedSpend is 75
  1424. // USD.
  1425. type CalculatedSpend struct {
  1426. _ struct{} `type:"structure"`
  1427. // The amount of cost, usage, or RI units that you have used.
  1428. //
  1429. // ActualSpend is a required field
  1430. ActualSpend *Spend `type:"structure" required:"true"`
  1431. // The amount of cost, usage, or RI units that you are forecasted to use.
  1432. ForecastedSpend *Spend `type:"structure"`
  1433. }
  1434. // String returns the string representation
  1435. func (s CalculatedSpend) String() string {
  1436. return awsutil.Prettify(s)
  1437. }
  1438. // GoString returns the string representation
  1439. func (s CalculatedSpend) GoString() string {
  1440. return s.String()
  1441. }
  1442. // Validate inspects the fields of the type to determine if they are valid.
  1443. func (s *CalculatedSpend) Validate() error {
  1444. invalidParams := request.ErrInvalidParams{Context: "CalculatedSpend"}
  1445. if s.ActualSpend == nil {
  1446. invalidParams.Add(request.NewErrParamRequired("ActualSpend"))
  1447. }
  1448. if s.ActualSpend != nil {
  1449. if err := s.ActualSpend.Validate(); err != nil {
  1450. invalidParams.AddNested("ActualSpend", err.(request.ErrInvalidParams))
  1451. }
  1452. }
  1453. if s.ForecastedSpend != nil {
  1454. if err := s.ForecastedSpend.Validate(); err != nil {
  1455. invalidParams.AddNested("ForecastedSpend", err.(request.ErrInvalidParams))
  1456. }
  1457. }
  1458. if invalidParams.Len() > 0 {
  1459. return invalidParams
  1460. }
  1461. return nil
  1462. }
  1463. // SetActualSpend sets the ActualSpend field's value.
  1464. func (s *CalculatedSpend) SetActualSpend(v *Spend) *CalculatedSpend {
  1465. s.ActualSpend = v
  1466. return s
  1467. }
  1468. // SetForecastedSpend sets the ForecastedSpend field's value.
  1469. func (s *CalculatedSpend) SetForecastedSpend(v *Spend) *CalculatedSpend {
  1470. s.ForecastedSpend = v
  1471. return s
  1472. }
  1473. // The types of cost that are included in a COST budget, such as tax and subscriptions.
  1474. //
  1475. // USAGE, RI_UTILIZATION, and RI_COVERAGE budgets do not have CostTypes.
  1476. type CostTypes struct {
  1477. _ struct{} `type:"structure"`
  1478. // Specifies whether a budget includes credits.
  1479. //
  1480. // The default value is true.
  1481. IncludeCredit *bool `type:"boolean"`
  1482. // Specifies whether a budget includes discounts.
  1483. //
  1484. // The default value is true.
  1485. IncludeDiscount *bool `type:"boolean"`
  1486. // Specifies whether a budget includes non-RI subscription costs.
  1487. //
  1488. // The default value is true.
  1489. IncludeOtherSubscription *bool `type:"boolean"`
  1490. // Specifies whether a budget includes recurring fees such as monthly RI fees.
  1491. //
  1492. // The default value is true.
  1493. IncludeRecurring *bool `type:"boolean"`
  1494. // Specifies whether a budget includes refunds.
  1495. //
  1496. // The default value is true.
  1497. IncludeRefund *bool `type:"boolean"`
  1498. // Specifies whether a budget includes subscriptions.
  1499. //
  1500. // The default value is true.
  1501. IncludeSubscription *bool `type:"boolean"`
  1502. // Specifies whether a budget includes support subscription fees.
  1503. //
  1504. // The default value is true.
  1505. IncludeSupport *bool `type:"boolean"`
  1506. // Specifies whether a budget includes taxes.
  1507. //
  1508. // The default value is true.
  1509. IncludeTax *bool `type:"boolean"`
  1510. // Specifies whether a budget includes upfront RI costs.
  1511. //
  1512. // The default value is true.
  1513. IncludeUpfront *bool `type:"boolean"`
  1514. // Specifies whether a budget uses the amortized rate.
  1515. //
  1516. // The default value is false.
  1517. UseAmortized *bool `type:"boolean"`
  1518. // Specifies whether a budget uses a blended rate.
  1519. //
  1520. // The default value is false.
  1521. UseBlended *bool `type:"boolean"`
  1522. }
  1523. // String returns the string representation
  1524. func (s CostTypes) String() string {
  1525. return awsutil.Prettify(s)
  1526. }
  1527. // GoString returns the string representation
  1528. func (s CostTypes) GoString() string {
  1529. return s.String()
  1530. }
  1531. // SetIncludeCredit sets the IncludeCredit field's value.
  1532. func (s *CostTypes) SetIncludeCredit(v bool) *CostTypes {
  1533. s.IncludeCredit = &v
  1534. return s
  1535. }
  1536. // SetIncludeDiscount sets the IncludeDiscount field's value.
  1537. func (s *CostTypes) SetIncludeDiscount(v bool) *CostTypes {
  1538. s.IncludeDiscount = &v
  1539. return s
  1540. }
  1541. // SetIncludeOtherSubscription sets the IncludeOtherSubscription field's value.
  1542. func (s *CostTypes) SetIncludeOtherSubscription(v bool) *CostTypes {
  1543. s.IncludeOtherSubscription = &v
  1544. return s
  1545. }
  1546. // SetIncludeRecurring sets the IncludeRecurring field's value.
  1547. func (s *CostTypes) SetIncludeRecurring(v bool) *CostTypes {
  1548. s.IncludeRecurring = &v
  1549. return s
  1550. }
  1551. // SetIncludeRefund sets the IncludeRefund field's value.
  1552. func (s *CostTypes) SetIncludeRefund(v bool) *CostTypes {
  1553. s.IncludeRefund = &v
  1554. return s
  1555. }
  1556. // SetIncludeSubscription sets the IncludeSubscription field's value.
  1557. func (s *CostTypes) SetIncludeSubscription(v bool) *CostTypes {
  1558. s.IncludeSubscription = &v
  1559. return s
  1560. }
  1561. // SetIncludeSupport sets the IncludeSupport field's value.
  1562. func (s *CostTypes) SetIncludeSupport(v bool) *CostTypes {
  1563. s.IncludeSupport = &v
  1564. return s
  1565. }
  1566. // SetIncludeTax sets the IncludeTax field's value.
  1567. func (s *CostTypes) SetIncludeTax(v bool) *CostTypes {
  1568. s.IncludeTax = &v
  1569. return s
  1570. }
  1571. // SetIncludeUpfront sets the IncludeUpfront field's value.
  1572. func (s *CostTypes) SetIncludeUpfront(v bool) *CostTypes {
  1573. s.IncludeUpfront = &v
  1574. return s
  1575. }
  1576. // SetUseAmortized sets the UseAmortized field's value.
  1577. func (s *CostTypes) SetUseAmortized(v bool) *CostTypes {
  1578. s.UseAmortized = &v
  1579. return s
  1580. }
  1581. // SetUseBlended sets the UseBlended field's value.
  1582. func (s *CostTypes) SetUseBlended(v bool) *CostTypes {
  1583. s.UseBlended = &v
  1584. return s
  1585. }
  1586. // Request of CreateBudget
  1587. type CreateBudgetInput struct {
  1588. _ struct{} `type:"structure"`
  1589. // The accountId that is associated with the budget.
  1590. //
  1591. // AccountId is a required field
  1592. AccountId *string `min:"12" type:"string" required:"true"`
  1593. // The budget object that you want to create.
  1594. //
  1595. // Budget is a required field
  1596. Budget *Budget `type:"structure" required:"true"`
  1597. // A notification that you want to associate with a budget. A budget can have
  1598. // up to five notifications, and each notification can have one SNS subscriber
  1599. // and up to 10 email subscribers. If you include notifications and subscribers
  1600. // in your CreateBudget call, AWS creates the notifications and subscribers
  1601. // for you.
  1602. NotificationsWithSubscribers []*NotificationWithSubscribers `type:"list"`
  1603. }
  1604. // String returns the string representation
  1605. func (s CreateBudgetInput) String() string {
  1606. return awsutil.Prettify(s)
  1607. }
  1608. // GoString returns the string representation
  1609. func (s CreateBudgetInput) GoString() string {
  1610. return s.String()
  1611. }
  1612. // Validate inspects the fields of the type to determine if they are valid.
  1613. func (s *CreateBudgetInput) Validate() error {
  1614. invalidParams := request.ErrInvalidParams{Context: "CreateBudgetInput"}
  1615. if s.AccountId == nil {
  1616. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  1617. }
  1618. if s.AccountId != nil && len(*s.AccountId) < 12 {
  1619. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  1620. }
  1621. if s.Budget == nil {
  1622. invalidParams.Add(request.NewErrParamRequired("Budget"))
  1623. }
  1624. if s.Budget != nil {
  1625. if err := s.Budget.Validate(); err != nil {
  1626. invalidParams.AddNested("Budget", err.(request.ErrInvalidParams))
  1627. }
  1628. }
  1629. if s.NotificationsWithSubscribers != nil {
  1630. for i, v := range s.NotificationsWithSubscribers {
  1631. if v == nil {
  1632. continue
  1633. }
  1634. if err := v.Validate(); err != nil {
  1635. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NotificationsWithSubscribers", i), err.(request.ErrInvalidParams))
  1636. }
  1637. }
  1638. }
  1639. if invalidParams.Len() > 0 {
  1640. return invalidParams
  1641. }
  1642. return nil
  1643. }
  1644. // SetAccountId sets the AccountId field's value.
  1645. func (s *CreateBudgetInput) SetAccountId(v string) *CreateBudgetInput {
  1646. s.AccountId = &v
  1647. return s
  1648. }
  1649. // SetBudget sets the Budget field's value.
  1650. func (s *CreateBudgetInput) SetBudget(v *Budget) *CreateBudgetInput {
  1651. s.Budget = v
  1652. return s
  1653. }
  1654. // SetNotificationsWithSubscribers sets the NotificationsWithSubscribers field's value.
  1655. func (s *CreateBudgetInput) SetNotificationsWithSubscribers(v []*NotificationWithSubscribers) *CreateBudgetInput {
  1656. s.NotificationsWithSubscribers = v
  1657. return s
  1658. }
  1659. // Response of CreateBudget
  1660. type CreateBudgetOutput struct {
  1661. _ struct{} `type:"structure"`
  1662. }
  1663. // String returns the string representation
  1664. func (s CreateBudgetOutput) String() string {
  1665. return awsutil.Prettify(s)
  1666. }
  1667. // GoString returns the string representation
  1668. func (s CreateBudgetOutput) GoString() string {
  1669. return s.String()
  1670. }
  1671. // Request of CreateNotification
  1672. type CreateNotificationInput struct {
  1673. _ struct{} `type:"structure"`
  1674. // The accountId that is associated with the budget that you want to create
  1675. // a notification for.
  1676. //
  1677. // AccountId is a required field
  1678. AccountId *string `min:"12" type:"string" required:"true"`
  1679. // The name of the budget that you want AWS to notify you about. Budget names
  1680. // must be unique within an account.
  1681. //
  1682. // BudgetName is a required field
  1683. BudgetName *string `min:"1" type:"string" required:"true"`
  1684. // The notification that you want to create.
  1685. //
  1686. // Notification is a required field
  1687. Notification *Notification `type:"structure" required:"true"`
  1688. // A list of subscribers that you want to associate with the notification. Each
  1689. // notification can have one SNS subscriber and up to 10 email subscribers.
  1690. //
  1691. // Subscribers is a required field
  1692. Subscribers []*Subscriber `min:"1" type:"list" required:"true"`
  1693. }
  1694. // String returns the string representation
  1695. func (s CreateNotificationInput) String() string {
  1696. return awsutil.Prettify(s)
  1697. }
  1698. // GoString returns the string representation
  1699. func (s CreateNotificationInput) GoString() string {
  1700. return s.String()
  1701. }
  1702. // Validate inspects the fields of the type to determine if they are valid.
  1703. func (s *CreateNotificationInput) Validate() error {
  1704. invalidParams := request.ErrInvalidParams{Context: "CreateNotificationInput"}
  1705. if s.AccountId == nil {
  1706. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  1707. }
  1708. if s.AccountId != nil && len(*s.AccountId) < 12 {
  1709. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  1710. }
  1711. if s.BudgetName == nil {
  1712. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  1713. }
  1714. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  1715. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  1716. }
  1717. if s.Notification == nil {
  1718. invalidParams.Add(request.NewErrParamRequired("Notification"))
  1719. }
  1720. if s.Subscribers == nil {
  1721. invalidParams.Add(request.NewErrParamRequired("Subscribers"))
  1722. }
  1723. if s.Subscribers != nil && len(s.Subscribers) < 1 {
  1724. invalidParams.Add(request.NewErrParamMinLen("Subscribers", 1))
  1725. }
  1726. if s.Notification != nil {
  1727. if err := s.Notification.Validate(); err != nil {
  1728. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  1729. }
  1730. }
  1731. if s.Subscribers != nil {
  1732. for i, v := range s.Subscribers {
  1733. if v == nil {
  1734. continue
  1735. }
  1736. if err := v.Validate(); err != nil {
  1737. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Subscribers", i), err.(request.ErrInvalidParams))
  1738. }
  1739. }
  1740. }
  1741. if invalidParams.Len() > 0 {
  1742. return invalidParams
  1743. }
  1744. return nil
  1745. }
  1746. // SetAccountId sets the AccountId field's value.
  1747. func (s *CreateNotificationInput) SetAccountId(v string) *CreateNotificationInput {
  1748. s.AccountId = &v
  1749. return s
  1750. }
  1751. // SetBudgetName sets the BudgetName field's value.
  1752. func (s *CreateNotificationInput) SetBudgetName(v string) *CreateNotificationInput {
  1753. s.BudgetName = &v
  1754. return s
  1755. }
  1756. // SetNotification sets the Notification field's value.
  1757. func (s *CreateNotificationInput) SetNotification(v *Notification) *CreateNotificationInput {
  1758. s.Notification = v
  1759. return s
  1760. }
  1761. // SetSubscribers sets the Subscribers field's value.
  1762. func (s *CreateNotificationInput) SetSubscribers(v []*Subscriber) *CreateNotificationInput {
  1763. s.Subscribers = v
  1764. return s
  1765. }
  1766. // Response of CreateNotification
  1767. type CreateNotificationOutput struct {
  1768. _ struct{} `type:"structure"`
  1769. }
  1770. // String returns the string representation
  1771. func (s CreateNotificationOutput) String() string {
  1772. return awsutil.Prettify(s)
  1773. }
  1774. // GoString returns the string representation
  1775. func (s CreateNotificationOutput) GoString() string {
  1776. return s.String()
  1777. }
  1778. // Request of CreateSubscriber
  1779. type CreateSubscriberInput struct {
  1780. _ struct{} `type:"structure"`
  1781. // The accountId that is associated with the budget that you want to create
  1782. // a subscriber for.
  1783. //
  1784. // AccountId is a required field
  1785. AccountId *string `min:"12" type:"string" required:"true"`
  1786. // The name of the budget that you want to subscribe to. Budget names must be
  1787. // unique within an account.
  1788. //
  1789. // BudgetName is a required field
  1790. BudgetName *string `min:"1" type:"string" required:"true"`
  1791. // The notification that you want to create a subscriber for.
  1792. //
  1793. // Notification is a required field
  1794. Notification *Notification `type:"structure" required:"true"`
  1795. // The subscriber that you want to associate with a budget notification.
  1796. //
  1797. // Subscriber is a required field
  1798. Subscriber *Subscriber `type:"structure" required:"true"`
  1799. }
  1800. // String returns the string representation
  1801. func (s CreateSubscriberInput) String() string {
  1802. return awsutil.Prettify(s)
  1803. }
  1804. // GoString returns the string representation
  1805. func (s CreateSubscriberInput) GoString() string {
  1806. return s.String()
  1807. }
  1808. // Validate inspects the fields of the type to determine if they are valid.
  1809. func (s *CreateSubscriberInput) Validate() error {
  1810. invalidParams := request.ErrInvalidParams{Context: "CreateSubscriberInput"}
  1811. if s.AccountId == nil {
  1812. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  1813. }
  1814. if s.AccountId != nil && len(*s.AccountId) < 12 {
  1815. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  1816. }
  1817. if s.BudgetName == nil {
  1818. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  1819. }
  1820. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  1821. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  1822. }
  1823. if s.Notification == nil {
  1824. invalidParams.Add(request.NewErrParamRequired("Notification"))
  1825. }
  1826. if s.Subscriber == nil {
  1827. invalidParams.Add(request.NewErrParamRequired("Subscriber"))
  1828. }
  1829. if s.Notification != nil {
  1830. if err := s.Notification.Validate(); err != nil {
  1831. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  1832. }
  1833. }
  1834. if s.Subscriber != nil {
  1835. if err := s.Subscriber.Validate(); err != nil {
  1836. invalidParams.AddNested("Subscriber", err.(request.ErrInvalidParams))
  1837. }
  1838. }
  1839. if invalidParams.Len() > 0 {
  1840. return invalidParams
  1841. }
  1842. return nil
  1843. }
  1844. // SetAccountId sets the AccountId field's value.
  1845. func (s *CreateSubscriberInput) SetAccountId(v string) *CreateSubscriberInput {
  1846. s.AccountId = &v
  1847. return s
  1848. }
  1849. // SetBudgetName sets the BudgetName field's value.
  1850. func (s *CreateSubscriberInput) SetBudgetName(v string) *CreateSubscriberInput {
  1851. s.BudgetName = &v
  1852. return s
  1853. }
  1854. // SetNotification sets the Notification field's value.
  1855. func (s *CreateSubscriberInput) SetNotification(v *Notification) *CreateSubscriberInput {
  1856. s.Notification = v
  1857. return s
  1858. }
  1859. // SetSubscriber sets the Subscriber field's value.
  1860. func (s *CreateSubscriberInput) SetSubscriber(v *Subscriber) *CreateSubscriberInput {
  1861. s.Subscriber = v
  1862. return s
  1863. }
  1864. // Response of CreateSubscriber
  1865. type CreateSubscriberOutput struct {
  1866. _ struct{} `type:"structure"`
  1867. }
  1868. // String returns the string representation
  1869. func (s CreateSubscriberOutput) String() string {
  1870. return awsutil.Prettify(s)
  1871. }
  1872. // GoString returns the string representation
  1873. func (s CreateSubscriberOutput) GoString() string {
  1874. return s.String()
  1875. }
  1876. // Request of DeleteBudget
  1877. type DeleteBudgetInput struct {
  1878. _ struct{} `type:"structure"`
  1879. // The accountId that is associated with the budget that you want to delete.
  1880. //
  1881. // AccountId is a required field
  1882. AccountId *string `min:"12" type:"string" required:"true"`
  1883. // The name of the budget that you want to delete.
  1884. //
  1885. // BudgetName is a required field
  1886. BudgetName *string `min:"1" type:"string" required:"true"`
  1887. }
  1888. // String returns the string representation
  1889. func (s DeleteBudgetInput) String() string {
  1890. return awsutil.Prettify(s)
  1891. }
  1892. // GoString returns the string representation
  1893. func (s DeleteBudgetInput) GoString() string {
  1894. return s.String()
  1895. }
  1896. // Validate inspects the fields of the type to determine if they are valid.
  1897. func (s *DeleteBudgetInput) Validate() error {
  1898. invalidParams := request.ErrInvalidParams{Context: "DeleteBudgetInput"}
  1899. if s.AccountId == nil {
  1900. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  1901. }
  1902. if s.AccountId != nil && len(*s.AccountId) < 12 {
  1903. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  1904. }
  1905. if s.BudgetName == nil {
  1906. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  1907. }
  1908. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  1909. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  1910. }
  1911. if invalidParams.Len() > 0 {
  1912. return invalidParams
  1913. }
  1914. return nil
  1915. }
  1916. // SetAccountId sets the AccountId field's value.
  1917. func (s *DeleteBudgetInput) SetAccountId(v string) *DeleteBudgetInput {
  1918. s.AccountId = &v
  1919. return s
  1920. }
  1921. // SetBudgetName sets the BudgetName field's value.
  1922. func (s *DeleteBudgetInput) SetBudgetName(v string) *DeleteBudgetInput {
  1923. s.BudgetName = &v
  1924. return s
  1925. }
  1926. // Response of DeleteBudget
  1927. type DeleteBudgetOutput struct {
  1928. _ struct{} `type:"structure"`
  1929. }
  1930. // String returns the string representation
  1931. func (s DeleteBudgetOutput) String() string {
  1932. return awsutil.Prettify(s)
  1933. }
  1934. // GoString returns the string representation
  1935. func (s DeleteBudgetOutput) GoString() string {
  1936. return s.String()
  1937. }
  1938. // Request of DeleteNotification
  1939. type DeleteNotificationInput struct {
  1940. _ struct{} `type:"structure"`
  1941. // The accountId that is associated with the budget whose notification you want
  1942. // to delete.
  1943. //
  1944. // AccountId is a required field
  1945. AccountId *string `min:"12" type:"string" required:"true"`
  1946. // The name of the budget whose notification you want to delete.
  1947. //
  1948. // BudgetName is a required field
  1949. BudgetName *string `min:"1" type:"string" required:"true"`
  1950. // The notification that you want to delete.
  1951. //
  1952. // Notification is a required field
  1953. Notification *Notification `type:"structure" required:"true"`
  1954. }
  1955. // String returns the string representation
  1956. func (s DeleteNotificationInput) String() string {
  1957. return awsutil.Prettify(s)
  1958. }
  1959. // GoString returns the string representation
  1960. func (s DeleteNotificationInput) GoString() string {
  1961. return s.String()
  1962. }
  1963. // Validate inspects the fields of the type to determine if they are valid.
  1964. func (s *DeleteNotificationInput) Validate() error {
  1965. invalidParams := request.ErrInvalidParams{Context: "DeleteNotificationInput"}
  1966. if s.AccountId == nil {
  1967. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  1968. }
  1969. if s.AccountId != nil && len(*s.AccountId) < 12 {
  1970. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  1971. }
  1972. if s.BudgetName == nil {
  1973. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  1974. }
  1975. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  1976. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  1977. }
  1978. if s.Notification == nil {
  1979. invalidParams.Add(request.NewErrParamRequired("Notification"))
  1980. }
  1981. if s.Notification != nil {
  1982. if err := s.Notification.Validate(); err != nil {
  1983. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  1984. }
  1985. }
  1986. if invalidParams.Len() > 0 {
  1987. return invalidParams
  1988. }
  1989. return nil
  1990. }
  1991. // SetAccountId sets the AccountId field's value.
  1992. func (s *DeleteNotificationInput) SetAccountId(v string) *DeleteNotificationInput {
  1993. s.AccountId = &v
  1994. return s
  1995. }
  1996. // SetBudgetName sets the BudgetName field's value.
  1997. func (s *DeleteNotificationInput) SetBudgetName(v string) *DeleteNotificationInput {
  1998. s.BudgetName = &v
  1999. return s
  2000. }
  2001. // SetNotification sets the Notification field's value.
  2002. func (s *DeleteNotificationInput) SetNotification(v *Notification) *DeleteNotificationInput {
  2003. s.Notification = v
  2004. return s
  2005. }
  2006. // Response of DeleteNotification
  2007. type DeleteNotificationOutput struct {
  2008. _ struct{} `type:"structure"`
  2009. }
  2010. // String returns the string representation
  2011. func (s DeleteNotificationOutput) String() string {
  2012. return awsutil.Prettify(s)
  2013. }
  2014. // GoString returns the string representation
  2015. func (s DeleteNotificationOutput) GoString() string {
  2016. return s.String()
  2017. }
  2018. // Request of DeleteSubscriber
  2019. type DeleteSubscriberInput struct {
  2020. _ struct{} `type:"structure"`
  2021. // The accountId that is associated with the budget whose subscriber you want
  2022. // to delete.
  2023. //
  2024. // AccountId is a required field
  2025. AccountId *string `min:"12" type:"string" required:"true"`
  2026. // The name of the budget whose subscriber you want to delete.
  2027. //
  2028. // BudgetName is a required field
  2029. BudgetName *string `min:"1" type:"string" required:"true"`
  2030. // The notification whose subscriber you want to delete.
  2031. //
  2032. // Notification is a required field
  2033. Notification *Notification `type:"structure" required:"true"`
  2034. // The subscriber that you want to delete.
  2035. //
  2036. // Subscriber is a required field
  2037. Subscriber *Subscriber `type:"structure" required:"true"`
  2038. }
  2039. // String returns the string representation
  2040. func (s DeleteSubscriberInput) String() string {
  2041. return awsutil.Prettify(s)
  2042. }
  2043. // GoString returns the string representation
  2044. func (s DeleteSubscriberInput) GoString() string {
  2045. return s.String()
  2046. }
  2047. // Validate inspects the fields of the type to determine if they are valid.
  2048. func (s *DeleteSubscriberInput) Validate() error {
  2049. invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriberInput"}
  2050. if s.AccountId == nil {
  2051. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2052. }
  2053. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2054. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2055. }
  2056. if s.BudgetName == nil {
  2057. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  2058. }
  2059. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  2060. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  2061. }
  2062. if s.Notification == nil {
  2063. invalidParams.Add(request.NewErrParamRequired("Notification"))
  2064. }
  2065. if s.Subscriber == nil {
  2066. invalidParams.Add(request.NewErrParamRequired("Subscriber"))
  2067. }
  2068. if s.Notification != nil {
  2069. if err := s.Notification.Validate(); err != nil {
  2070. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  2071. }
  2072. }
  2073. if s.Subscriber != nil {
  2074. if err := s.Subscriber.Validate(); err != nil {
  2075. invalidParams.AddNested("Subscriber", err.(request.ErrInvalidParams))
  2076. }
  2077. }
  2078. if invalidParams.Len() > 0 {
  2079. return invalidParams
  2080. }
  2081. return nil
  2082. }
  2083. // SetAccountId sets the AccountId field's value.
  2084. func (s *DeleteSubscriberInput) SetAccountId(v string) *DeleteSubscriberInput {
  2085. s.AccountId = &v
  2086. return s
  2087. }
  2088. // SetBudgetName sets the BudgetName field's value.
  2089. func (s *DeleteSubscriberInput) SetBudgetName(v string) *DeleteSubscriberInput {
  2090. s.BudgetName = &v
  2091. return s
  2092. }
  2093. // SetNotification sets the Notification field's value.
  2094. func (s *DeleteSubscriberInput) SetNotification(v *Notification) *DeleteSubscriberInput {
  2095. s.Notification = v
  2096. return s
  2097. }
  2098. // SetSubscriber sets the Subscriber field's value.
  2099. func (s *DeleteSubscriberInput) SetSubscriber(v *Subscriber) *DeleteSubscriberInput {
  2100. s.Subscriber = v
  2101. return s
  2102. }
  2103. // Response of DeleteSubscriber
  2104. type DeleteSubscriberOutput struct {
  2105. _ struct{} `type:"structure"`
  2106. }
  2107. // String returns the string representation
  2108. func (s DeleteSubscriberOutput) String() string {
  2109. return awsutil.Prettify(s)
  2110. }
  2111. // GoString returns the string representation
  2112. func (s DeleteSubscriberOutput) GoString() string {
  2113. return s.String()
  2114. }
  2115. // Request of DescribeBudget
  2116. type DescribeBudgetInput struct {
  2117. _ struct{} `type:"structure"`
  2118. // The accountId that is associated with the budget that you want a description
  2119. // of.
  2120. //
  2121. // AccountId is a required field
  2122. AccountId *string `min:"12" type:"string" required:"true"`
  2123. // The name of the budget that you want a description of.
  2124. //
  2125. // BudgetName is a required field
  2126. BudgetName *string `min:"1" type:"string" required:"true"`
  2127. }
  2128. // String returns the string representation
  2129. func (s DescribeBudgetInput) String() string {
  2130. return awsutil.Prettify(s)
  2131. }
  2132. // GoString returns the string representation
  2133. func (s DescribeBudgetInput) GoString() string {
  2134. return s.String()
  2135. }
  2136. // Validate inspects the fields of the type to determine if they are valid.
  2137. func (s *DescribeBudgetInput) Validate() error {
  2138. invalidParams := request.ErrInvalidParams{Context: "DescribeBudgetInput"}
  2139. if s.AccountId == nil {
  2140. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2141. }
  2142. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2143. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2144. }
  2145. if s.BudgetName == nil {
  2146. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  2147. }
  2148. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  2149. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  2150. }
  2151. if invalidParams.Len() > 0 {
  2152. return invalidParams
  2153. }
  2154. return nil
  2155. }
  2156. // SetAccountId sets the AccountId field's value.
  2157. func (s *DescribeBudgetInput) SetAccountId(v string) *DescribeBudgetInput {
  2158. s.AccountId = &v
  2159. return s
  2160. }
  2161. // SetBudgetName sets the BudgetName field's value.
  2162. func (s *DescribeBudgetInput) SetBudgetName(v string) *DescribeBudgetInput {
  2163. s.BudgetName = &v
  2164. return s
  2165. }
  2166. // Response of DescribeBudget
  2167. type DescribeBudgetOutput struct {
  2168. _ struct{} `type:"structure"`
  2169. // The description of the budget.
  2170. Budget *Budget `type:"structure"`
  2171. }
  2172. // String returns the string representation
  2173. func (s DescribeBudgetOutput) String() string {
  2174. return awsutil.Prettify(s)
  2175. }
  2176. // GoString returns the string representation
  2177. func (s DescribeBudgetOutput) GoString() string {
  2178. return s.String()
  2179. }
  2180. // SetBudget sets the Budget field's value.
  2181. func (s *DescribeBudgetOutput) SetBudget(v *Budget) *DescribeBudgetOutput {
  2182. s.Budget = v
  2183. return s
  2184. }
  2185. type DescribeBudgetPerformanceHistoryInput struct {
  2186. _ struct{} `type:"structure"`
  2187. // The account ID of the user. It should be a 12-digit number.
  2188. //
  2189. // AccountId is a required field
  2190. AccountId *string `min:"12" type:"string" required:"true"`
  2191. // A string that represents the budget name. The ":" and "\" characters aren't
  2192. // allowed.
  2193. //
  2194. // BudgetName is a required field
  2195. BudgetName *string `min:"1" type:"string" required:"true"`
  2196. // An integer that represents how many entries a paginated response contains.
  2197. // The maximum is 100.
  2198. MaxResults *int64 `min:"1" type:"integer"`
  2199. // A generic string.
  2200. NextToken *string `type:"string"`
  2201. // Retrieves how often the budget went into an ALARM state for the specified
  2202. // time period.
  2203. TimePeriod *TimePeriod `type:"structure"`
  2204. }
  2205. // String returns the string representation
  2206. func (s DescribeBudgetPerformanceHistoryInput) String() string {
  2207. return awsutil.Prettify(s)
  2208. }
  2209. // GoString returns the string representation
  2210. func (s DescribeBudgetPerformanceHistoryInput) GoString() string {
  2211. return s.String()
  2212. }
  2213. // Validate inspects the fields of the type to determine if they are valid.
  2214. func (s *DescribeBudgetPerformanceHistoryInput) Validate() error {
  2215. invalidParams := request.ErrInvalidParams{Context: "DescribeBudgetPerformanceHistoryInput"}
  2216. if s.AccountId == nil {
  2217. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2218. }
  2219. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2220. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2221. }
  2222. if s.BudgetName == nil {
  2223. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  2224. }
  2225. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  2226. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  2227. }
  2228. if s.MaxResults != nil && *s.MaxResults < 1 {
  2229. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  2230. }
  2231. if invalidParams.Len() > 0 {
  2232. return invalidParams
  2233. }
  2234. return nil
  2235. }
  2236. // SetAccountId sets the AccountId field's value.
  2237. func (s *DescribeBudgetPerformanceHistoryInput) SetAccountId(v string) *DescribeBudgetPerformanceHistoryInput {
  2238. s.AccountId = &v
  2239. return s
  2240. }
  2241. // SetBudgetName sets the BudgetName field's value.
  2242. func (s *DescribeBudgetPerformanceHistoryInput) SetBudgetName(v string) *DescribeBudgetPerformanceHistoryInput {
  2243. s.BudgetName = &v
  2244. return s
  2245. }
  2246. // SetMaxResults sets the MaxResults field's value.
  2247. func (s *DescribeBudgetPerformanceHistoryInput) SetMaxResults(v int64) *DescribeBudgetPerformanceHistoryInput {
  2248. s.MaxResults = &v
  2249. return s
  2250. }
  2251. // SetNextToken sets the NextToken field's value.
  2252. func (s *DescribeBudgetPerformanceHistoryInput) SetNextToken(v string) *DescribeBudgetPerformanceHistoryInput {
  2253. s.NextToken = &v
  2254. return s
  2255. }
  2256. // SetTimePeriod sets the TimePeriod field's value.
  2257. func (s *DescribeBudgetPerformanceHistoryInput) SetTimePeriod(v *TimePeriod) *DescribeBudgetPerformanceHistoryInput {
  2258. s.TimePeriod = v
  2259. return s
  2260. }
  2261. type DescribeBudgetPerformanceHistoryOutput struct {
  2262. _ struct{} `type:"structure"`
  2263. // The history of how often the budget has gone into an ALARM state.
  2264. //
  2265. // For DAILY budgets, the history saves the state of the budget for the last
  2266. // 60 days. For MONTHLY budgets, the history saves the state of the budget for
  2267. // the current month plus the last 12 months. For QUARTERLY budgets, the history
  2268. // saves the state of the budget for the last four quarters.
  2269. BudgetPerformanceHistory *BudgetPerformanceHistory `type:"structure"`
  2270. // A generic string.
  2271. NextToken *string `type:"string"`
  2272. }
  2273. // String returns the string representation
  2274. func (s DescribeBudgetPerformanceHistoryOutput) String() string {
  2275. return awsutil.Prettify(s)
  2276. }
  2277. // GoString returns the string representation
  2278. func (s DescribeBudgetPerformanceHistoryOutput) GoString() string {
  2279. return s.String()
  2280. }
  2281. // SetBudgetPerformanceHistory sets the BudgetPerformanceHistory field's value.
  2282. func (s *DescribeBudgetPerformanceHistoryOutput) SetBudgetPerformanceHistory(v *BudgetPerformanceHistory) *DescribeBudgetPerformanceHistoryOutput {
  2283. s.BudgetPerformanceHistory = v
  2284. return s
  2285. }
  2286. // SetNextToken sets the NextToken field's value.
  2287. func (s *DescribeBudgetPerformanceHistoryOutput) SetNextToken(v string) *DescribeBudgetPerformanceHistoryOutput {
  2288. s.NextToken = &v
  2289. return s
  2290. }
  2291. // Request of DescribeBudgets
  2292. type DescribeBudgetsInput struct {
  2293. _ struct{} `type:"structure"`
  2294. // The accountId that is associated with the budgets that you want descriptions
  2295. // of.
  2296. //
  2297. // AccountId is a required field
  2298. AccountId *string `min:"12" type:"string" required:"true"`
  2299. // An optional integer that represents how many entries a paginated response
  2300. // contains. The maximum is 100.
  2301. MaxResults *int64 `min:"1" type:"integer"`
  2302. // The pagination token that you include in your request to indicate the next
  2303. // set of results that you want to retrieve.
  2304. NextToken *string `type:"string"`
  2305. }
  2306. // String returns the string representation
  2307. func (s DescribeBudgetsInput) String() string {
  2308. return awsutil.Prettify(s)
  2309. }
  2310. // GoString returns the string representation
  2311. func (s DescribeBudgetsInput) GoString() string {
  2312. return s.String()
  2313. }
  2314. // Validate inspects the fields of the type to determine if they are valid.
  2315. func (s *DescribeBudgetsInput) Validate() error {
  2316. invalidParams := request.ErrInvalidParams{Context: "DescribeBudgetsInput"}
  2317. if s.AccountId == nil {
  2318. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2319. }
  2320. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2321. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2322. }
  2323. if s.MaxResults != nil && *s.MaxResults < 1 {
  2324. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  2325. }
  2326. if invalidParams.Len() > 0 {
  2327. return invalidParams
  2328. }
  2329. return nil
  2330. }
  2331. // SetAccountId sets the AccountId field's value.
  2332. func (s *DescribeBudgetsInput) SetAccountId(v string) *DescribeBudgetsInput {
  2333. s.AccountId = &v
  2334. return s
  2335. }
  2336. // SetMaxResults sets the MaxResults field's value.
  2337. func (s *DescribeBudgetsInput) SetMaxResults(v int64) *DescribeBudgetsInput {
  2338. s.MaxResults = &v
  2339. return s
  2340. }
  2341. // SetNextToken sets the NextToken field's value.
  2342. func (s *DescribeBudgetsInput) SetNextToken(v string) *DescribeBudgetsInput {
  2343. s.NextToken = &v
  2344. return s
  2345. }
  2346. // Response of DescribeBudgets
  2347. type DescribeBudgetsOutput struct {
  2348. _ struct{} `type:"structure"`
  2349. // A list of budgets.
  2350. Budgets []*Budget `type:"list"`
  2351. // The pagination token in the service response that indicates the next set
  2352. // of results that you can retrieve.
  2353. NextToken *string `type:"string"`
  2354. }
  2355. // String returns the string representation
  2356. func (s DescribeBudgetsOutput) String() string {
  2357. return awsutil.Prettify(s)
  2358. }
  2359. // GoString returns the string representation
  2360. func (s DescribeBudgetsOutput) GoString() string {
  2361. return s.String()
  2362. }
  2363. // SetBudgets sets the Budgets field's value.
  2364. func (s *DescribeBudgetsOutput) SetBudgets(v []*Budget) *DescribeBudgetsOutput {
  2365. s.Budgets = v
  2366. return s
  2367. }
  2368. // SetNextToken sets the NextToken field's value.
  2369. func (s *DescribeBudgetsOutput) SetNextToken(v string) *DescribeBudgetsOutput {
  2370. s.NextToken = &v
  2371. return s
  2372. }
  2373. // Request of DescribeNotificationsForBudget
  2374. type DescribeNotificationsForBudgetInput struct {
  2375. _ struct{} `type:"structure"`
  2376. // The accountId that is associated with the budget whose notifications you
  2377. // want descriptions of.
  2378. //
  2379. // AccountId is a required field
  2380. AccountId *string `min:"12" type:"string" required:"true"`
  2381. // The name of the budget whose notifications you want descriptions of.
  2382. //
  2383. // BudgetName is a required field
  2384. BudgetName *string `min:"1" type:"string" required:"true"`
  2385. // An optional integer that represents how many entries a paginated response
  2386. // contains. The maximum is 100.
  2387. MaxResults *int64 `min:"1" type:"integer"`
  2388. // The pagination token that you include in your request to indicate the next
  2389. // set of results that you want to retrieve.
  2390. NextToken *string `type:"string"`
  2391. }
  2392. // String returns the string representation
  2393. func (s DescribeNotificationsForBudgetInput) String() string {
  2394. return awsutil.Prettify(s)
  2395. }
  2396. // GoString returns the string representation
  2397. func (s DescribeNotificationsForBudgetInput) GoString() string {
  2398. return s.String()
  2399. }
  2400. // Validate inspects the fields of the type to determine if they are valid.
  2401. func (s *DescribeNotificationsForBudgetInput) Validate() error {
  2402. invalidParams := request.ErrInvalidParams{Context: "DescribeNotificationsForBudgetInput"}
  2403. if s.AccountId == nil {
  2404. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2405. }
  2406. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2407. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2408. }
  2409. if s.BudgetName == nil {
  2410. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  2411. }
  2412. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  2413. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  2414. }
  2415. if s.MaxResults != nil && *s.MaxResults < 1 {
  2416. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  2417. }
  2418. if invalidParams.Len() > 0 {
  2419. return invalidParams
  2420. }
  2421. return nil
  2422. }
  2423. // SetAccountId sets the AccountId field's value.
  2424. func (s *DescribeNotificationsForBudgetInput) SetAccountId(v string) *DescribeNotificationsForBudgetInput {
  2425. s.AccountId = &v
  2426. return s
  2427. }
  2428. // SetBudgetName sets the BudgetName field's value.
  2429. func (s *DescribeNotificationsForBudgetInput) SetBudgetName(v string) *DescribeNotificationsForBudgetInput {
  2430. s.BudgetName = &v
  2431. return s
  2432. }
  2433. // SetMaxResults sets the MaxResults field's value.
  2434. func (s *DescribeNotificationsForBudgetInput) SetMaxResults(v int64) *DescribeNotificationsForBudgetInput {
  2435. s.MaxResults = &v
  2436. return s
  2437. }
  2438. // SetNextToken sets the NextToken field's value.
  2439. func (s *DescribeNotificationsForBudgetInput) SetNextToken(v string) *DescribeNotificationsForBudgetInput {
  2440. s.NextToken = &v
  2441. return s
  2442. }
  2443. // Response of GetNotificationsForBudget
  2444. type DescribeNotificationsForBudgetOutput struct {
  2445. _ struct{} `type:"structure"`
  2446. // The pagination token in the service response that indicates the next set
  2447. // of results that you can retrieve.
  2448. NextToken *string `type:"string"`
  2449. // A list of notifications that are associated with a budget.
  2450. Notifications []*Notification `type:"list"`
  2451. }
  2452. // String returns the string representation
  2453. func (s DescribeNotificationsForBudgetOutput) String() string {
  2454. return awsutil.Prettify(s)
  2455. }
  2456. // GoString returns the string representation
  2457. func (s DescribeNotificationsForBudgetOutput) GoString() string {
  2458. return s.String()
  2459. }
  2460. // SetNextToken sets the NextToken field's value.
  2461. func (s *DescribeNotificationsForBudgetOutput) SetNextToken(v string) *DescribeNotificationsForBudgetOutput {
  2462. s.NextToken = &v
  2463. return s
  2464. }
  2465. // SetNotifications sets the Notifications field's value.
  2466. func (s *DescribeNotificationsForBudgetOutput) SetNotifications(v []*Notification) *DescribeNotificationsForBudgetOutput {
  2467. s.Notifications = v
  2468. return s
  2469. }
  2470. // Request of DescribeSubscribersForNotification
  2471. type DescribeSubscribersForNotificationInput struct {
  2472. _ struct{} `type:"structure"`
  2473. // The accountId that is associated with the budget whose subscribers you want
  2474. // descriptions of.
  2475. //
  2476. // AccountId is a required field
  2477. AccountId *string `min:"12" type:"string" required:"true"`
  2478. // The name of the budget whose subscribers you want descriptions of.
  2479. //
  2480. // BudgetName is a required field
  2481. BudgetName *string `min:"1" type:"string" required:"true"`
  2482. // An optional integer that represents how many entries a paginated response
  2483. // contains. The maximum is 100.
  2484. MaxResults *int64 `min:"1" type:"integer"`
  2485. // The pagination token that you include in your request to indicate the next
  2486. // set of results that you want to retrieve.
  2487. NextToken *string `type:"string"`
  2488. // The notification whose subscribers you want to list.
  2489. //
  2490. // Notification is a required field
  2491. Notification *Notification `type:"structure" required:"true"`
  2492. }
  2493. // String returns the string representation
  2494. func (s DescribeSubscribersForNotificationInput) String() string {
  2495. return awsutil.Prettify(s)
  2496. }
  2497. // GoString returns the string representation
  2498. func (s DescribeSubscribersForNotificationInput) GoString() string {
  2499. return s.String()
  2500. }
  2501. // Validate inspects the fields of the type to determine if they are valid.
  2502. func (s *DescribeSubscribersForNotificationInput) Validate() error {
  2503. invalidParams := request.ErrInvalidParams{Context: "DescribeSubscribersForNotificationInput"}
  2504. if s.AccountId == nil {
  2505. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2506. }
  2507. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2508. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2509. }
  2510. if s.BudgetName == nil {
  2511. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  2512. }
  2513. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  2514. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  2515. }
  2516. if s.MaxResults != nil && *s.MaxResults < 1 {
  2517. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  2518. }
  2519. if s.Notification == nil {
  2520. invalidParams.Add(request.NewErrParamRequired("Notification"))
  2521. }
  2522. if s.Notification != nil {
  2523. if err := s.Notification.Validate(); err != nil {
  2524. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  2525. }
  2526. }
  2527. if invalidParams.Len() > 0 {
  2528. return invalidParams
  2529. }
  2530. return nil
  2531. }
  2532. // SetAccountId sets the AccountId field's value.
  2533. func (s *DescribeSubscribersForNotificationInput) SetAccountId(v string) *DescribeSubscribersForNotificationInput {
  2534. s.AccountId = &v
  2535. return s
  2536. }
  2537. // SetBudgetName sets the BudgetName field's value.
  2538. func (s *DescribeSubscribersForNotificationInput) SetBudgetName(v string) *DescribeSubscribersForNotificationInput {
  2539. s.BudgetName = &v
  2540. return s
  2541. }
  2542. // SetMaxResults sets the MaxResults field's value.
  2543. func (s *DescribeSubscribersForNotificationInput) SetMaxResults(v int64) *DescribeSubscribersForNotificationInput {
  2544. s.MaxResults = &v
  2545. return s
  2546. }
  2547. // SetNextToken sets the NextToken field's value.
  2548. func (s *DescribeSubscribersForNotificationInput) SetNextToken(v string) *DescribeSubscribersForNotificationInput {
  2549. s.NextToken = &v
  2550. return s
  2551. }
  2552. // SetNotification sets the Notification field's value.
  2553. func (s *DescribeSubscribersForNotificationInput) SetNotification(v *Notification) *DescribeSubscribersForNotificationInput {
  2554. s.Notification = v
  2555. return s
  2556. }
  2557. // Response of DescribeSubscribersForNotification
  2558. type DescribeSubscribersForNotificationOutput struct {
  2559. _ struct{} `type:"structure"`
  2560. // The pagination token in the service response that indicates the next set
  2561. // of results that you can retrieve.
  2562. NextToken *string `type:"string"`
  2563. // A list of subscribers that are associated with a notification.
  2564. Subscribers []*Subscriber `min:"1" type:"list"`
  2565. }
  2566. // String returns the string representation
  2567. func (s DescribeSubscribersForNotificationOutput) String() string {
  2568. return awsutil.Prettify(s)
  2569. }
  2570. // GoString returns the string representation
  2571. func (s DescribeSubscribersForNotificationOutput) GoString() string {
  2572. return s.String()
  2573. }
  2574. // SetNextToken sets the NextToken field's value.
  2575. func (s *DescribeSubscribersForNotificationOutput) SetNextToken(v string) *DescribeSubscribersForNotificationOutput {
  2576. s.NextToken = &v
  2577. return s
  2578. }
  2579. // SetSubscribers sets the Subscribers field's value.
  2580. func (s *DescribeSubscribersForNotificationOutput) SetSubscribers(v []*Subscriber) *DescribeSubscribersForNotificationOutput {
  2581. s.Subscribers = v
  2582. return s
  2583. }
  2584. // A notification that is associated with a budget. A budget can have up to
  2585. // five notifications.
  2586. //
  2587. // Each notification must have at least one subscriber. A notification can have
  2588. // one SNS subscriber and up to 10 email subscribers, for a total of 11 subscribers.
  2589. //
  2590. // For example, if you have a budget for 200 dollars and you want to be notified
  2591. // when you go over 160 dollars, create a notification with the following parameters:
  2592. //
  2593. // * A notificationType of ACTUAL
  2594. //
  2595. // * A thresholdType of PERCENTAGE
  2596. //
  2597. // * A comparisonOperator of GREATER_THAN
  2598. //
  2599. // * A notification threshold of 80
  2600. type Notification struct {
  2601. _ struct{} `type:"structure"`
  2602. // The comparison that is used for this notification.
  2603. //
  2604. // ComparisonOperator is a required field
  2605. ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"`
  2606. // Whether this notification is in alarm. If a budget notification is in the
  2607. // ALARM state, you have passed the set threshold for the budget.
  2608. NotificationState *string `type:"string" enum:"NotificationState"`
  2609. // Whether the notification is for how much you have spent (ACTUAL) or for how
  2610. // much you're forecasted to spend (FORECASTED).
  2611. //
  2612. // NotificationType is a required field
  2613. NotificationType *string `type:"string" required:"true" enum:"NotificationType"`
  2614. // The threshold that is associated with a notification. Thresholds are always
  2615. // a percentage.
  2616. //
  2617. // Threshold is a required field
  2618. Threshold *float64 `type:"double" required:"true"`
  2619. // The type of threshold for a notification. For ABSOLUTE_VALUE thresholds,
  2620. // AWS notifies you when you go over or are forecasted to go over your total
  2621. // cost threshold. For PERCENTAGE thresholds, AWS notifies you when you go over
  2622. // or are forecasted to go over a certain percentage of your forecasted spend.
  2623. // For example, if you have a budget for 200 dollars and you have a PERCENTAGE
  2624. // threshold of 80%, AWS notifies you when you go over 160 dollars.
  2625. ThresholdType *string `type:"string" enum:"ThresholdType"`
  2626. }
  2627. // String returns the string representation
  2628. func (s Notification) String() string {
  2629. return awsutil.Prettify(s)
  2630. }
  2631. // GoString returns the string representation
  2632. func (s Notification) GoString() string {
  2633. return s.String()
  2634. }
  2635. // Validate inspects the fields of the type to determine if they are valid.
  2636. func (s *Notification) Validate() error {
  2637. invalidParams := request.ErrInvalidParams{Context: "Notification"}
  2638. if s.ComparisonOperator == nil {
  2639. invalidParams.Add(request.NewErrParamRequired("ComparisonOperator"))
  2640. }
  2641. if s.NotificationType == nil {
  2642. invalidParams.Add(request.NewErrParamRequired("NotificationType"))
  2643. }
  2644. if s.Threshold == nil {
  2645. invalidParams.Add(request.NewErrParamRequired("Threshold"))
  2646. }
  2647. if invalidParams.Len() > 0 {
  2648. return invalidParams
  2649. }
  2650. return nil
  2651. }
  2652. // SetComparisonOperator sets the ComparisonOperator field's value.
  2653. func (s *Notification) SetComparisonOperator(v string) *Notification {
  2654. s.ComparisonOperator = &v
  2655. return s
  2656. }
  2657. // SetNotificationState sets the NotificationState field's value.
  2658. func (s *Notification) SetNotificationState(v string) *Notification {
  2659. s.NotificationState = &v
  2660. return s
  2661. }
  2662. // SetNotificationType sets the NotificationType field's value.
  2663. func (s *Notification) SetNotificationType(v string) *Notification {
  2664. s.NotificationType = &v
  2665. return s
  2666. }
  2667. // SetThreshold sets the Threshold field's value.
  2668. func (s *Notification) SetThreshold(v float64) *Notification {
  2669. s.Threshold = &v
  2670. return s
  2671. }
  2672. // SetThresholdType sets the ThresholdType field's value.
  2673. func (s *Notification) SetThresholdType(v string) *Notification {
  2674. s.ThresholdType = &v
  2675. return s
  2676. }
  2677. // A notification with subscribers. A notification can have one SNS subscriber
  2678. // and up to 10 email subscribers, for a total of 11 subscribers.
  2679. type NotificationWithSubscribers struct {
  2680. _ struct{} `type:"structure"`
  2681. // The notification that is associated with a budget.
  2682. //
  2683. // Notification is a required field
  2684. Notification *Notification `type:"structure" required:"true"`
  2685. // A list of subscribers who are subscribed to this notification.
  2686. //
  2687. // Subscribers is a required field
  2688. Subscribers []*Subscriber `min:"1" type:"list" required:"true"`
  2689. }
  2690. // String returns the string representation
  2691. func (s NotificationWithSubscribers) String() string {
  2692. return awsutil.Prettify(s)
  2693. }
  2694. // GoString returns the string representation
  2695. func (s NotificationWithSubscribers) GoString() string {
  2696. return s.String()
  2697. }
  2698. // Validate inspects the fields of the type to determine if they are valid.
  2699. func (s *NotificationWithSubscribers) Validate() error {
  2700. invalidParams := request.ErrInvalidParams{Context: "NotificationWithSubscribers"}
  2701. if s.Notification == nil {
  2702. invalidParams.Add(request.NewErrParamRequired("Notification"))
  2703. }
  2704. if s.Subscribers == nil {
  2705. invalidParams.Add(request.NewErrParamRequired("Subscribers"))
  2706. }
  2707. if s.Subscribers != nil && len(s.Subscribers) < 1 {
  2708. invalidParams.Add(request.NewErrParamMinLen("Subscribers", 1))
  2709. }
  2710. if s.Notification != nil {
  2711. if err := s.Notification.Validate(); err != nil {
  2712. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  2713. }
  2714. }
  2715. if s.Subscribers != nil {
  2716. for i, v := range s.Subscribers {
  2717. if v == nil {
  2718. continue
  2719. }
  2720. if err := v.Validate(); err != nil {
  2721. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Subscribers", i), err.(request.ErrInvalidParams))
  2722. }
  2723. }
  2724. }
  2725. if invalidParams.Len() > 0 {
  2726. return invalidParams
  2727. }
  2728. return nil
  2729. }
  2730. // SetNotification sets the Notification field's value.
  2731. func (s *NotificationWithSubscribers) SetNotification(v *Notification) *NotificationWithSubscribers {
  2732. s.Notification = v
  2733. return s
  2734. }
  2735. // SetSubscribers sets the Subscribers field's value.
  2736. func (s *NotificationWithSubscribers) SetSubscribers(v []*Subscriber) *NotificationWithSubscribers {
  2737. s.Subscribers = v
  2738. return s
  2739. }
  2740. // The amount of cost or usage that is measured for a budget.
  2741. //
  2742. // For example, a Spend for 3 GB of S3 usage would have the following parameters:
  2743. //
  2744. // * An Amount of 3
  2745. //
  2746. // * A unit of GB
  2747. type Spend struct {
  2748. _ struct{} `type:"structure"`
  2749. // The cost or usage amount that is associated with a budget forecast, actual
  2750. // spend, or budget threshold.
  2751. //
  2752. // Amount is a required field
  2753. Amount *string `min:"1" type:"string" required:"true"`
  2754. // The unit of measurement that is used for the budget forecast, actual spend,
  2755. // or budget threshold, such as dollars or GB.
  2756. //
  2757. // Unit is a required field
  2758. Unit *string `min:"1" type:"string" required:"true"`
  2759. }
  2760. // String returns the string representation
  2761. func (s Spend) String() string {
  2762. return awsutil.Prettify(s)
  2763. }
  2764. // GoString returns the string representation
  2765. func (s Spend) GoString() string {
  2766. return s.String()
  2767. }
  2768. // Validate inspects the fields of the type to determine if they are valid.
  2769. func (s *Spend) Validate() error {
  2770. invalidParams := request.ErrInvalidParams{Context: "Spend"}
  2771. if s.Amount == nil {
  2772. invalidParams.Add(request.NewErrParamRequired("Amount"))
  2773. }
  2774. if s.Amount != nil && len(*s.Amount) < 1 {
  2775. invalidParams.Add(request.NewErrParamMinLen("Amount", 1))
  2776. }
  2777. if s.Unit == nil {
  2778. invalidParams.Add(request.NewErrParamRequired("Unit"))
  2779. }
  2780. if s.Unit != nil && len(*s.Unit) < 1 {
  2781. invalidParams.Add(request.NewErrParamMinLen("Unit", 1))
  2782. }
  2783. if invalidParams.Len() > 0 {
  2784. return invalidParams
  2785. }
  2786. return nil
  2787. }
  2788. // SetAmount sets the Amount field's value.
  2789. func (s *Spend) SetAmount(v string) *Spend {
  2790. s.Amount = &v
  2791. return s
  2792. }
  2793. // SetUnit sets the Unit field's value.
  2794. func (s *Spend) SetUnit(v string) *Spend {
  2795. s.Unit = &v
  2796. return s
  2797. }
  2798. // The subscriber to a budget notification. The subscriber consists of a subscription
  2799. // type and either an Amazon SNS topic or an email address.
  2800. //
  2801. // For example, an email subscriber would have the following parameters:
  2802. //
  2803. // * A subscriptionType of EMAIL
  2804. //
  2805. // * An address of example@example.com
  2806. type Subscriber struct {
  2807. _ struct{} `type:"structure"`
  2808. // The address that AWS sends budget notifications to, either an SNS topic or
  2809. // an email.
  2810. //
  2811. // Address is a required field
  2812. Address *string `min:"1" type:"string" required:"true" sensitive:"true"`
  2813. // The type of notification that AWS sends to a subscriber.
  2814. //
  2815. // SubscriptionType is a required field
  2816. SubscriptionType *string `type:"string" required:"true" enum:"SubscriptionType"`
  2817. }
  2818. // String returns the string representation
  2819. func (s Subscriber) String() string {
  2820. return awsutil.Prettify(s)
  2821. }
  2822. // GoString returns the string representation
  2823. func (s Subscriber) GoString() string {
  2824. return s.String()
  2825. }
  2826. // Validate inspects the fields of the type to determine if they are valid.
  2827. func (s *Subscriber) Validate() error {
  2828. invalidParams := request.ErrInvalidParams{Context: "Subscriber"}
  2829. if s.Address == nil {
  2830. invalidParams.Add(request.NewErrParamRequired("Address"))
  2831. }
  2832. if s.Address != nil && len(*s.Address) < 1 {
  2833. invalidParams.Add(request.NewErrParamMinLen("Address", 1))
  2834. }
  2835. if s.SubscriptionType == nil {
  2836. invalidParams.Add(request.NewErrParamRequired("SubscriptionType"))
  2837. }
  2838. if invalidParams.Len() > 0 {
  2839. return invalidParams
  2840. }
  2841. return nil
  2842. }
  2843. // SetAddress sets the Address field's value.
  2844. func (s *Subscriber) SetAddress(v string) *Subscriber {
  2845. s.Address = &v
  2846. return s
  2847. }
  2848. // SetSubscriptionType sets the SubscriptionType field's value.
  2849. func (s *Subscriber) SetSubscriptionType(v string) *Subscriber {
  2850. s.SubscriptionType = &v
  2851. return s
  2852. }
  2853. // The period of time that is covered by a budget. The period has a start date
  2854. // and an end date. The start date must come before the end date. There are
  2855. // no restrictions on the end date.
  2856. type TimePeriod struct {
  2857. _ struct{} `type:"structure"`
  2858. // The end date for a budget. If you didn't specify an end date, AWS set your
  2859. // end date to 06/15/87 00:00 UTC. The defaults are the same for the AWS Billing
  2860. // and Cost Management console and the API.
  2861. //
  2862. // After the end date, AWS deletes the budget and all associated notifications
  2863. // and subscribers. You can change your end date with the UpdateBudget operation.
  2864. End *time.Time `type:"timestamp"`
  2865. // The start date for a budget. If you created your budget and didn't specify
  2866. // a start date, AWS defaults to the start of your chosen time period (DAILY,
  2867. // MONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget
  2868. // on January 24, 2018, chose DAILY, and didn't set a start date, AWS set your
  2869. // start date to 01/24/18 00:00 UTC. If you chose MONTHLY, AWS set your start
  2870. // date to 01/01/18 00:00 UTC. The defaults are the same for the AWS Billing
  2871. // and Cost Management console and the API.
  2872. //
  2873. // You can change your start date with the UpdateBudget operation.
  2874. Start *time.Time `type:"timestamp"`
  2875. }
  2876. // String returns the string representation
  2877. func (s TimePeriod) String() string {
  2878. return awsutil.Prettify(s)
  2879. }
  2880. // GoString returns the string representation
  2881. func (s TimePeriod) GoString() string {
  2882. return s.String()
  2883. }
  2884. // SetEnd sets the End field's value.
  2885. func (s *TimePeriod) SetEnd(v time.Time) *TimePeriod {
  2886. s.End = &v
  2887. return s
  2888. }
  2889. // SetStart sets the Start field's value.
  2890. func (s *TimePeriod) SetStart(v time.Time) *TimePeriod {
  2891. s.Start = &v
  2892. return s
  2893. }
  2894. // Request of UpdateBudget
  2895. type UpdateBudgetInput struct {
  2896. _ struct{} `type:"structure"`
  2897. // The accountId that is associated with the budget that you want to update.
  2898. //
  2899. // AccountId is a required field
  2900. AccountId *string `min:"12" type:"string" required:"true"`
  2901. // The budget that you want to update your budget to.
  2902. //
  2903. // NewBudget is a required field
  2904. NewBudget *Budget `type:"structure" required:"true"`
  2905. }
  2906. // String returns the string representation
  2907. func (s UpdateBudgetInput) String() string {
  2908. return awsutil.Prettify(s)
  2909. }
  2910. // GoString returns the string representation
  2911. func (s UpdateBudgetInput) GoString() string {
  2912. return s.String()
  2913. }
  2914. // Validate inspects the fields of the type to determine if they are valid.
  2915. func (s *UpdateBudgetInput) Validate() error {
  2916. invalidParams := request.ErrInvalidParams{Context: "UpdateBudgetInput"}
  2917. if s.AccountId == nil {
  2918. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2919. }
  2920. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2921. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2922. }
  2923. if s.NewBudget == nil {
  2924. invalidParams.Add(request.NewErrParamRequired("NewBudget"))
  2925. }
  2926. if s.NewBudget != nil {
  2927. if err := s.NewBudget.Validate(); err != nil {
  2928. invalidParams.AddNested("NewBudget", err.(request.ErrInvalidParams))
  2929. }
  2930. }
  2931. if invalidParams.Len() > 0 {
  2932. return invalidParams
  2933. }
  2934. return nil
  2935. }
  2936. // SetAccountId sets the AccountId field's value.
  2937. func (s *UpdateBudgetInput) SetAccountId(v string) *UpdateBudgetInput {
  2938. s.AccountId = &v
  2939. return s
  2940. }
  2941. // SetNewBudget sets the NewBudget field's value.
  2942. func (s *UpdateBudgetInput) SetNewBudget(v *Budget) *UpdateBudgetInput {
  2943. s.NewBudget = v
  2944. return s
  2945. }
  2946. // Response of UpdateBudget
  2947. type UpdateBudgetOutput struct {
  2948. _ struct{} `type:"structure"`
  2949. }
  2950. // String returns the string representation
  2951. func (s UpdateBudgetOutput) String() string {
  2952. return awsutil.Prettify(s)
  2953. }
  2954. // GoString returns the string representation
  2955. func (s UpdateBudgetOutput) GoString() string {
  2956. return s.String()
  2957. }
  2958. // Request of UpdateNotification
  2959. type UpdateNotificationInput struct {
  2960. _ struct{} `type:"structure"`
  2961. // The accountId that is associated with the budget whose notification you want
  2962. // to update.
  2963. //
  2964. // AccountId is a required field
  2965. AccountId *string `min:"12" type:"string" required:"true"`
  2966. // The name of the budget whose notification you want to update.
  2967. //
  2968. // BudgetName is a required field
  2969. BudgetName *string `min:"1" type:"string" required:"true"`
  2970. // The updated notification to be associated with a budget.
  2971. //
  2972. // NewNotification is a required field
  2973. NewNotification *Notification `type:"structure" required:"true"`
  2974. // The previous notification that is associated with a budget.
  2975. //
  2976. // OldNotification is a required field
  2977. OldNotification *Notification `type:"structure" required:"true"`
  2978. }
  2979. // String returns the string representation
  2980. func (s UpdateNotificationInput) String() string {
  2981. return awsutil.Prettify(s)
  2982. }
  2983. // GoString returns the string representation
  2984. func (s UpdateNotificationInput) GoString() string {
  2985. return s.String()
  2986. }
  2987. // Validate inspects the fields of the type to determine if they are valid.
  2988. func (s *UpdateNotificationInput) Validate() error {
  2989. invalidParams := request.ErrInvalidParams{Context: "UpdateNotificationInput"}
  2990. if s.AccountId == nil {
  2991. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  2992. }
  2993. if s.AccountId != nil && len(*s.AccountId) < 12 {
  2994. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  2995. }
  2996. if s.BudgetName == nil {
  2997. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  2998. }
  2999. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  3000. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  3001. }
  3002. if s.NewNotification == nil {
  3003. invalidParams.Add(request.NewErrParamRequired("NewNotification"))
  3004. }
  3005. if s.OldNotification == nil {
  3006. invalidParams.Add(request.NewErrParamRequired("OldNotification"))
  3007. }
  3008. if s.NewNotification != nil {
  3009. if err := s.NewNotification.Validate(); err != nil {
  3010. invalidParams.AddNested("NewNotification", err.(request.ErrInvalidParams))
  3011. }
  3012. }
  3013. if s.OldNotification != nil {
  3014. if err := s.OldNotification.Validate(); err != nil {
  3015. invalidParams.AddNested("OldNotification", err.(request.ErrInvalidParams))
  3016. }
  3017. }
  3018. if invalidParams.Len() > 0 {
  3019. return invalidParams
  3020. }
  3021. return nil
  3022. }
  3023. // SetAccountId sets the AccountId field's value.
  3024. func (s *UpdateNotificationInput) SetAccountId(v string) *UpdateNotificationInput {
  3025. s.AccountId = &v
  3026. return s
  3027. }
  3028. // SetBudgetName sets the BudgetName field's value.
  3029. func (s *UpdateNotificationInput) SetBudgetName(v string) *UpdateNotificationInput {
  3030. s.BudgetName = &v
  3031. return s
  3032. }
  3033. // SetNewNotification sets the NewNotification field's value.
  3034. func (s *UpdateNotificationInput) SetNewNotification(v *Notification) *UpdateNotificationInput {
  3035. s.NewNotification = v
  3036. return s
  3037. }
  3038. // SetOldNotification sets the OldNotification field's value.
  3039. func (s *UpdateNotificationInput) SetOldNotification(v *Notification) *UpdateNotificationInput {
  3040. s.OldNotification = v
  3041. return s
  3042. }
  3043. // Response of UpdateNotification
  3044. type UpdateNotificationOutput struct {
  3045. _ struct{} `type:"structure"`
  3046. }
  3047. // String returns the string representation
  3048. func (s UpdateNotificationOutput) String() string {
  3049. return awsutil.Prettify(s)
  3050. }
  3051. // GoString returns the string representation
  3052. func (s UpdateNotificationOutput) GoString() string {
  3053. return s.String()
  3054. }
  3055. // Request of UpdateSubscriber
  3056. type UpdateSubscriberInput struct {
  3057. _ struct{} `type:"structure"`
  3058. // The accountId that is associated with the budget whose subscriber you want
  3059. // to update.
  3060. //
  3061. // AccountId is a required field
  3062. AccountId *string `min:"12" type:"string" required:"true"`
  3063. // The name of the budget whose subscriber you want to update.
  3064. //
  3065. // BudgetName is a required field
  3066. BudgetName *string `min:"1" type:"string" required:"true"`
  3067. // The updated subscriber that is associated with a budget notification.
  3068. //
  3069. // NewSubscriber is a required field
  3070. NewSubscriber *Subscriber `type:"structure" required:"true"`
  3071. // The notification whose subscriber you want to update.
  3072. //
  3073. // Notification is a required field
  3074. Notification *Notification `type:"structure" required:"true"`
  3075. // The previous subscriber that is associated with a budget notification.
  3076. //
  3077. // OldSubscriber is a required field
  3078. OldSubscriber *Subscriber `type:"structure" required:"true"`
  3079. }
  3080. // String returns the string representation
  3081. func (s UpdateSubscriberInput) String() string {
  3082. return awsutil.Prettify(s)
  3083. }
  3084. // GoString returns the string representation
  3085. func (s UpdateSubscriberInput) GoString() string {
  3086. return s.String()
  3087. }
  3088. // Validate inspects the fields of the type to determine if they are valid.
  3089. func (s *UpdateSubscriberInput) Validate() error {
  3090. invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriberInput"}
  3091. if s.AccountId == nil {
  3092. invalidParams.Add(request.NewErrParamRequired("AccountId"))
  3093. }
  3094. if s.AccountId != nil && len(*s.AccountId) < 12 {
  3095. invalidParams.Add(request.NewErrParamMinLen("AccountId", 12))
  3096. }
  3097. if s.BudgetName == nil {
  3098. invalidParams.Add(request.NewErrParamRequired("BudgetName"))
  3099. }
  3100. if s.BudgetName != nil && len(*s.BudgetName) < 1 {
  3101. invalidParams.Add(request.NewErrParamMinLen("BudgetName", 1))
  3102. }
  3103. if s.NewSubscriber == nil {
  3104. invalidParams.Add(request.NewErrParamRequired("NewSubscriber"))
  3105. }
  3106. if s.Notification == nil {
  3107. invalidParams.Add(request.NewErrParamRequired("Notification"))
  3108. }
  3109. if s.OldSubscriber == nil {
  3110. invalidParams.Add(request.NewErrParamRequired("OldSubscriber"))
  3111. }
  3112. if s.NewSubscriber != nil {
  3113. if err := s.NewSubscriber.Validate(); err != nil {
  3114. invalidParams.AddNested("NewSubscriber", err.(request.ErrInvalidParams))
  3115. }
  3116. }
  3117. if s.Notification != nil {
  3118. if err := s.Notification.Validate(); err != nil {
  3119. invalidParams.AddNested("Notification", err.(request.ErrInvalidParams))
  3120. }
  3121. }
  3122. if s.OldSubscriber != nil {
  3123. if err := s.OldSubscriber.Validate(); err != nil {
  3124. invalidParams.AddNested("OldSubscriber", err.(request.ErrInvalidParams))
  3125. }
  3126. }
  3127. if invalidParams.Len() > 0 {
  3128. return invalidParams
  3129. }
  3130. return nil
  3131. }
  3132. // SetAccountId sets the AccountId field's value.
  3133. func (s *UpdateSubscriberInput) SetAccountId(v string) *UpdateSubscriberInput {
  3134. s.AccountId = &v
  3135. return s
  3136. }
  3137. // SetBudgetName sets the BudgetName field's value.
  3138. func (s *UpdateSubscriberInput) SetBudgetName(v string) *UpdateSubscriberInput {
  3139. s.BudgetName = &v
  3140. return s
  3141. }
  3142. // SetNewSubscriber sets the NewSubscriber field's value.
  3143. func (s *UpdateSubscriberInput) SetNewSubscriber(v *Subscriber) *UpdateSubscriberInput {
  3144. s.NewSubscriber = v
  3145. return s
  3146. }
  3147. // SetNotification sets the Notification field's value.
  3148. func (s *UpdateSubscriberInput) SetNotification(v *Notification) *UpdateSubscriberInput {
  3149. s.Notification = v
  3150. return s
  3151. }
  3152. // SetOldSubscriber sets the OldSubscriber field's value.
  3153. func (s *UpdateSubscriberInput) SetOldSubscriber(v *Subscriber) *UpdateSubscriberInput {
  3154. s.OldSubscriber = v
  3155. return s
  3156. }
  3157. // Response of UpdateSubscriber
  3158. type UpdateSubscriberOutput struct {
  3159. _ struct{} `type:"structure"`
  3160. }
  3161. // String returns the string representation
  3162. func (s UpdateSubscriberOutput) String() string {
  3163. return awsutil.Prettify(s)
  3164. }
  3165. // GoString returns the string representation
  3166. func (s UpdateSubscriberOutput) GoString() string {
  3167. return s.String()
  3168. }
  3169. // The type of a budget. It must be one of the following types:
  3170. //
  3171. // COST, USAGE, RI_UTILIZATION, or RI_COVERAGE.
  3172. const (
  3173. // BudgetTypeUsage is a BudgetType enum value
  3174. BudgetTypeUsage = "USAGE"
  3175. // BudgetTypeCost is a BudgetType enum value
  3176. BudgetTypeCost = "COST"
  3177. // BudgetTypeRiUtilization is a BudgetType enum value
  3178. BudgetTypeRiUtilization = "RI_UTILIZATION"
  3179. // BudgetTypeRiCoverage is a BudgetType enum value
  3180. BudgetTypeRiCoverage = "RI_COVERAGE"
  3181. )
  3182. // The comparison operator of a notification. Currently the service supports
  3183. // the following operators:
  3184. //
  3185. // GREATER_THAN, LESS_THAN, EQUAL_TO
  3186. const (
  3187. // ComparisonOperatorGreaterThan is a ComparisonOperator enum value
  3188. ComparisonOperatorGreaterThan = "GREATER_THAN"
  3189. // ComparisonOperatorLessThan is a ComparisonOperator enum value
  3190. ComparisonOperatorLessThan = "LESS_THAN"
  3191. // ComparisonOperatorEqualTo is a ComparisonOperator enum value
  3192. ComparisonOperatorEqualTo = "EQUAL_TO"
  3193. )
  3194. const (
  3195. // NotificationStateOk is a NotificationState enum value
  3196. NotificationStateOk = "OK"
  3197. // NotificationStateAlarm is a NotificationState enum value
  3198. NotificationStateAlarm = "ALARM"
  3199. )
  3200. // The type of a notification. It must be ACTUAL or FORECASTED.
  3201. const (
  3202. // NotificationTypeActual is a NotificationType enum value
  3203. NotificationTypeActual = "ACTUAL"
  3204. // NotificationTypeForecasted is a NotificationType enum value
  3205. NotificationTypeForecasted = "FORECASTED"
  3206. )
  3207. // The subscription type of the subscriber. It can be SMS or EMAIL.
  3208. const (
  3209. // SubscriptionTypeSns is a SubscriptionType enum value
  3210. SubscriptionTypeSns = "SNS"
  3211. // SubscriptionTypeEmail is a SubscriptionType enum value
  3212. SubscriptionTypeEmail = "EMAIL"
  3213. )
  3214. // The type of threshold for a notification. It can be PERCENTAGE or ABSOLUTE_VALUE.
  3215. const (
  3216. // ThresholdTypePercentage is a ThresholdType enum value
  3217. ThresholdTypePercentage = "PERCENTAGE"
  3218. // ThresholdTypeAbsoluteValue is a ThresholdType enum value
  3219. ThresholdTypeAbsoluteValue = "ABSOLUTE_VALUE"
  3220. )
  3221. // The time unit of the budget, such as MONTHLY or QUARTERLY.
  3222. const (
  3223. // TimeUnitDaily is a TimeUnit enum value
  3224. TimeUnitDaily = "DAILY"
  3225. // TimeUnitMonthly is a TimeUnit enum value
  3226. TimeUnitMonthly = "MONTHLY"
  3227. // TimeUnitQuarterly is a TimeUnit enum value
  3228. TimeUnitQuarterly = "QUARTERLY"
  3229. // TimeUnitAnnually is a TimeUnit enum value
  3230. TimeUnitAnnually = "ANNUALLY"
  3231. )