api.go 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package pricing
  3. import (
  4. "fmt"
  5. "github.com/aws/aws-sdk-go/aws"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. )
  9. const opDescribeServices = "DescribeServices"
  10. // DescribeServicesRequest generates a "aws/request.Request" representing the
  11. // client's request for the DescribeServices operation. The "output" return
  12. // value will be populated with the request's response once the request completes
  13. // successfully.
  14. //
  15. // Use "Send" method on the returned Request to send the API call to the service.
  16. // the "output" return value is not valid until after Send returns without error.
  17. //
  18. // See DescribeServices for more information on using the DescribeServices
  19. // API call, and error handling.
  20. //
  21. // This method is useful when you want to inject custom logic or configuration
  22. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  23. //
  24. //
  25. // // Example sending a request using the DescribeServicesRequest method.
  26. // req, resp := client.DescribeServicesRequest(params)
  27. //
  28. // err := req.Send()
  29. // if err == nil { // resp is now filled
  30. // fmt.Println(resp)
  31. // }
  32. //
  33. // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices
  34. func (c *Pricing) DescribeServicesRequest(input *DescribeServicesInput) (req *request.Request, output *DescribeServicesOutput) {
  35. op := &request.Operation{
  36. Name: opDescribeServices,
  37. HTTPMethod: "POST",
  38. HTTPPath: "/",
  39. Paginator: &request.Paginator{
  40. InputTokens: []string{"NextToken"},
  41. OutputTokens: []string{"NextToken"},
  42. LimitToken: "MaxResults",
  43. TruncationToken: "",
  44. },
  45. }
  46. if input == nil {
  47. input = &DescribeServicesInput{}
  48. }
  49. output = &DescribeServicesOutput{}
  50. req = c.newRequest(op, input, output)
  51. return
  52. }
  53. // DescribeServices API operation for AWS Price List Service.
  54. //
  55. // Returns the metadata for one service or a list of the metadata for all services.
  56. // Use this without a service code to get the service codes for all services.
  57. // Use it with a service code, such as AmazonEC2, to get information specific
  58. // to that service, such as the attribute names available for that service.
  59. // For example, some of the attribute names available for EC2 are volumeType,
  60. // maxIopsVolume, operation, locationType, and instanceCapacity10xlarge.
  61. //
  62. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  63. // with awserr.Error's Code and Message methods to get detailed information about
  64. // the error.
  65. //
  66. // See the AWS API reference guide for AWS Price List Service's
  67. // API operation DescribeServices for usage and error information.
  68. //
  69. // Returned Error Codes:
  70. // * ErrCodeInternalErrorException "InternalErrorException"
  71. // An error on the server occurred during the processing of your request. Try
  72. // again later.
  73. //
  74. // * ErrCodeInvalidParameterException "InvalidParameterException"
  75. // One or more parameters had an invalid value.
  76. //
  77. // * ErrCodeNotFoundException "NotFoundException"
  78. // The requested resource can't be found.
  79. //
  80. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  81. // The pagination token is invalid. Try again without a pagination token.
  82. //
  83. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  84. // The pagination token expired. Try again without a pagination token.
  85. //
  86. // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices
  87. func (c *Pricing) DescribeServices(input *DescribeServicesInput) (*DescribeServicesOutput, error) {
  88. req, out := c.DescribeServicesRequest(input)
  89. return out, req.Send()
  90. }
  91. // DescribeServicesWithContext is the same as DescribeServices with the addition of
  92. // the ability to pass a context and additional request options.
  93. //
  94. // See DescribeServices for details on how to use this API operation.
  95. //
  96. // The context must be non-nil and will be used for request cancellation. If
  97. // the context is nil a panic will occur. In the future the SDK may create
  98. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  99. // for more information on using Contexts.
  100. func (c *Pricing) DescribeServicesWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.Option) (*DescribeServicesOutput, error) {
  101. req, out := c.DescribeServicesRequest(input)
  102. req.SetContext(ctx)
  103. req.ApplyOptions(opts...)
  104. return out, req.Send()
  105. }
  106. // DescribeServicesPages iterates over the pages of a DescribeServices operation,
  107. // calling the "fn" function with the response data for each page. To stop
  108. // iterating, return false from the fn function.
  109. //
  110. // See DescribeServices method for more information on how to use this operation.
  111. //
  112. // Note: This operation can generate multiple requests to a service.
  113. //
  114. // // Example iterating over at most 3 pages of a DescribeServices operation.
  115. // pageNum := 0
  116. // err := client.DescribeServicesPages(params,
  117. // func(page *DescribeServicesOutput, lastPage bool) bool {
  118. // pageNum++
  119. // fmt.Println(page)
  120. // return pageNum <= 3
  121. // })
  122. //
  123. func (c *Pricing) DescribeServicesPages(input *DescribeServicesInput, fn func(*DescribeServicesOutput, bool) bool) error {
  124. return c.DescribeServicesPagesWithContext(aws.BackgroundContext(), input, fn)
  125. }
  126. // DescribeServicesPagesWithContext same as DescribeServicesPages except
  127. // it takes a Context and allows setting request options on the pages.
  128. //
  129. // The context must be non-nil and will be used for request cancellation. If
  130. // the context is nil a panic will occur. In the future the SDK may create
  131. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  132. // for more information on using Contexts.
  133. func (c *Pricing) DescribeServicesPagesWithContext(ctx aws.Context, input *DescribeServicesInput, fn func(*DescribeServicesOutput, bool) bool, opts ...request.Option) error {
  134. p := request.Pagination{
  135. NewRequest: func() (*request.Request, error) {
  136. var inCpy *DescribeServicesInput
  137. if input != nil {
  138. tmp := *input
  139. inCpy = &tmp
  140. }
  141. req, _ := c.DescribeServicesRequest(inCpy)
  142. req.SetContext(ctx)
  143. req.ApplyOptions(opts...)
  144. return req, nil
  145. },
  146. }
  147. cont := true
  148. for p.Next() && cont {
  149. cont = fn(p.Page().(*DescribeServicesOutput), !p.HasNextPage())
  150. }
  151. return p.Err()
  152. }
  153. const opGetAttributeValues = "GetAttributeValues"
  154. // GetAttributeValuesRequest generates a "aws/request.Request" representing the
  155. // client's request for the GetAttributeValues operation. The "output" return
  156. // value will be populated with the request's response once the request completes
  157. // successfully.
  158. //
  159. // Use "Send" method on the returned Request to send the API call to the service.
  160. // the "output" return value is not valid until after Send returns without error.
  161. //
  162. // See GetAttributeValues for more information on using the GetAttributeValues
  163. // API call, and error handling.
  164. //
  165. // This method is useful when you want to inject custom logic or configuration
  166. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  167. //
  168. //
  169. // // Example sending a request using the GetAttributeValuesRequest method.
  170. // req, resp := client.GetAttributeValuesRequest(params)
  171. //
  172. // err := req.Send()
  173. // if err == nil { // resp is now filled
  174. // fmt.Println(resp)
  175. // }
  176. //
  177. // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues
  178. func (c *Pricing) GetAttributeValuesRequest(input *GetAttributeValuesInput) (req *request.Request, output *GetAttributeValuesOutput) {
  179. op := &request.Operation{
  180. Name: opGetAttributeValues,
  181. HTTPMethod: "POST",
  182. HTTPPath: "/",
  183. Paginator: &request.Paginator{
  184. InputTokens: []string{"NextToken"},
  185. OutputTokens: []string{"NextToken"},
  186. LimitToken: "MaxResults",
  187. TruncationToken: "",
  188. },
  189. }
  190. if input == nil {
  191. input = &GetAttributeValuesInput{}
  192. }
  193. output = &GetAttributeValuesOutput{}
  194. req = c.newRequest(op, input, output)
  195. return
  196. }
  197. // GetAttributeValues API operation for AWS Price List Service.
  198. //
  199. // Returns a list of attribute values. Attibutes are similar to the details
  200. // in a Price List API offer file. For a list of available attributes, see Offer
  201. // File Definitions (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs)
  202. // in the AWS Billing and Cost Management User Guide (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html).
  203. //
  204. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  205. // with awserr.Error's Code and Message methods to get detailed information about
  206. // the error.
  207. //
  208. // See the AWS API reference guide for AWS Price List Service's
  209. // API operation GetAttributeValues for usage and error information.
  210. //
  211. // Returned Error Codes:
  212. // * ErrCodeInternalErrorException "InternalErrorException"
  213. // An error on the server occurred during the processing of your request. Try
  214. // again later.
  215. //
  216. // * ErrCodeInvalidParameterException "InvalidParameterException"
  217. // One or more parameters had an invalid value.
  218. //
  219. // * ErrCodeNotFoundException "NotFoundException"
  220. // The requested resource can't be found.
  221. //
  222. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  223. // The pagination token is invalid. Try again without a pagination token.
  224. //
  225. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  226. // The pagination token expired. Try again without a pagination token.
  227. //
  228. // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues
  229. func (c *Pricing) GetAttributeValues(input *GetAttributeValuesInput) (*GetAttributeValuesOutput, error) {
  230. req, out := c.GetAttributeValuesRequest(input)
  231. return out, req.Send()
  232. }
  233. // GetAttributeValuesWithContext is the same as GetAttributeValues with the addition of
  234. // the ability to pass a context and additional request options.
  235. //
  236. // See GetAttributeValues for details on how to use this API operation.
  237. //
  238. // The context must be non-nil and will be used for request cancellation. If
  239. // the context is nil a panic will occur. In the future the SDK may create
  240. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  241. // for more information on using Contexts.
  242. func (c *Pricing) GetAttributeValuesWithContext(ctx aws.Context, input *GetAttributeValuesInput, opts ...request.Option) (*GetAttributeValuesOutput, error) {
  243. req, out := c.GetAttributeValuesRequest(input)
  244. req.SetContext(ctx)
  245. req.ApplyOptions(opts...)
  246. return out, req.Send()
  247. }
  248. // GetAttributeValuesPages iterates over the pages of a GetAttributeValues operation,
  249. // calling the "fn" function with the response data for each page. To stop
  250. // iterating, return false from the fn function.
  251. //
  252. // See GetAttributeValues method for more information on how to use this operation.
  253. //
  254. // Note: This operation can generate multiple requests to a service.
  255. //
  256. // // Example iterating over at most 3 pages of a GetAttributeValues operation.
  257. // pageNum := 0
  258. // err := client.GetAttributeValuesPages(params,
  259. // func(page *GetAttributeValuesOutput, lastPage bool) bool {
  260. // pageNum++
  261. // fmt.Println(page)
  262. // return pageNum <= 3
  263. // })
  264. //
  265. func (c *Pricing) GetAttributeValuesPages(input *GetAttributeValuesInput, fn func(*GetAttributeValuesOutput, bool) bool) error {
  266. return c.GetAttributeValuesPagesWithContext(aws.BackgroundContext(), input, fn)
  267. }
  268. // GetAttributeValuesPagesWithContext same as GetAttributeValuesPages except
  269. // it takes a Context and allows setting request options on the pages.
  270. //
  271. // The context must be non-nil and will be used for request cancellation. If
  272. // the context is nil a panic will occur. In the future the SDK may create
  273. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  274. // for more information on using Contexts.
  275. func (c *Pricing) GetAttributeValuesPagesWithContext(ctx aws.Context, input *GetAttributeValuesInput, fn func(*GetAttributeValuesOutput, bool) bool, opts ...request.Option) error {
  276. p := request.Pagination{
  277. NewRequest: func() (*request.Request, error) {
  278. var inCpy *GetAttributeValuesInput
  279. if input != nil {
  280. tmp := *input
  281. inCpy = &tmp
  282. }
  283. req, _ := c.GetAttributeValuesRequest(inCpy)
  284. req.SetContext(ctx)
  285. req.ApplyOptions(opts...)
  286. return req, nil
  287. },
  288. }
  289. cont := true
  290. for p.Next() && cont {
  291. cont = fn(p.Page().(*GetAttributeValuesOutput), !p.HasNextPage())
  292. }
  293. return p.Err()
  294. }
  295. const opGetProducts = "GetProducts"
  296. // GetProductsRequest generates a "aws/request.Request" representing the
  297. // client's request for the GetProducts operation. The "output" return
  298. // value will be populated with the request's response once the request completes
  299. // successfully.
  300. //
  301. // Use "Send" method on the returned Request to send the API call to the service.
  302. // the "output" return value is not valid until after Send returns without error.
  303. //
  304. // See GetProducts for more information on using the GetProducts
  305. // API call, and error handling.
  306. //
  307. // This method is useful when you want to inject custom logic or configuration
  308. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  309. //
  310. //
  311. // // Example sending a request using the GetProductsRequest method.
  312. // req, resp := client.GetProductsRequest(params)
  313. //
  314. // err := req.Send()
  315. // if err == nil { // resp is now filled
  316. // fmt.Println(resp)
  317. // }
  318. //
  319. // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts
  320. func (c *Pricing) GetProductsRequest(input *GetProductsInput) (req *request.Request, output *GetProductsOutput) {
  321. op := &request.Operation{
  322. Name: opGetProducts,
  323. HTTPMethod: "POST",
  324. HTTPPath: "/",
  325. Paginator: &request.Paginator{
  326. InputTokens: []string{"NextToken"},
  327. OutputTokens: []string{"NextToken"},
  328. LimitToken: "MaxResults",
  329. TruncationToken: "",
  330. },
  331. }
  332. if input == nil {
  333. input = &GetProductsInput{}
  334. }
  335. output = &GetProductsOutput{}
  336. req = c.newRequest(op, input, output)
  337. return
  338. }
  339. // GetProducts API operation for AWS Price List Service.
  340. //
  341. // Returns a list of all products that match the filter criteria.
  342. //
  343. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  344. // with awserr.Error's Code and Message methods to get detailed information about
  345. // the error.
  346. //
  347. // See the AWS API reference guide for AWS Price List Service's
  348. // API operation GetProducts for usage and error information.
  349. //
  350. // Returned Error Codes:
  351. // * ErrCodeInternalErrorException "InternalErrorException"
  352. // An error on the server occurred during the processing of your request. Try
  353. // again later.
  354. //
  355. // * ErrCodeInvalidParameterException "InvalidParameterException"
  356. // One or more parameters had an invalid value.
  357. //
  358. // * ErrCodeNotFoundException "NotFoundException"
  359. // The requested resource can't be found.
  360. //
  361. // * ErrCodeInvalidNextTokenException "InvalidNextTokenException"
  362. // The pagination token is invalid. Try again without a pagination token.
  363. //
  364. // * ErrCodeExpiredNextTokenException "ExpiredNextTokenException"
  365. // The pagination token expired. Try again without a pagination token.
  366. //
  367. // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts
  368. func (c *Pricing) GetProducts(input *GetProductsInput) (*GetProductsOutput, error) {
  369. req, out := c.GetProductsRequest(input)
  370. return out, req.Send()
  371. }
  372. // GetProductsWithContext is the same as GetProducts with the addition of
  373. // the ability to pass a context and additional request options.
  374. //
  375. // See GetProducts for details on how to use this API operation.
  376. //
  377. // The context must be non-nil and will be used for request cancellation. If
  378. // the context is nil a panic will occur. In the future the SDK may create
  379. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  380. // for more information on using Contexts.
  381. func (c *Pricing) GetProductsWithContext(ctx aws.Context, input *GetProductsInput, opts ...request.Option) (*GetProductsOutput, error) {
  382. req, out := c.GetProductsRequest(input)
  383. req.SetContext(ctx)
  384. req.ApplyOptions(opts...)
  385. return out, req.Send()
  386. }
  387. // GetProductsPages iterates over the pages of a GetProducts operation,
  388. // calling the "fn" function with the response data for each page. To stop
  389. // iterating, return false from the fn function.
  390. //
  391. // See GetProducts method for more information on how to use this operation.
  392. //
  393. // Note: This operation can generate multiple requests to a service.
  394. //
  395. // // Example iterating over at most 3 pages of a GetProducts operation.
  396. // pageNum := 0
  397. // err := client.GetProductsPages(params,
  398. // func(page *GetProductsOutput, lastPage bool) bool {
  399. // pageNum++
  400. // fmt.Println(page)
  401. // return pageNum <= 3
  402. // })
  403. //
  404. func (c *Pricing) GetProductsPages(input *GetProductsInput, fn func(*GetProductsOutput, bool) bool) error {
  405. return c.GetProductsPagesWithContext(aws.BackgroundContext(), input, fn)
  406. }
  407. // GetProductsPagesWithContext same as GetProductsPages except
  408. // it takes a Context and allows setting request options on the pages.
  409. //
  410. // The context must be non-nil and will be used for request cancellation. If
  411. // the context is nil a panic will occur. In the future the SDK may create
  412. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  413. // for more information on using Contexts.
  414. func (c *Pricing) GetProductsPagesWithContext(ctx aws.Context, input *GetProductsInput, fn func(*GetProductsOutput, bool) bool, opts ...request.Option) error {
  415. p := request.Pagination{
  416. NewRequest: func() (*request.Request, error) {
  417. var inCpy *GetProductsInput
  418. if input != nil {
  419. tmp := *input
  420. inCpy = &tmp
  421. }
  422. req, _ := c.GetProductsRequest(inCpy)
  423. req.SetContext(ctx)
  424. req.ApplyOptions(opts...)
  425. return req, nil
  426. },
  427. }
  428. cont := true
  429. for p.Next() && cont {
  430. cont = fn(p.Page().(*GetProductsOutput), !p.HasNextPage())
  431. }
  432. return p.Err()
  433. }
  434. // The values of a given attribute, such as Throughput Optimized HDD or Provisioned
  435. // IOPS for the Amazon EC2volumeType attribute.
  436. type AttributeValue struct {
  437. _ struct{} `type:"structure"`
  438. // The specific value of an attributeName.
  439. Value *string `type:"string"`
  440. }
  441. // String returns the string representation
  442. func (s AttributeValue) String() string {
  443. return awsutil.Prettify(s)
  444. }
  445. // GoString returns the string representation
  446. func (s AttributeValue) GoString() string {
  447. return s.String()
  448. }
  449. // SetValue sets the Value field's value.
  450. func (s *AttributeValue) SetValue(v string) *AttributeValue {
  451. s.Value = &v
  452. return s
  453. }
  454. type DescribeServicesInput struct {
  455. _ struct{} `type:"structure"`
  456. // The format version that you want the response to be in.
  457. //
  458. // Valid values are: aws_v1
  459. FormatVersion *string `type:"string"`
  460. // The maximum number of results that you want returned in the response.
  461. MaxResults *int64 `min:"1" type:"integer"`
  462. // The pagination token that indicates the next set of results that you want
  463. // to retrieve.
  464. NextToken *string `type:"string"`
  465. // The code for the service whose information you want to retrieve, such as
  466. // AmazonEC2. You can use the ServiceCode to filter the results in a GetProducts
  467. // call. To retrieve a list of all services, leave this blank.
  468. ServiceCode *string `type:"string"`
  469. }
  470. // String returns the string representation
  471. func (s DescribeServicesInput) String() string {
  472. return awsutil.Prettify(s)
  473. }
  474. // GoString returns the string representation
  475. func (s DescribeServicesInput) GoString() string {
  476. return s.String()
  477. }
  478. // Validate inspects the fields of the type to determine if they are valid.
  479. func (s *DescribeServicesInput) Validate() error {
  480. invalidParams := request.ErrInvalidParams{Context: "DescribeServicesInput"}
  481. if s.MaxResults != nil && *s.MaxResults < 1 {
  482. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  483. }
  484. if invalidParams.Len() > 0 {
  485. return invalidParams
  486. }
  487. return nil
  488. }
  489. // SetFormatVersion sets the FormatVersion field's value.
  490. func (s *DescribeServicesInput) SetFormatVersion(v string) *DescribeServicesInput {
  491. s.FormatVersion = &v
  492. return s
  493. }
  494. // SetMaxResults sets the MaxResults field's value.
  495. func (s *DescribeServicesInput) SetMaxResults(v int64) *DescribeServicesInput {
  496. s.MaxResults = &v
  497. return s
  498. }
  499. // SetNextToken sets the NextToken field's value.
  500. func (s *DescribeServicesInput) SetNextToken(v string) *DescribeServicesInput {
  501. s.NextToken = &v
  502. return s
  503. }
  504. // SetServiceCode sets the ServiceCode field's value.
  505. func (s *DescribeServicesInput) SetServiceCode(v string) *DescribeServicesInput {
  506. s.ServiceCode = &v
  507. return s
  508. }
  509. type DescribeServicesOutput struct {
  510. _ struct{} `type:"structure"`
  511. // The format version of the response. For example, aws_v1.
  512. FormatVersion *string `type:"string"`
  513. // The pagination token for the next set of retreivable results.
  514. NextToken *string `type:"string"`
  515. // The service metadata for the service or services in the response.
  516. Services []*Service `type:"list"`
  517. }
  518. // String returns the string representation
  519. func (s DescribeServicesOutput) String() string {
  520. return awsutil.Prettify(s)
  521. }
  522. // GoString returns the string representation
  523. func (s DescribeServicesOutput) GoString() string {
  524. return s.String()
  525. }
  526. // SetFormatVersion sets the FormatVersion field's value.
  527. func (s *DescribeServicesOutput) SetFormatVersion(v string) *DescribeServicesOutput {
  528. s.FormatVersion = &v
  529. return s
  530. }
  531. // SetNextToken sets the NextToken field's value.
  532. func (s *DescribeServicesOutput) SetNextToken(v string) *DescribeServicesOutput {
  533. s.NextToken = &v
  534. return s
  535. }
  536. // SetServices sets the Services field's value.
  537. func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutput {
  538. s.Services = v
  539. return s
  540. }
  541. // The constraints that you want all returned products to match.
  542. type Filter struct {
  543. _ struct{} `type:"structure"`
  544. // The product metadata field that you want to filter on. You can filter by
  545. // just the service code to see all products for a specific service, filter
  546. // by just the attribute name to see a specific attribute for multiple services,
  547. // or use both a service code and an attribute name to retrieve only products
  548. // that match both fields.
  549. //
  550. // Valid values include: ServiceCode, and all attribute names
  551. //
  552. // For example, you can filter by the AmazonEC2 service code and the volumeType
  553. // attribute name to get the prices for only Amazon EC2 volumes.
  554. //
  555. // Field is a required field
  556. Field *string `type:"string" required:"true"`
  557. // The type of filter that you want to use.
  558. //
  559. // Valid values are: TERM_MATCH. TERM_MATCH returns only products that match
  560. // both the given filter field and the given value.
  561. //
  562. // Type is a required field
  563. Type *string `type:"string" required:"true" enum:"FilterType"`
  564. // The service code or attribute value that you want to filter by. If you are
  565. // filtering by service code this is the actual service code, such as AmazonEC2.
  566. // If you are filtering by attribute name, this is the attribute value that
  567. // you want the returned products to match, such as a Provisioned IOPS volume.
  568. //
  569. // Value is a required field
  570. Value *string `type:"string" required:"true"`
  571. }
  572. // String returns the string representation
  573. func (s Filter) String() string {
  574. return awsutil.Prettify(s)
  575. }
  576. // GoString returns the string representation
  577. func (s Filter) GoString() string {
  578. return s.String()
  579. }
  580. // Validate inspects the fields of the type to determine if they are valid.
  581. func (s *Filter) Validate() error {
  582. invalidParams := request.ErrInvalidParams{Context: "Filter"}
  583. if s.Field == nil {
  584. invalidParams.Add(request.NewErrParamRequired("Field"))
  585. }
  586. if s.Type == nil {
  587. invalidParams.Add(request.NewErrParamRequired("Type"))
  588. }
  589. if s.Value == nil {
  590. invalidParams.Add(request.NewErrParamRequired("Value"))
  591. }
  592. if invalidParams.Len() > 0 {
  593. return invalidParams
  594. }
  595. return nil
  596. }
  597. // SetField sets the Field field's value.
  598. func (s *Filter) SetField(v string) *Filter {
  599. s.Field = &v
  600. return s
  601. }
  602. // SetType sets the Type field's value.
  603. func (s *Filter) SetType(v string) *Filter {
  604. s.Type = &v
  605. return s
  606. }
  607. // SetValue sets the Value field's value.
  608. func (s *Filter) SetValue(v string) *Filter {
  609. s.Value = &v
  610. return s
  611. }
  612. type GetAttributeValuesInput struct {
  613. _ struct{} `type:"structure"`
  614. // The name of the attribute that you want to retrieve the values for, such
  615. // as volumeType.
  616. //
  617. // AttributeName is a required field
  618. AttributeName *string `type:"string" required:"true"`
  619. // The maximum number of results to return in response.
  620. MaxResults *int64 `min:"1" type:"integer"`
  621. // The pagination token that indicates the next set of results that you want
  622. // to retrieve.
  623. NextToken *string `type:"string"`
  624. // The service code for the service whose attributes you want to retrieve. For
  625. // example, if you want the retrieve an EC2 attribute, use AmazonEC2.
  626. //
  627. // ServiceCode is a required field
  628. ServiceCode *string `type:"string" required:"true"`
  629. }
  630. // String returns the string representation
  631. func (s GetAttributeValuesInput) String() string {
  632. return awsutil.Prettify(s)
  633. }
  634. // GoString returns the string representation
  635. func (s GetAttributeValuesInput) GoString() string {
  636. return s.String()
  637. }
  638. // Validate inspects the fields of the type to determine if they are valid.
  639. func (s *GetAttributeValuesInput) Validate() error {
  640. invalidParams := request.ErrInvalidParams{Context: "GetAttributeValuesInput"}
  641. if s.AttributeName == nil {
  642. invalidParams.Add(request.NewErrParamRequired("AttributeName"))
  643. }
  644. if s.MaxResults != nil && *s.MaxResults < 1 {
  645. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  646. }
  647. if s.ServiceCode == nil {
  648. invalidParams.Add(request.NewErrParamRequired("ServiceCode"))
  649. }
  650. if invalidParams.Len() > 0 {
  651. return invalidParams
  652. }
  653. return nil
  654. }
  655. // SetAttributeName sets the AttributeName field's value.
  656. func (s *GetAttributeValuesInput) SetAttributeName(v string) *GetAttributeValuesInput {
  657. s.AttributeName = &v
  658. return s
  659. }
  660. // SetMaxResults sets the MaxResults field's value.
  661. func (s *GetAttributeValuesInput) SetMaxResults(v int64) *GetAttributeValuesInput {
  662. s.MaxResults = &v
  663. return s
  664. }
  665. // SetNextToken sets the NextToken field's value.
  666. func (s *GetAttributeValuesInput) SetNextToken(v string) *GetAttributeValuesInput {
  667. s.NextToken = &v
  668. return s
  669. }
  670. // SetServiceCode sets the ServiceCode field's value.
  671. func (s *GetAttributeValuesInput) SetServiceCode(v string) *GetAttributeValuesInput {
  672. s.ServiceCode = &v
  673. return s
  674. }
  675. type GetAttributeValuesOutput struct {
  676. _ struct{} `type:"structure"`
  677. // The list of values for an attribute. For example, Throughput Optimized HDD
  678. // and Provisioned IOPS are two available values for the AmazonEC2volumeType.
  679. AttributeValues []*AttributeValue `type:"list"`
  680. // The pagination token that indicates the next set of results to retrieve.
  681. NextToken *string `type:"string"`
  682. }
  683. // String returns the string representation
  684. func (s GetAttributeValuesOutput) String() string {
  685. return awsutil.Prettify(s)
  686. }
  687. // GoString returns the string representation
  688. func (s GetAttributeValuesOutput) GoString() string {
  689. return s.String()
  690. }
  691. // SetAttributeValues sets the AttributeValues field's value.
  692. func (s *GetAttributeValuesOutput) SetAttributeValues(v []*AttributeValue) *GetAttributeValuesOutput {
  693. s.AttributeValues = v
  694. return s
  695. }
  696. // SetNextToken sets the NextToken field's value.
  697. func (s *GetAttributeValuesOutput) SetNextToken(v string) *GetAttributeValuesOutput {
  698. s.NextToken = &v
  699. return s
  700. }
  701. type GetProductsInput struct {
  702. _ struct{} `type:"structure"`
  703. // The list of filters that limit the returned products. only products that
  704. // match all filters are returned.
  705. Filters []*Filter `type:"list"`
  706. // The format version that you want the response to be in.
  707. //
  708. // Valid values are: aws_v1
  709. FormatVersion *string `type:"string"`
  710. // The maximum number of results to return in the response.
  711. MaxResults *int64 `min:"1" type:"integer"`
  712. // The pagination token that indicates the next set of results that you want
  713. // to retrieve.
  714. NextToken *string `type:"string"`
  715. // The code for the service whose products you want to retrieve.
  716. ServiceCode *string `type:"string"`
  717. }
  718. // String returns the string representation
  719. func (s GetProductsInput) String() string {
  720. return awsutil.Prettify(s)
  721. }
  722. // GoString returns the string representation
  723. func (s GetProductsInput) GoString() string {
  724. return s.String()
  725. }
  726. // Validate inspects the fields of the type to determine if they are valid.
  727. func (s *GetProductsInput) Validate() error {
  728. invalidParams := request.ErrInvalidParams{Context: "GetProductsInput"}
  729. if s.MaxResults != nil && *s.MaxResults < 1 {
  730. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  731. }
  732. if s.Filters != nil {
  733. for i, v := range s.Filters {
  734. if v == nil {
  735. continue
  736. }
  737. if err := v.Validate(); err != nil {
  738. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams))
  739. }
  740. }
  741. }
  742. if invalidParams.Len() > 0 {
  743. return invalidParams
  744. }
  745. return nil
  746. }
  747. // SetFilters sets the Filters field's value.
  748. func (s *GetProductsInput) SetFilters(v []*Filter) *GetProductsInput {
  749. s.Filters = v
  750. return s
  751. }
  752. // SetFormatVersion sets the FormatVersion field's value.
  753. func (s *GetProductsInput) SetFormatVersion(v string) *GetProductsInput {
  754. s.FormatVersion = &v
  755. return s
  756. }
  757. // SetMaxResults sets the MaxResults field's value.
  758. func (s *GetProductsInput) SetMaxResults(v int64) *GetProductsInput {
  759. s.MaxResults = &v
  760. return s
  761. }
  762. // SetNextToken sets the NextToken field's value.
  763. func (s *GetProductsInput) SetNextToken(v string) *GetProductsInput {
  764. s.NextToken = &v
  765. return s
  766. }
  767. // SetServiceCode sets the ServiceCode field's value.
  768. func (s *GetProductsInput) SetServiceCode(v string) *GetProductsInput {
  769. s.ServiceCode = &v
  770. return s
  771. }
  772. type GetProductsOutput struct {
  773. _ struct{} `type:"structure"`
  774. // The format version of the response. For example, aws_v1.
  775. FormatVersion *string `type:"string"`
  776. // The pagination token that indicates the next set of results to retrieve.
  777. NextToken *string `type:"string"`
  778. // The list of products that match your filters. The list contains both the
  779. // product metadata and the price information.
  780. PriceList []aws.JSONValue `type:"list"`
  781. }
  782. // String returns the string representation
  783. func (s GetProductsOutput) String() string {
  784. return awsutil.Prettify(s)
  785. }
  786. // GoString returns the string representation
  787. func (s GetProductsOutput) GoString() string {
  788. return s.String()
  789. }
  790. // SetFormatVersion sets the FormatVersion field's value.
  791. func (s *GetProductsOutput) SetFormatVersion(v string) *GetProductsOutput {
  792. s.FormatVersion = &v
  793. return s
  794. }
  795. // SetNextToken sets the NextToken field's value.
  796. func (s *GetProductsOutput) SetNextToken(v string) *GetProductsOutput {
  797. s.NextToken = &v
  798. return s
  799. }
  800. // SetPriceList sets the PriceList field's value.
  801. func (s *GetProductsOutput) SetPriceList(v []aws.JSONValue) *GetProductsOutput {
  802. s.PriceList = v
  803. return s
  804. }
  805. // The metadata for a service, such as the service code and available attribute
  806. // names.
  807. type Service struct {
  808. _ struct{} `type:"structure"`
  809. // The attributes that are available for this service.
  810. AttributeNames []*string `type:"list"`
  811. // The code for the AWS service.
  812. ServiceCode *string `type:"string"`
  813. }
  814. // String returns the string representation
  815. func (s Service) String() string {
  816. return awsutil.Prettify(s)
  817. }
  818. // GoString returns the string representation
  819. func (s Service) GoString() string {
  820. return s.String()
  821. }
  822. // SetAttributeNames sets the AttributeNames field's value.
  823. func (s *Service) SetAttributeNames(v []*string) *Service {
  824. s.AttributeNames = v
  825. return s
  826. }
  827. // SetServiceCode sets the ServiceCode field's value.
  828. func (s *Service) SetServiceCode(v string) *Service {
  829. s.ServiceCode = &v
  830. return s
  831. }
  832. const (
  833. // FilterTypeTermMatch is a FilterType enum value
  834. FilterTypeTermMatch = "TERM_MATCH"
  835. )