github.com/aavshr/aws-sdk-go@v1.41.3/service/pricing/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package pricing 4 5 import ( 6 "fmt" 7 8 "github.com/aavshr/aws-sdk-go/aws" 9 "github.com/aavshr/aws-sdk-go/aws/awsutil" 10 "github.com/aavshr/aws-sdk-go/aws/request" 11 "github.com/aavshr/aws-sdk-go/private/protocol" 12 ) 13 14 const opDescribeServices = "DescribeServices" 15 16 // DescribeServicesRequest generates a "aws/request.Request" representing the 17 // client's request for the DescribeServices operation. The "output" return 18 // value will be populated with the request's response once the request completes 19 // successfully. 20 // 21 // Use "Send" method on the returned Request to send the API call to the service. 22 // the "output" return value is not valid until after Send returns without error. 23 // 24 // See DescribeServices for more information on using the DescribeServices 25 // API call, and error handling. 26 // 27 // This method is useful when you want to inject custom logic or configuration 28 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 29 // 30 // 31 // // Example sending a request using the DescribeServicesRequest method. 32 // req, resp := client.DescribeServicesRequest(params) 33 // 34 // err := req.Send() 35 // if err == nil { // resp is now filled 36 // fmt.Println(resp) 37 // } 38 // 39 // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices 40 func (c *Pricing) DescribeServicesRequest(input *DescribeServicesInput) (req *request.Request, output *DescribeServicesOutput) { 41 op := &request.Operation{ 42 Name: opDescribeServices, 43 HTTPMethod: "POST", 44 HTTPPath: "/", 45 Paginator: &request.Paginator{ 46 InputTokens: []string{"NextToken"}, 47 OutputTokens: []string{"NextToken"}, 48 LimitToken: "MaxResults", 49 TruncationToken: "", 50 }, 51 } 52 53 if input == nil { 54 input = &DescribeServicesInput{} 55 } 56 57 output = &DescribeServicesOutput{} 58 req = c.newRequest(op, input, output) 59 return 60 } 61 62 // DescribeServices API operation for AWS Price List Service. 63 // 64 // Returns the metadata for one service or a list of the metadata for all services. 65 // Use this without a service code to get the service codes for all services. 66 // Use it with a service code, such as AmazonEC2, to get information specific 67 // to that service, such as the attribute names available for that service. 68 // For example, some of the attribute names available for EC2 are volumeType, 69 // maxIopsVolume, operation, locationType, and instanceCapacity10xlarge. 70 // 71 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 72 // with awserr.Error's Code and Message methods to get detailed information about 73 // the error. 74 // 75 // See the AWS API reference guide for AWS Price List Service's 76 // API operation DescribeServices for usage and error information. 77 // 78 // Returned Error Types: 79 // * InternalErrorException 80 // An error on the server occurred during the processing of your request. Try 81 // again later. 82 // 83 // * InvalidParameterException 84 // One or more parameters had an invalid value. 85 // 86 // * NotFoundException 87 // The requested resource can't be found. 88 // 89 // * InvalidNextTokenException 90 // The pagination token is invalid. Try again without a pagination token. 91 // 92 // * ExpiredNextTokenException 93 // The pagination token expired. Try again without a pagination token. 94 // 95 // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices 96 func (c *Pricing) DescribeServices(input *DescribeServicesInput) (*DescribeServicesOutput, error) { 97 req, out := c.DescribeServicesRequest(input) 98 return out, req.Send() 99 } 100 101 // DescribeServicesWithContext is the same as DescribeServices with the addition of 102 // the ability to pass a context and additional request options. 103 // 104 // See DescribeServices for details on how to use this API operation. 105 // 106 // The context must be non-nil and will be used for request cancellation. If 107 // the context is nil a panic will occur. In the future the SDK may create 108 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 109 // for more information on using Contexts. 110 func (c *Pricing) DescribeServicesWithContext(ctx aws.Context, input *DescribeServicesInput, opts ...request.Option) (*DescribeServicesOutput, error) { 111 req, out := c.DescribeServicesRequest(input) 112 req.SetContext(ctx) 113 req.ApplyOptions(opts...) 114 return out, req.Send() 115 } 116 117 // DescribeServicesPages iterates over the pages of a DescribeServices operation, 118 // calling the "fn" function with the response data for each page. To stop 119 // iterating, return false from the fn function. 120 // 121 // See DescribeServices method for more information on how to use this operation. 122 // 123 // Note: This operation can generate multiple requests to a service. 124 // 125 // // Example iterating over at most 3 pages of a DescribeServices operation. 126 // pageNum := 0 127 // err := client.DescribeServicesPages(params, 128 // func(page *pricing.DescribeServicesOutput, lastPage bool) bool { 129 // pageNum++ 130 // fmt.Println(page) 131 // return pageNum <= 3 132 // }) 133 // 134 func (c *Pricing) DescribeServicesPages(input *DescribeServicesInput, fn func(*DescribeServicesOutput, bool) bool) error { 135 return c.DescribeServicesPagesWithContext(aws.BackgroundContext(), input, fn) 136 } 137 138 // DescribeServicesPagesWithContext same as DescribeServicesPages except 139 // it takes a Context and allows setting request options on the pages. 140 // 141 // The context must be non-nil and will be used for request cancellation. If 142 // the context is nil a panic will occur. In the future the SDK may create 143 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 144 // for more information on using Contexts. 145 func (c *Pricing) DescribeServicesPagesWithContext(ctx aws.Context, input *DescribeServicesInput, fn func(*DescribeServicesOutput, bool) bool, opts ...request.Option) error { 146 p := request.Pagination{ 147 NewRequest: func() (*request.Request, error) { 148 var inCpy *DescribeServicesInput 149 if input != nil { 150 tmp := *input 151 inCpy = &tmp 152 } 153 req, _ := c.DescribeServicesRequest(inCpy) 154 req.SetContext(ctx) 155 req.ApplyOptions(opts...) 156 return req, nil 157 }, 158 } 159 160 for p.Next() { 161 if !fn(p.Page().(*DescribeServicesOutput), !p.HasNextPage()) { 162 break 163 } 164 } 165 166 return p.Err() 167 } 168 169 const opGetAttributeValues = "GetAttributeValues" 170 171 // GetAttributeValuesRequest generates a "aws/request.Request" representing the 172 // client's request for the GetAttributeValues operation. The "output" return 173 // value will be populated with the request's response once the request completes 174 // successfully. 175 // 176 // Use "Send" method on the returned Request to send the API call to the service. 177 // the "output" return value is not valid until after Send returns without error. 178 // 179 // See GetAttributeValues for more information on using the GetAttributeValues 180 // API call, and error handling. 181 // 182 // This method is useful when you want to inject custom logic or configuration 183 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 184 // 185 // 186 // // Example sending a request using the GetAttributeValuesRequest method. 187 // req, resp := client.GetAttributeValuesRequest(params) 188 // 189 // err := req.Send() 190 // if err == nil { // resp is now filled 191 // fmt.Println(resp) 192 // } 193 // 194 // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues 195 func (c *Pricing) GetAttributeValuesRequest(input *GetAttributeValuesInput) (req *request.Request, output *GetAttributeValuesOutput) { 196 op := &request.Operation{ 197 Name: opGetAttributeValues, 198 HTTPMethod: "POST", 199 HTTPPath: "/", 200 Paginator: &request.Paginator{ 201 InputTokens: []string{"NextToken"}, 202 OutputTokens: []string{"NextToken"}, 203 LimitToken: "MaxResults", 204 TruncationToken: "", 205 }, 206 } 207 208 if input == nil { 209 input = &GetAttributeValuesInput{} 210 } 211 212 output = &GetAttributeValuesOutput{} 213 req = c.newRequest(op, input, output) 214 return 215 } 216 217 // GetAttributeValues API operation for AWS Price List Service. 218 // 219 // Returns a list of attribute values. Attibutes are similar to the details 220 // in a Price List API offer file. For a list of available attributes, see Offer 221 // File Definitions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs) 222 // in the Amazon Web Services Billing and Cost Management User Guide (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html). 223 // 224 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 225 // with awserr.Error's Code and Message methods to get detailed information about 226 // the error. 227 // 228 // See the AWS API reference guide for AWS Price List Service's 229 // API operation GetAttributeValues for usage and error information. 230 // 231 // Returned Error Types: 232 // * InternalErrorException 233 // An error on the server occurred during the processing of your request. Try 234 // again later. 235 // 236 // * InvalidParameterException 237 // One or more parameters had an invalid value. 238 // 239 // * NotFoundException 240 // The requested resource can't be found. 241 // 242 // * InvalidNextTokenException 243 // The pagination token is invalid. Try again without a pagination token. 244 // 245 // * ExpiredNextTokenException 246 // The pagination token expired. Try again without a pagination token. 247 // 248 // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues 249 func (c *Pricing) GetAttributeValues(input *GetAttributeValuesInput) (*GetAttributeValuesOutput, error) { 250 req, out := c.GetAttributeValuesRequest(input) 251 return out, req.Send() 252 } 253 254 // GetAttributeValuesWithContext is the same as GetAttributeValues with the addition of 255 // the ability to pass a context and additional request options. 256 // 257 // See GetAttributeValues for details on how to use this API operation. 258 // 259 // The context must be non-nil and will be used for request cancellation. If 260 // the context is nil a panic will occur. In the future the SDK may create 261 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 262 // for more information on using Contexts. 263 func (c *Pricing) GetAttributeValuesWithContext(ctx aws.Context, input *GetAttributeValuesInput, opts ...request.Option) (*GetAttributeValuesOutput, error) { 264 req, out := c.GetAttributeValuesRequest(input) 265 req.SetContext(ctx) 266 req.ApplyOptions(opts...) 267 return out, req.Send() 268 } 269 270 // GetAttributeValuesPages iterates over the pages of a GetAttributeValues operation, 271 // calling the "fn" function with the response data for each page. To stop 272 // iterating, return false from the fn function. 273 // 274 // See GetAttributeValues method for more information on how to use this operation. 275 // 276 // Note: This operation can generate multiple requests to a service. 277 // 278 // // Example iterating over at most 3 pages of a GetAttributeValues operation. 279 // pageNum := 0 280 // err := client.GetAttributeValuesPages(params, 281 // func(page *pricing.GetAttributeValuesOutput, lastPage bool) bool { 282 // pageNum++ 283 // fmt.Println(page) 284 // return pageNum <= 3 285 // }) 286 // 287 func (c *Pricing) GetAttributeValuesPages(input *GetAttributeValuesInput, fn func(*GetAttributeValuesOutput, bool) bool) error { 288 return c.GetAttributeValuesPagesWithContext(aws.BackgroundContext(), input, fn) 289 } 290 291 // GetAttributeValuesPagesWithContext same as GetAttributeValuesPages except 292 // it takes a Context and allows setting request options on the pages. 293 // 294 // The context must be non-nil and will be used for request cancellation. If 295 // the context is nil a panic will occur. In the future the SDK may create 296 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 297 // for more information on using Contexts. 298 func (c *Pricing) GetAttributeValuesPagesWithContext(ctx aws.Context, input *GetAttributeValuesInput, fn func(*GetAttributeValuesOutput, bool) bool, opts ...request.Option) error { 299 p := request.Pagination{ 300 NewRequest: func() (*request.Request, error) { 301 var inCpy *GetAttributeValuesInput 302 if input != nil { 303 tmp := *input 304 inCpy = &tmp 305 } 306 req, _ := c.GetAttributeValuesRequest(inCpy) 307 req.SetContext(ctx) 308 req.ApplyOptions(opts...) 309 return req, nil 310 }, 311 } 312 313 for p.Next() { 314 if !fn(p.Page().(*GetAttributeValuesOutput), !p.HasNextPage()) { 315 break 316 } 317 } 318 319 return p.Err() 320 } 321 322 const opGetProducts = "GetProducts" 323 324 // GetProductsRequest generates a "aws/request.Request" representing the 325 // client's request for the GetProducts operation. The "output" return 326 // value will be populated with the request's response once the request completes 327 // successfully. 328 // 329 // Use "Send" method on the returned Request to send the API call to the service. 330 // the "output" return value is not valid until after Send returns without error. 331 // 332 // See GetProducts for more information on using the GetProducts 333 // API call, and error handling. 334 // 335 // This method is useful when you want to inject custom logic or configuration 336 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 337 // 338 // 339 // // Example sending a request using the GetProductsRequest method. 340 // req, resp := client.GetProductsRequest(params) 341 // 342 // err := req.Send() 343 // if err == nil { // resp is now filled 344 // fmt.Println(resp) 345 // } 346 // 347 // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts 348 func (c *Pricing) GetProductsRequest(input *GetProductsInput) (req *request.Request, output *GetProductsOutput) { 349 op := &request.Operation{ 350 Name: opGetProducts, 351 HTTPMethod: "POST", 352 HTTPPath: "/", 353 Paginator: &request.Paginator{ 354 InputTokens: []string{"NextToken"}, 355 OutputTokens: []string{"NextToken"}, 356 LimitToken: "MaxResults", 357 TruncationToken: "", 358 }, 359 } 360 361 if input == nil { 362 input = &GetProductsInput{} 363 } 364 365 output = &GetProductsOutput{} 366 req = c.newRequest(op, input, output) 367 return 368 } 369 370 // GetProducts API operation for AWS Price List Service. 371 // 372 // Returns a list of all products that match the filter criteria. 373 // 374 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 375 // with awserr.Error's Code and Message methods to get detailed information about 376 // the error. 377 // 378 // See the AWS API reference guide for AWS Price List Service's 379 // API operation GetProducts for usage and error information. 380 // 381 // Returned Error Types: 382 // * InternalErrorException 383 // An error on the server occurred during the processing of your request. Try 384 // again later. 385 // 386 // * InvalidParameterException 387 // One or more parameters had an invalid value. 388 // 389 // * NotFoundException 390 // The requested resource can't be found. 391 // 392 // * InvalidNextTokenException 393 // The pagination token is invalid. Try again without a pagination token. 394 // 395 // * ExpiredNextTokenException 396 // The pagination token expired. Try again without a pagination token. 397 // 398 // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts 399 func (c *Pricing) GetProducts(input *GetProductsInput) (*GetProductsOutput, error) { 400 req, out := c.GetProductsRequest(input) 401 return out, req.Send() 402 } 403 404 // GetProductsWithContext is the same as GetProducts with the addition of 405 // the ability to pass a context and additional request options. 406 // 407 // See GetProducts for details on how to use this API operation. 408 // 409 // The context must be non-nil and will be used for request cancellation. If 410 // the context is nil a panic will occur. In the future the SDK may create 411 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 412 // for more information on using Contexts. 413 func (c *Pricing) GetProductsWithContext(ctx aws.Context, input *GetProductsInput, opts ...request.Option) (*GetProductsOutput, error) { 414 req, out := c.GetProductsRequest(input) 415 req.SetContext(ctx) 416 req.ApplyOptions(opts...) 417 return out, req.Send() 418 } 419 420 // GetProductsPages iterates over the pages of a GetProducts operation, 421 // calling the "fn" function with the response data for each page. To stop 422 // iterating, return false from the fn function. 423 // 424 // See GetProducts method for more information on how to use this operation. 425 // 426 // Note: This operation can generate multiple requests to a service. 427 // 428 // // Example iterating over at most 3 pages of a GetProducts operation. 429 // pageNum := 0 430 // err := client.GetProductsPages(params, 431 // func(page *pricing.GetProductsOutput, lastPage bool) bool { 432 // pageNum++ 433 // fmt.Println(page) 434 // return pageNum <= 3 435 // }) 436 // 437 func (c *Pricing) GetProductsPages(input *GetProductsInput, fn func(*GetProductsOutput, bool) bool) error { 438 return c.GetProductsPagesWithContext(aws.BackgroundContext(), input, fn) 439 } 440 441 // GetProductsPagesWithContext same as GetProductsPages except 442 // it takes a Context and allows setting request options on the pages. 443 // 444 // The context must be non-nil and will be used for request cancellation. If 445 // the context is nil a panic will occur. In the future the SDK may create 446 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 447 // for more information on using Contexts. 448 func (c *Pricing) GetProductsPagesWithContext(ctx aws.Context, input *GetProductsInput, fn func(*GetProductsOutput, bool) bool, opts ...request.Option) error { 449 p := request.Pagination{ 450 NewRequest: func() (*request.Request, error) { 451 var inCpy *GetProductsInput 452 if input != nil { 453 tmp := *input 454 inCpy = &tmp 455 } 456 req, _ := c.GetProductsRequest(inCpy) 457 req.SetContext(ctx) 458 req.ApplyOptions(opts...) 459 return req, nil 460 }, 461 } 462 463 for p.Next() { 464 if !fn(p.Page().(*GetProductsOutput), !p.HasNextPage()) { 465 break 466 } 467 } 468 469 return p.Err() 470 } 471 472 // The values of a given attribute, such as Throughput Optimized HDD or Provisioned 473 // IOPS for the Amazon EC2 volumeType attribute. 474 type AttributeValue struct { 475 _ struct{} `type:"structure"` 476 477 // The specific value of an attributeName. 478 Value *string `type:"string"` 479 } 480 481 // String returns the string representation. 482 // 483 // API parameter values that are decorated as "sensitive" in the API will not 484 // be included in the string output. The member name will be present, but the 485 // value will be replaced with "sensitive". 486 func (s AttributeValue) String() string { 487 return awsutil.Prettify(s) 488 } 489 490 // GoString returns the string representation. 491 // 492 // API parameter values that are decorated as "sensitive" in the API will not 493 // be included in the string output. The member name will be present, but the 494 // value will be replaced with "sensitive". 495 func (s AttributeValue) GoString() string { 496 return s.String() 497 } 498 499 // SetValue sets the Value field's value. 500 func (s *AttributeValue) SetValue(v string) *AttributeValue { 501 s.Value = &v 502 return s 503 } 504 505 type DescribeServicesInput struct { 506 _ struct{} `type:"structure"` 507 508 // The format version that you want the response to be in. 509 // 510 // Valid values are: aws_v1 511 FormatVersion *string `type:"string"` 512 513 // The maximum number of results that you want returned in the response. 514 MaxResults *int64 `min:"1" type:"integer"` 515 516 // The pagination token that indicates the next set of results that you want 517 // to retrieve. 518 NextToken *string `type:"string"` 519 520 // The code for the service whose information you want to retrieve, such as 521 // AmazonEC2. You can use the ServiceCode to filter the results in a GetProducts 522 // call. To retrieve a list of all services, leave this blank. 523 ServiceCode *string `type:"string"` 524 } 525 526 // String returns the string representation. 527 // 528 // API parameter values that are decorated as "sensitive" in the API will not 529 // be included in the string output. The member name will be present, but the 530 // value will be replaced with "sensitive". 531 func (s DescribeServicesInput) String() string { 532 return awsutil.Prettify(s) 533 } 534 535 // GoString returns the string representation. 536 // 537 // API parameter values that are decorated as "sensitive" in the API will not 538 // be included in the string output. The member name will be present, but the 539 // value will be replaced with "sensitive". 540 func (s DescribeServicesInput) GoString() string { 541 return s.String() 542 } 543 544 // Validate inspects the fields of the type to determine if they are valid. 545 func (s *DescribeServicesInput) Validate() error { 546 invalidParams := request.ErrInvalidParams{Context: "DescribeServicesInput"} 547 if s.MaxResults != nil && *s.MaxResults < 1 { 548 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 549 } 550 551 if invalidParams.Len() > 0 { 552 return invalidParams 553 } 554 return nil 555 } 556 557 // SetFormatVersion sets the FormatVersion field's value. 558 func (s *DescribeServicesInput) SetFormatVersion(v string) *DescribeServicesInput { 559 s.FormatVersion = &v 560 return s 561 } 562 563 // SetMaxResults sets the MaxResults field's value. 564 func (s *DescribeServicesInput) SetMaxResults(v int64) *DescribeServicesInput { 565 s.MaxResults = &v 566 return s 567 } 568 569 // SetNextToken sets the NextToken field's value. 570 func (s *DescribeServicesInput) SetNextToken(v string) *DescribeServicesInput { 571 s.NextToken = &v 572 return s 573 } 574 575 // SetServiceCode sets the ServiceCode field's value. 576 func (s *DescribeServicesInput) SetServiceCode(v string) *DescribeServicesInput { 577 s.ServiceCode = &v 578 return s 579 } 580 581 type DescribeServicesOutput struct { 582 _ struct{} `type:"structure"` 583 584 // The format version of the response. For example, aws_v1. 585 FormatVersion *string `type:"string"` 586 587 // The pagination token for the next set of retreivable results. 588 NextToken *string `type:"string"` 589 590 // The service metadata for the service or services in the response. 591 Services []*Service `type:"list"` 592 } 593 594 // String returns the string representation. 595 // 596 // API parameter values that are decorated as "sensitive" in the API will not 597 // be included in the string output. The member name will be present, but the 598 // value will be replaced with "sensitive". 599 func (s DescribeServicesOutput) String() string { 600 return awsutil.Prettify(s) 601 } 602 603 // GoString returns the string representation. 604 // 605 // API parameter values that are decorated as "sensitive" in the API will not 606 // be included in the string output. The member name will be present, but the 607 // value will be replaced with "sensitive". 608 func (s DescribeServicesOutput) GoString() string { 609 return s.String() 610 } 611 612 // SetFormatVersion sets the FormatVersion field's value. 613 func (s *DescribeServicesOutput) SetFormatVersion(v string) *DescribeServicesOutput { 614 s.FormatVersion = &v 615 return s 616 } 617 618 // SetNextToken sets the NextToken field's value. 619 func (s *DescribeServicesOutput) SetNextToken(v string) *DescribeServicesOutput { 620 s.NextToken = &v 621 return s 622 } 623 624 // SetServices sets the Services field's value. 625 func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutput { 626 s.Services = v 627 return s 628 } 629 630 // The pagination token expired. Try again without a pagination token. 631 type ExpiredNextTokenException struct { 632 _ struct{} `type:"structure"` 633 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 634 635 Message_ *string `locationName:"Message" type:"string"` 636 } 637 638 // String returns the string representation. 639 // 640 // API parameter values that are decorated as "sensitive" in the API will not 641 // be included in the string output. The member name will be present, but the 642 // value will be replaced with "sensitive". 643 func (s ExpiredNextTokenException) String() string { 644 return awsutil.Prettify(s) 645 } 646 647 // GoString returns the string representation. 648 // 649 // API parameter values that are decorated as "sensitive" in the API will not 650 // be included in the string output. The member name will be present, but the 651 // value will be replaced with "sensitive". 652 func (s ExpiredNextTokenException) GoString() string { 653 return s.String() 654 } 655 656 func newErrorExpiredNextTokenException(v protocol.ResponseMetadata) error { 657 return &ExpiredNextTokenException{ 658 RespMetadata: v, 659 } 660 } 661 662 // Code returns the exception type name. 663 func (s *ExpiredNextTokenException) Code() string { 664 return "ExpiredNextTokenException" 665 } 666 667 // Message returns the exception's message. 668 func (s *ExpiredNextTokenException) Message() string { 669 if s.Message_ != nil { 670 return *s.Message_ 671 } 672 return "" 673 } 674 675 // OrigErr always returns nil, satisfies awserr.Error interface. 676 func (s *ExpiredNextTokenException) OrigErr() error { 677 return nil 678 } 679 680 func (s *ExpiredNextTokenException) Error() string { 681 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 682 } 683 684 // Status code returns the HTTP status code for the request's response error. 685 func (s *ExpiredNextTokenException) StatusCode() int { 686 return s.RespMetadata.StatusCode 687 } 688 689 // RequestID returns the service's response RequestID for request. 690 func (s *ExpiredNextTokenException) RequestID() string { 691 return s.RespMetadata.RequestID 692 } 693 694 // The constraints that you want all returned products to match. 695 type Filter struct { 696 _ struct{} `type:"structure"` 697 698 // The product metadata field that you want to filter on. You can filter by 699 // just the service code to see all products for a specific service, filter 700 // by just the attribute name to see a specific attribute for multiple services, 701 // or use both a service code and an attribute name to retrieve only products 702 // that match both fields. 703 // 704 // Valid values include: ServiceCode, and all attribute names 705 // 706 // For example, you can filter by the AmazonEC2 service code and the volumeType 707 // attribute name to get the prices for only Amazon EC2 volumes. 708 // 709 // Field is a required field 710 Field *string `type:"string" required:"true"` 711 712 // The type of filter that you want to use. 713 // 714 // Valid values are: TERM_MATCH. TERM_MATCH returns only products that match 715 // both the given filter field and the given value. 716 // 717 // Type is a required field 718 Type *string `type:"string" required:"true" enum:"FilterType"` 719 720 // The service code or attribute value that you want to filter by. If you are 721 // filtering by service code this is the actual service code, such as AmazonEC2. 722 // If you are filtering by attribute name, this is the attribute value that 723 // you want the returned products to match, such as a Provisioned IOPS volume. 724 // 725 // Value is a required field 726 Value *string `type:"string" required:"true"` 727 } 728 729 // String returns the string representation. 730 // 731 // API parameter values that are decorated as "sensitive" in the API will not 732 // be included in the string output. The member name will be present, but the 733 // value will be replaced with "sensitive". 734 func (s Filter) String() string { 735 return awsutil.Prettify(s) 736 } 737 738 // GoString returns the string representation. 739 // 740 // API parameter values that are decorated as "sensitive" in the API will not 741 // be included in the string output. The member name will be present, but the 742 // value will be replaced with "sensitive". 743 func (s Filter) GoString() string { 744 return s.String() 745 } 746 747 // Validate inspects the fields of the type to determine if they are valid. 748 func (s *Filter) Validate() error { 749 invalidParams := request.ErrInvalidParams{Context: "Filter"} 750 if s.Field == nil { 751 invalidParams.Add(request.NewErrParamRequired("Field")) 752 } 753 if s.Type == nil { 754 invalidParams.Add(request.NewErrParamRequired("Type")) 755 } 756 if s.Value == nil { 757 invalidParams.Add(request.NewErrParamRequired("Value")) 758 } 759 760 if invalidParams.Len() > 0 { 761 return invalidParams 762 } 763 return nil 764 } 765 766 // SetField sets the Field field's value. 767 func (s *Filter) SetField(v string) *Filter { 768 s.Field = &v 769 return s 770 } 771 772 // SetType sets the Type field's value. 773 func (s *Filter) SetType(v string) *Filter { 774 s.Type = &v 775 return s 776 } 777 778 // SetValue sets the Value field's value. 779 func (s *Filter) SetValue(v string) *Filter { 780 s.Value = &v 781 return s 782 } 783 784 type GetAttributeValuesInput struct { 785 _ struct{} `type:"structure"` 786 787 // The name of the attribute that you want to retrieve the values for, such 788 // as volumeType. 789 // 790 // AttributeName is a required field 791 AttributeName *string `type:"string" required:"true"` 792 793 // The maximum number of results to return in response. 794 MaxResults *int64 `min:"1" type:"integer"` 795 796 // The pagination token that indicates the next set of results that you want 797 // to retrieve. 798 NextToken *string `type:"string"` 799 800 // The service code for the service whose attributes you want to retrieve. For 801 // example, if you want the retrieve an EC2 attribute, use AmazonEC2. 802 // 803 // ServiceCode is a required field 804 ServiceCode *string `type:"string" required:"true"` 805 } 806 807 // String returns the string representation. 808 // 809 // API parameter values that are decorated as "sensitive" in the API will not 810 // be included in the string output. The member name will be present, but the 811 // value will be replaced with "sensitive". 812 func (s GetAttributeValuesInput) String() string { 813 return awsutil.Prettify(s) 814 } 815 816 // GoString returns the string representation. 817 // 818 // API parameter values that are decorated as "sensitive" in the API will not 819 // be included in the string output. The member name will be present, but the 820 // value will be replaced with "sensitive". 821 func (s GetAttributeValuesInput) GoString() string { 822 return s.String() 823 } 824 825 // Validate inspects the fields of the type to determine if they are valid. 826 func (s *GetAttributeValuesInput) Validate() error { 827 invalidParams := request.ErrInvalidParams{Context: "GetAttributeValuesInput"} 828 if s.AttributeName == nil { 829 invalidParams.Add(request.NewErrParamRequired("AttributeName")) 830 } 831 if s.MaxResults != nil && *s.MaxResults < 1 { 832 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 833 } 834 if s.ServiceCode == nil { 835 invalidParams.Add(request.NewErrParamRequired("ServiceCode")) 836 } 837 838 if invalidParams.Len() > 0 { 839 return invalidParams 840 } 841 return nil 842 } 843 844 // SetAttributeName sets the AttributeName field's value. 845 func (s *GetAttributeValuesInput) SetAttributeName(v string) *GetAttributeValuesInput { 846 s.AttributeName = &v 847 return s 848 } 849 850 // SetMaxResults sets the MaxResults field's value. 851 func (s *GetAttributeValuesInput) SetMaxResults(v int64) *GetAttributeValuesInput { 852 s.MaxResults = &v 853 return s 854 } 855 856 // SetNextToken sets the NextToken field's value. 857 func (s *GetAttributeValuesInput) SetNextToken(v string) *GetAttributeValuesInput { 858 s.NextToken = &v 859 return s 860 } 861 862 // SetServiceCode sets the ServiceCode field's value. 863 func (s *GetAttributeValuesInput) SetServiceCode(v string) *GetAttributeValuesInput { 864 s.ServiceCode = &v 865 return s 866 } 867 868 type GetAttributeValuesOutput struct { 869 _ struct{} `type:"structure"` 870 871 // The list of values for an attribute. For example, Throughput Optimized HDD 872 // and Provisioned IOPS are two available values for the AmazonEC2 volumeType. 873 AttributeValues []*AttributeValue `type:"list"` 874 875 // The pagination token that indicates the next set of results to retrieve. 876 NextToken *string `type:"string"` 877 } 878 879 // String returns the string representation. 880 // 881 // API parameter values that are decorated as "sensitive" in the API will not 882 // be included in the string output. The member name will be present, but the 883 // value will be replaced with "sensitive". 884 func (s GetAttributeValuesOutput) String() string { 885 return awsutil.Prettify(s) 886 } 887 888 // GoString returns the string representation. 889 // 890 // API parameter values that are decorated as "sensitive" in the API will not 891 // be included in the string output. The member name will be present, but the 892 // value will be replaced with "sensitive". 893 func (s GetAttributeValuesOutput) GoString() string { 894 return s.String() 895 } 896 897 // SetAttributeValues sets the AttributeValues field's value. 898 func (s *GetAttributeValuesOutput) SetAttributeValues(v []*AttributeValue) *GetAttributeValuesOutput { 899 s.AttributeValues = v 900 return s 901 } 902 903 // SetNextToken sets the NextToken field's value. 904 func (s *GetAttributeValuesOutput) SetNextToken(v string) *GetAttributeValuesOutput { 905 s.NextToken = &v 906 return s 907 } 908 909 type GetProductsInput struct { 910 _ struct{} `type:"structure"` 911 912 // The list of filters that limit the returned products. only products that 913 // match all filters are returned. 914 Filters []*Filter `type:"list"` 915 916 // The format version that you want the response to be in. 917 // 918 // Valid values are: aws_v1 919 FormatVersion *string `type:"string"` 920 921 // The maximum number of results to return in the response. 922 MaxResults *int64 `min:"1" type:"integer"` 923 924 // The pagination token that indicates the next set of results that you want 925 // to retrieve. 926 NextToken *string `type:"string"` 927 928 // The code for the service whose products you want to retrieve. 929 ServiceCode *string `type:"string"` 930 } 931 932 // String returns the string representation. 933 // 934 // API parameter values that are decorated as "sensitive" in the API will not 935 // be included in the string output. The member name will be present, but the 936 // value will be replaced with "sensitive". 937 func (s GetProductsInput) String() string { 938 return awsutil.Prettify(s) 939 } 940 941 // GoString returns the string representation. 942 // 943 // API parameter values that are decorated as "sensitive" in the API will not 944 // be included in the string output. The member name will be present, but the 945 // value will be replaced with "sensitive". 946 func (s GetProductsInput) GoString() string { 947 return s.String() 948 } 949 950 // Validate inspects the fields of the type to determine if they are valid. 951 func (s *GetProductsInput) Validate() error { 952 invalidParams := request.ErrInvalidParams{Context: "GetProductsInput"} 953 if s.MaxResults != nil && *s.MaxResults < 1 { 954 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 955 } 956 if s.Filters != nil { 957 for i, v := range s.Filters { 958 if v == nil { 959 continue 960 } 961 if err := v.Validate(); err != nil { 962 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) 963 } 964 } 965 } 966 967 if invalidParams.Len() > 0 { 968 return invalidParams 969 } 970 return nil 971 } 972 973 // SetFilters sets the Filters field's value. 974 func (s *GetProductsInput) SetFilters(v []*Filter) *GetProductsInput { 975 s.Filters = v 976 return s 977 } 978 979 // SetFormatVersion sets the FormatVersion field's value. 980 func (s *GetProductsInput) SetFormatVersion(v string) *GetProductsInput { 981 s.FormatVersion = &v 982 return s 983 } 984 985 // SetMaxResults sets the MaxResults field's value. 986 func (s *GetProductsInput) SetMaxResults(v int64) *GetProductsInput { 987 s.MaxResults = &v 988 return s 989 } 990 991 // SetNextToken sets the NextToken field's value. 992 func (s *GetProductsInput) SetNextToken(v string) *GetProductsInput { 993 s.NextToken = &v 994 return s 995 } 996 997 // SetServiceCode sets the ServiceCode field's value. 998 func (s *GetProductsInput) SetServiceCode(v string) *GetProductsInput { 999 s.ServiceCode = &v 1000 return s 1001 } 1002 1003 type GetProductsOutput struct { 1004 _ struct{} `type:"structure"` 1005 1006 // The format version of the response. For example, aws_v1. 1007 FormatVersion *string `type:"string"` 1008 1009 // The pagination token that indicates the next set of results to retrieve. 1010 NextToken *string `type:"string"` 1011 1012 // The list of products that match your filters. The list contains both the 1013 // product metadata and the price information. 1014 PriceList []aws.JSONValue `type:"list"` 1015 } 1016 1017 // String returns the string representation. 1018 // 1019 // API parameter values that are decorated as "sensitive" in the API will not 1020 // be included in the string output. The member name will be present, but the 1021 // value will be replaced with "sensitive". 1022 func (s GetProductsOutput) String() string { 1023 return awsutil.Prettify(s) 1024 } 1025 1026 // GoString returns the string representation. 1027 // 1028 // API parameter values that are decorated as "sensitive" in the API will not 1029 // be included in the string output. The member name will be present, but the 1030 // value will be replaced with "sensitive". 1031 func (s GetProductsOutput) GoString() string { 1032 return s.String() 1033 } 1034 1035 // SetFormatVersion sets the FormatVersion field's value. 1036 func (s *GetProductsOutput) SetFormatVersion(v string) *GetProductsOutput { 1037 s.FormatVersion = &v 1038 return s 1039 } 1040 1041 // SetNextToken sets the NextToken field's value. 1042 func (s *GetProductsOutput) SetNextToken(v string) *GetProductsOutput { 1043 s.NextToken = &v 1044 return s 1045 } 1046 1047 // SetPriceList sets the PriceList field's value. 1048 func (s *GetProductsOutput) SetPriceList(v []aws.JSONValue) *GetProductsOutput { 1049 s.PriceList = v 1050 return s 1051 } 1052 1053 // An error on the server occurred during the processing of your request. Try 1054 // again later. 1055 type InternalErrorException struct { 1056 _ struct{} `type:"structure"` 1057 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1058 1059 Message_ *string `locationName:"Message" type:"string"` 1060 } 1061 1062 // String returns the string representation. 1063 // 1064 // API parameter values that are decorated as "sensitive" in the API will not 1065 // be included in the string output. The member name will be present, but the 1066 // value will be replaced with "sensitive". 1067 func (s InternalErrorException) String() string { 1068 return awsutil.Prettify(s) 1069 } 1070 1071 // GoString returns the string representation. 1072 // 1073 // API parameter values that are decorated as "sensitive" in the API will not 1074 // be included in the string output. The member name will be present, but the 1075 // value will be replaced with "sensitive". 1076 func (s InternalErrorException) GoString() string { 1077 return s.String() 1078 } 1079 1080 func newErrorInternalErrorException(v protocol.ResponseMetadata) error { 1081 return &InternalErrorException{ 1082 RespMetadata: v, 1083 } 1084 } 1085 1086 // Code returns the exception type name. 1087 func (s *InternalErrorException) Code() string { 1088 return "InternalErrorException" 1089 } 1090 1091 // Message returns the exception's message. 1092 func (s *InternalErrorException) Message() string { 1093 if s.Message_ != nil { 1094 return *s.Message_ 1095 } 1096 return "" 1097 } 1098 1099 // OrigErr always returns nil, satisfies awserr.Error interface. 1100 func (s *InternalErrorException) OrigErr() error { 1101 return nil 1102 } 1103 1104 func (s *InternalErrorException) Error() string { 1105 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1106 } 1107 1108 // Status code returns the HTTP status code for the request's response error. 1109 func (s *InternalErrorException) StatusCode() int { 1110 return s.RespMetadata.StatusCode 1111 } 1112 1113 // RequestID returns the service's response RequestID for request. 1114 func (s *InternalErrorException) RequestID() string { 1115 return s.RespMetadata.RequestID 1116 } 1117 1118 // The pagination token is invalid. Try again without a pagination token. 1119 type InvalidNextTokenException struct { 1120 _ struct{} `type:"structure"` 1121 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1122 1123 Message_ *string `locationName:"Message" type:"string"` 1124 } 1125 1126 // String returns the string representation. 1127 // 1128 // API parameter values that are decorated as "sensitive" in the API will not 1129 // be included in the string output. The member name will be present, but the 1130 // value will be replaced with "sensitive". 1131 func (s InvalidNextTokenException) String() string { 1132 return awsutil.Prettify(s) 1133 } 1134 1135 // GoString returns the string representation. 1136 // 1137 // API parameter values that are decorated as "sensitive" in the API will not 1138 // be included in the string output. The member name will be present, but the 1139 // value will be replaced with "sensitive". 1140 func (s InvalidNextTokenException) GoString() string { 1141 return s.String() 1142 } 1143 1144 func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { 1145 return &InvalidNextTokenException{ 1146 RespMetadata: v, 1147 } 1148 } 1149 1150 // Code returns the exception type name. 1151 func (s *InvalidNextTokenException) Code() string { 1152 return "InvalidNextTokenException" 1153 } 1154 1155 // Message returns the exception's message. 1156 func (s *InvalidNextTokenException) Message() string { 1157 if s.Message_ != nil { 1158 return *s.Message_ 1159 } 1160 return "" 1161 } 1162 1163 // OrigErr always returns nil, satisfies awserr.Error interface. 1164 func (s *InvalidNextTokenException) OrigErr() error { 1165 return nil 1166 } 1167 1168 func (s *InvalidNextTokenException) Error() string { 1169 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1170 } 1171 1172 // Status code returns the HTTP status code for the request's response error. 1173 func (s *InvalidNextTokenException) StatusCode() int { 1174 return s.RespMetadata.StatusCode 1175 } 1176 1177 // RequestID returns the service's response RequestID for request. 1178 func (s *InvalidNextTokenException) RequestID() string { 1179 return s.RespMetadata.RequestID 1180 } 1181 1182 // One or more parameters had an invalid value. 1183 type InvalidParameterException struct { 1184 _ struct{} `type:"structure"` 1185 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1186 1187 Message_ *string `locationName:"Message" type:"string"` 1188 } 1189 1190 // String returns the string representation. 1191 // 1192 // API parameter values that are decorated as "sensitive" in the API will not 1193 // be included in the string output. The member name will be present, but the 1194 // value will be replaced with "sensitive". 1195 func (s InvalidParameterException) String() string { 1196 return awsutil.Prettify(s) 1197 } 1198 1199 // GoString returns the string representation. 1200 // 1201 // API parameter values that are decorated as "sensitive" in the API will not 1202 // be included in the string output. The member name will be present, but the 1203 // value will be replaced with "sensitive". 1204 func (s InvalidParameterException) GoString() string { 1205 return s.String() 1206 } 1207 1208 func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { 1209 return &InvalidParameterException{ 1210 RespMetadata: v, 1211 } 1212 } 1213 1214 // Code returns the exception type name. 1215 func (s *InvalidParameterException) Code() string { 1216 return "InvalidParameterException" 1217 } 1218 1219 // Message returns the exception's message. 1220 func (s *InvalidParameterException) Message() string { 1221 if s.Message_ != nil { 1222 return *s.Message_ 1223 } 1224 return "" 1225 } 1226 1227 // OrigErr always returns nil, satisfies awserr.Error interface. 1228 func (s *InvalidParameterException) OrigErr() error { 1229 return nil 1230 } 1231 1232 func (s *InvalidParameterException) Error() string { 1233 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1234 } 1235 1236 // Status code returns the HTTP status code for the request's response error. 1237 func (s *InvalidParameterException) StatusCode() int { 1238 return s.RespMetadata.StatusCode 1239 } 1240 1241 // RequestID returns the service's response RequestID for request. 1242 func (s *InvalidParameterException) RequestID() string { 1243 return s.RespMetadata.RequestID 1244 } 1245 1246 // The requested resource can't be found. 1247 type NotFoundException struct { 1248 _ struct{} `type:"structure"` 1249 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1250 1251 Message_ *string `locationName:"Message" type:"string"` 1252 } 1253 1254 // String returns the string representation. 1255 // 1256 // API parameter values that are decorated as "sensitive" in the API will not 1257 // be included in the string output. The member name will be present, but the 1258 // value will be replaced with "sensitive". 1259 func (s NotFoundException) String() string { 1260 return awsutil.Prettify(s) 1261 } 1262 1263 // GoString returns the string representation. 1264 // 1265 // API parameter values that are decorated as "sensitive" in the API will not 1266 // be included in the string output. The member name will be present, but the 1267 // value will be replaced with "sensitive". 1268 func (s NotFoundException) GoString() string { 1269 return s.String() 1270 } 1271 1272 func newErrorNotFoundException(v protocol.ResponseMetadata) error { 1273 return &NotFoundException{ 1274 RespMetadata: v, 1275 } 1276 } 1277 1278 // Code returns the exception type name. 1279 func (s *NotFoundException) Code() string { 1280 return "NotFoundException" 1281 } 1282 1283 // Message returns the exception's message. 1284 func (s *NotFoundException) Message() string { 1285 if s.Message_ != nil { 1286 return *s.Message_ 1287 } 1288 return "" 1289 } 1290 1291 // OrigErr always returns nil, satisfies awserr.Error interface. 1292 func (s *NotFoundException) OrigErr() error { 1293 return nil 1294 } 1295 1296 func (s *NotFoundException) Error() string { 1297 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1298 } 1299 1300 // Status code returns the HTTP status code for the request's response error. 1301 func (s *NotFoundException) StatusCode() int { 1302 return s.RespMetadata.StatusCode 1303 } 1304 1305 // RequestID returns the service's response RequestID for request. 1306 func (s *NotFoundException) RequestID() string { 1307 return s.RespMetadata.RequestID 1308 } 1309 1310 // The metadata for a service, such as the service code and available attribute 1311 // names. 1312 type Service struct { 1313 _ struct{} `type:"structure"` 1314 1315 // The attributes that are available for this service. 1316 AttributeNames []*string `type:"list"` 1317 1318 // The code for the Amazon Web Services service. 1319 ServiceCode *string `type:"string"` 1320 } 1321 1322 // String returns the string representation. 1323 // 1324 // API parameter values that are decorated as "sensitive" in the API will not 1325 // be included in the string output. The member name will be present, but the 1326 // value will be replaced with "sensitive". 1327 func (s Service) String() string { 1328 return awsutil.Prettify(s) 1329 } 1330 1331 // GoString returns the string representation. 1332 // 1333 // API parameter values that are decorated as "sensitive" in the API will not 1334 // be included in the string output. The member name will be present, but the 1335 // value will be replaced with "sensitive". 1336 func (s Service) GoString() string { 1337 return s.String() 1338 } 1339 1340 // SetAttributeNames sets the AttributeNames field's value. 1341 func (s *Service) SetAttributeNames(v []*string) *Service { 1342 s.AttributeNames = v 1343 return s 1344 } 1345 1346 // SetServiceCode sets the ServiceCode field's value. 1347 func (s *Service) SetServiceCode(v string) *Service { 1348 s.ServiceCode = &v 1349 return s 1350 } 1351 1352 const ( 1353 // FilterTypeTermMatch is a FilterType enum value 1354 FilterTypeTermMatch = "TERM_MATCH" 1355 ) 1356 1357 // FilterType_Values returns all elements of the FilterType enum 1358 func FilterType_Values() []string { 1359 return []string{ 1360 FilterTypeTermMatch, 1361 } 1362 }