github.com/aavshr/aws-sdk-go@v1.41.3/service/marketplacemetering/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package marketplacemetering 4 5 import ( 6 "fmt" 7 "time" 8 9 "github.com/aavshr/aws-sdk-go/aws" 10 "github.com/aavshr/aws-sdk-go/aws/awsutil" 11 "github.com/aavshr/aws-sdk-go/aws/request" 12 "github.com/aavshr/aws-sdk-go/private/protocol" 13 ) 14 15 const opBatchMeterUsage = "BatchMeterUsage" 16 17 // BatchMeterUsageRequest generates a "aws/request.Request" representing the 18 // client's request for the BatchMeterUsage operation. The "output" return 19 // value will be populated with the request's response once the request completes 20 // successfully. 21 // 22 // Use "Send" method on the returned Request to send the API call to the service. 23 // the "output" return value is not valid until after Send returns without error. 24 // 25 // See BatchMeterUsage for more information on using the BatchMeterUsage 26 // API call, and error handling. 27 // 28 // This method is useful when you want to inject custom logic or configuration 29 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 30 // 31 // 32 // // Example sending a request using the BatchMeterUsageRequest method. 33 // req, resp := client.BatchMeterUsageRequest(params) 34 // 35 // err := req.Send() 36 // if err == nil { // resp is now filled 37 // fmt.Println(resp) 38 // } 39 // 40 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsage 41 func (c *MarketplaceMetering) BatchMeterUsageRequest(input *BatchMeterUsageInput) (req *request.Request, output *BatchMeterUsageOutput) { 42 op := &request.Operation{ 43 Name: opBatchMeterUsage, 44 HTTPMethod: "POST", 45 HTTPPath: "/", 46 } 47 48 if input == nil { 49 input = &BatchMeterUsageInput{} 50 } 51 52 output = &BatchMeterUsageOutput{} 53 req = c.newRequest(op, input, output) 54 return 55 } 56 57 // BatchMeterUsage API operation for AWSMarketplace Metering. 58 // 59 // BatchMeterUsage is called from a SaaS application listed on the AWS Marketplace 60 // to post metering records for a set of customers. 61 // 62 // For identical requests, the API is idempotent; requests can be retried with 63 // the same records or a subset of the input records. 64 // 65 // Every request to BatchMeterUsage is for one product. If you need to meter 66 // usage for multiple products, you must make multiple calls to BatchMeterUsage. 67 // 68 // BatchMeterUsage can process up to 25 UsageRecords at a time. 69 // 70 // A UsageRecord can optionally include multiple usage allocations, to provide 71 // customers with usagedata split into buckets by tags that you define (or allow 72 // the customer to define). 73 // 74 // BatchMeterUsage requests must be less than 1MB in size. 75 // 76 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 77 // with awserr.Error's Code and Message methods to get detailed information about 78 // the error. 79 // 80 // See the AWS API reference guide for AWSMarketplace Metering's 81 // API operation BatchMeterUsage for usage and error information. 82 // 83 // Returned Error Types: 84 // * InternalServiceErrorException 85 // An internal error has occurred. Retry your request. If the problem persists, 86 // post a message with details on the AWS forums. 87 // 88 // * InvalidProductCodeException 89 // The product code passed does not match the product code used for publishing 90 // the product. 91 // 92 // * InvalidUsageDimensionException 93 // The usage dimension does not match one of the UsageDimensions associated 94 // with products. 95 // 96 // * InvalidTagException 97 // The tag is invalid, or the number of tags is greater than 5. 98 // 99 // * InvalidUsageAllocationsException 100 // The usage allocation objects are invalid, or the number of allocations is 101 // greater than 500 for a single usage record. 102 // 103 // * InvalidCustomerIdentifierException 104 // You have metered usage for a CustomerIdentifier that does not exist. 105 // 106 // * TimestampOutOfBoundsException 107 // The timestamp value passed in the meterUsage() is out of allowed range. 108 // 109 // * ThrottlingException 110 // The calls to the API are throttled. 111 // 112 // * DisabledApiException 113 // The API is disabled in the Region. 114 // 115 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/BatchMeterUsage 116 func (c *MarketplaceMetering) BatchMeterUsage(input *BatchMeterUsageInput) (*BatchMeterUsageOutput, error) { 117 req, out := c.BatchMeterUsageRequest(input) 118 return out, req.Send() 119 } 120 121 // BatchMeterUsageWithContext is the same as BatchMeterUsage with the addition of 122 // the ability to pass a context and additional request options. 123 // 124 // See BatchMeterUsage for details on how to use this API operation. 125 // 126 // The context must be non-nil and will be used for request cancellation. If 127 // the context is nil a panic will occur. In the future the SDK may create 128 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 129 // for more information on using Contexts. 130 func (c *MarketplaceMetering) BatchMeterUsageWithContext(ctx aws.Context, input *BatchMeterUsageInput, opts ...request.Option) (*BatchMeterUsageOutput, error) { 131 req, out := c.BatchMeterUsageRequest(input) 132 req.SetContext(ctx) 133 req.ApplyOptions(opts...) 134 return out, req.Send() 135 } 136 137 const opMeterUsage = "MeterUsage" 138 139 // MeterUsageRequest generates a "aws/request.Request" representing the 140 // client's request for the MeterUsage operation. The "output" return 141 // value will be populated with the request's response once the request completes 142 // successfully. 143 // 144 // Use "Send" method on the returned Request to send the API call to the service. 145 // the "output" return value is not valid until after Send returns without error. 146 // 147 // See MeterUsage for more information on using the MeterUsage 148 // API call, and error handling. 149 // 150 // This method is useful when you want to inject custom logic or configuration 151 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 152 // 153 // 154 // // Example sending a request using the MeterUsageRequest method. 155 // req, resp := client.MeterUsageRequest(params) 156 // 157 // err := req.Send() 158 // if err == nil { // resp is now filled 159 // fmt.Println(resp) 160 // } 161 // 162 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/MeterUsage 163 func (c *MarketplaceMetering) MeterUsageRequest(input *MeterUsageInput) (req *request.Request, output *MeterUsageOutput) { 164 op := &request.Operation{ 165 Name: opMeterUsage, 166 HTTPMethod: "POST", 167 HTTPPath: "/", 168 } 169 170 if input == nil { 171 input = &MeterUsageInput{} 172 } 173 174 output = &MeterUsageOutput{} 175 req = c.newRequest(op, input, output) 176 return 177 } 178 179 // MeterUsage API operation for AWSMarketplace Metering. 180 // 181 // API to emit metering records. For identical requests, the API is idempotent. 182 // It simply returns the metering record ID. 183 // 184 // MeterUsage is authenticated on the buyer's AWS account using credentials 185 // from the EC2 instance, ECS task, or EKS pod. 186 // 187 // MeterUsage can optionally include multiple usage allocations, to provide 188 // customers with usage data split into buckets by tags that you define (or 189 // allow the customer to define). 190 // 191 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 192 // with awserr.Error's Code and Message methods to get detailed information about 193 // the error. 194 // 195 // See the AWS API reference guide for AWSMarketplace Metering's 196 // API operation MeterUsage for usage and error information. 197 // 198 // Returned Error Types: 199 // * InternalServiceErrorException 200 // An internal error has occurred. Retry your request. If the problem persists, 201 // post a message with details on the AWS forums. 202 // 203 // * InvalidProductCodeException 204 // The product code passed does not match the product code used for publishing 205 // the product. 206 // 207 // * InvalidUsageDimensionException 208 // The usage dimension does not match one of the UsageDimensions associated 209 // with products. 210 // 211 // * InvalidTagException 212 // The tag is invalid, or the number of tags is greater than 5. 213 // 214 // * InvalidUsageAllocationsException 215 // The usage allocation objects are invalid, or the number of allocations is 216 // greater than 500 for a single usage record. 217 // 218 // * InvalidEndpointRegionException 219 // The endpoint being called is in a AWS Region different from your EC2 instance, 220 // ECS task, or EKS pod. The Region of the Metering Service endpoint and the 221 // AWS Region of the resource must match. 222 // 223 // * TimestampOutOfBoundsException 224 // The timestamp value passed in the meterUsage() is out of allowed range. 225 // 226 // * DuplicateRequestException 227 // A metering record has already been emitted by the same EC2 instance, ECS 228 // task, or EKS pod for the given {usageDimension, timestamp} with a different 229 // usageQuantity. 230 // 231 // * ThrottlingException 232 // The calls to the API are throttled. 233 // 234 // * CustomerNotEntitledException 235 // Exception thrown when the customer does not have a valid subscription for 236 // the product. 237 // 238 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/MeterUsage 239 func (c *MarketplaceMetering) MeterUsage(input *MeterUsageInput) (*MeterUsageOutput, error) { 240 req, out := c.MeterUsageRequest(input) 241 return out, req.Send() 242 } 243 244 // MeterUsageWithContext is the same as MeterUsage with the addition of 245 // the ability to pass a context and additional request options. 246 // 247 // See MeterUsage for details on how to use this API operation. 248 // 249 // The context must be non-nil and will be used for request cancellation. If 250 // the context is nil a panic will occur. In the future the SDK may create 251 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 252 // for more information on using Contexts. 253 func (c *MarketplaceMetering) MeterUsageWithContext(ctx aws.Context, input *MeterUsageInput, opts ...request.Option) (*MeterUsageOutput, error) { 254 req, out := c.MeterUsageRequest(input) 255 req.SetContext(ctx) 256 req.ApplyOptions(opts...) 257 return out, req.Send() 258 } 259 260 const opRegisterUsage = "RegisterUsage" 261 262 // RegisterUsageRequest generates a "aws/request.Request" representing the 263 // client's request for the RegisterUsage operation. The "output" return 264 // value will be populated with the request's response once the request completes 265 // successfully. 266 // 267 // Use "Send" method on the returned Request to send the API call to the service. 268 // the "output" return value is not valid until after Send returns without error. 269 // 270 // See RegisterUsage for more information on using the RegisterUsage 271 // API call, and error handling. 272 // 273 // This method is useful when you want to inject custom logic or configuration 274 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 275 // 276 // 277 // // Example sending a request using the RegisterUsageRequest method. 278 // req, resp := client.RegisterUsageRequest(params) 279 // 280 // err := req.Send() 281 // if err == nil { // resp is now filled 282 // fmt.Println(resp) 283 // } 284 // 285 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage 286 func (c *MarketplaceMetering) RegisterUsageRequest(input *RegisterUsageInput) (req *request.Request, output *RegisterUsageOutput) { 287 op := &request.Operation{ 288 Name: opRegisterUsage, 289 HTTPMethod: "POST", 290 HTTPPath: "/", 291 } 292 293 if input == nil { 294 input = &RegisterUsageInput{} 295 } 296 297 output = &RegisterUsageOutput{} 298 req = c.newRequest(op, input, output) 299 return 300 } 301 302 // RegisterUsage API operation for AWSMarketplace Metering. 303 // 304 // Paid container software products sold through AWS Marketplace must integrate 305 // with the AWS Marketplace Metering Service and call the RegisterUsage operation 306 // for software entitlement and metering. Free and BYOL products for Amazon 307 // ECS or Amazon EKS aren't required to call RegisterUsage, but you may choose 308 // to do so if you would like to receive usage data in your seller reports. 309 // The sections below explain the behavior of RegisterUsage. RegisterUsage performs 310 // two primary functions: metering and entitlement. 311 // 312 // * Entitlement: RegisterUsage allows you to verify that the customer running 313 // your paid software is subscribed to your product on AWS Marketplace, enabling 314 // you to guard against unauthorized use. Your container image that integrates 315 // with RegisterUsage is only required to guard against unauthorized use 316 // at container startup, as such a CustomerNotSubscribedException/PlatformNotSupportedException 317 // will only be thrown on the initial call to RegisterUsage. Subsequent calls 318 // from the same Amazon ECS task instance (e.g. task-id) or Amazon EKS pod 319 // will not throw a CustomerNotSubscribedException, even if the customer 320 // unsubscribes while the Amazon ECS task or Amazon EKS pod is still running. 321 // 322 // * Metering: RegisterUsage meters software use per ECS task, per hour, 323 // or per pod for Amazon EKS with usage prorated to the second. A minimum 324 // of 1 minute of usage applies to tasks that are short lived. For example, 325 // if a customer has a 10 node Amazon ECS or Amazon EKS cluster and a service 326 // configured as a Daemon Set, then Amazon ECS or Amazon EKS will launch 327 // a task on all 10 cluster nodes and the customer will be charged: (10 * 328 // hourly_rate). Metering for software use is automatically handled by the 329 // AWS Marketplace Metering Control Plane -- your software is not required 330 // to perform any metering specific actions, other than call RegisterUsage 331 // once for metering of software use to commence. The AWS Marketplace Metering 332 // Control Plane will also continue to bill customers for running ECS tasks 333 // and Amazon EKS pods, regardless of the customers subscription state, removing 334 // the need for your software to perform entitlement checks at runtime. 335 // 336 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 337 // with awserr.Error's Code and Message methods to get detailed information about 338 // the error. 339 // 340 // See the AWS API reference guide for AWSMarketplace Metering's 341 // API operation RegisterUsage for usage and error information. 342 // 343 // Returned Error Types: 344 // * InvalidProductCodeException 345 // The product code passed does not match the product code used for publishing 346 // the product. 347 // 348 // * InvalidRegionException 349 // RegisterUsage must be called in the same AWS Region the ECS task was launched 350 // in. This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”) 351 // when calling RegisterUsage. 352 // 353 // * InvalidPublicKeyVersionException 354 // Public Key version is invalid. 355 // 356 // * PlatformNotSupportedException 357 // AWS Marketplace does not support metering usage from the underlying platform. 358 // Currently, Amazon ECS, Amazon EKS, and AWS Fargate are supported. 359 // 360 // * CustomerNotEntitledException 361 // Exception thrown when the customer does not have a valid subscription for 362 // the product. 363 // 364 // * ThrottlingException 365 // The calls to the API are throttled. 366 // 367 // * InternalServiceErrorException 368 // An internal error has occurred. Retry your request. If the problem persists, 369 // post a message with details on the AWS forums. 370 // 371 // * DisabledApiException 372 // The API is disabled in the Region. 373 // 374 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/RegisterUsage 375 func (c *MarketplaceMetering) RegisterUsage(input *RegisterUsageInput) (*RegisterUsageOutput, error) { 376 req, out := c.RegisterUsageRequest(input) 377 return out, req.Send() 378 } 379 380 // RegisterUsageWithContext is the same as RegisterUsage with the addition of 381 // the ability to pass a context and additional request options. 382 // 383 // See RegisterUsage for details on how to use this API operation. 384 // 385 // The context must be non-nil and will be used for request cancellation. If 386 // the context is nil a panic will occur. In the future the SDK may create 387 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 388 // for more information on using Contexts. 389 func (c *MarketplaceMetering) RegisterUsageWithContext(ctx aws.Context, input *RegisterUsageInput, opts ...request.Option) (*RegisterUsageOutput, error) { 390 req, out := c.RegisterUsageRequest(input) 391 req.SetContext(ctx) 392 req.ApplyOptions(opts...) 393 return out, req.Send() 394 } 395 396 const opResolveCustomer = "ResolveCustomer" 397 398 // ResolveCustomerRequest generates a "aws/request.Request" representing the 399 // client's request for the ResolveCustomer operation. The "output" return 400 // value will be populated with the request's response once the request completes 401 // successfully. 402 // 403 // Use "Send" method on the returned Request to send the API call to the service. 404 // the "output" return value is not valid until after Send returns without error. 405 // 406 // See ResolveCustomer for more information on using the ResolveCustomer 407 // API call, and error handling. 408 // 409 // This method is useful when you want to inject custom logic or configuration 410 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 411 // 412 // 413 // // Example sending a request using the ResolveCustomerRequest method. 414 // req, resp := client.ResolveCustomerRequest(params) 415 // 416 // err := req.Send() 417 // if err == nil { // resp is now filled 418 // fmt.Println(resp) 419 // } 420 // 421 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomer 422 func (c *MarketplaceMetering) ResolveCustomerRequest(input *ResolveCustomerInput) (req *request.Request, output *ResolveCustomerOutput) { 423 op := &request.Operation{ 424 Name: opResolveCustomer, 425 HTTPMethod: "POST", 426 HTTPPath: "/", 427 } 428 429 if input == nil { 430 input = &ResolveCustomerInput{} 431 } 432 433 output = &ResolveCustomerOutput{} 434 req = c.newRequest(op, input, output) 435 return 436 } 437 438 // ResolveCustomer API operation for AWSMarketplace Metering. 439 // 440 // ResolveCustomer is called by a SaaS application during the registration process. 441 // When a buyer visits your website during the registration process, the buyer 442 // submits a registration token through their browser. The registration token 443 // is resolved through this API to obtain a CustomerIdentifier and product code. 444 // 445 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 446 // with awserr.Error's Code and Message methods to get detailed information about 447 // the error. 448 // 449 // See the AWS API reference guide for AWSMarketplace Metering's 450 // API operation ResolveCustomer for usage and error information. 451 // 452 // Returned Error Types: 453 // * InvalidTokenException 454 // Registration token is invalid. 455 // 456 // * ExpiredTokenException 457 // The submitted registration token has expired. This can happen if the buyer's 458 // browser takes too long to redirect to your page, the buyer has resubmitted 459 // the registration token, or your application has held on to the registration 460 // token for too long. Your SaaS registration website should redeem this token 461 // as soon as it is submitted by the buyer's browser. 462 // 463 // * ThrottlingException 464 // The calls to the API are throttled. 465 // 466 // * InternalServiceErrorException 467 // An internal error has occurred. Retry your request. If the problem persists, 468 // post a message with details on the AWS forums. 469 // 470 // * DisabledApiException 471 // The API is disabled in the Region. 472 // 473 // See also, https://docs.aws.amazon.com/goto/WebAPI/meteringmarketplace-2016-01-14/ResolveCustomer 474 func (c *MarketplaceMetering) ResolveCustomer(input *ResolveCustomerInput) (*ResolveCustomerOutput, error) { 475 req, out := c.ResolveCustomerRequest(input) 476 return out, req.Send() 477 } 478 479 // ResolveCustomerWithContext is the same as ResolveCustomer with the addition of 480 // the ability to pass a context and additional request options. 481 // 482 // See ResolveCustomer for details on how to use this API operation. 483 // 484 // The context must be non-nil and will be used for request cancellation. If 485 // the context is nil a panic will occur. In the future the SDK may create 486 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 487 // for more information on using Contexts. 488 func (c *MarketplaceMetering) ResolveCustomerWithContext(ctx aws.Context, input *ResolveCustomerInput, opts ...request.Option) (*ResolveCustomerOutput, error) { 489 req, out := c.ResolveCustomerRequest(input) 490 req.SetContext(ctx) 491 req.ApplyOptions(opts...) 492 return out, req.Send() 493 } 494 495 // A BatchMeterUsageRequest contains UsageRecords, which indicate quantities 496 // of usage within your application. 497 type BatchMeterUsageInput struct { 498 _ struct{} `type:"structure"` 499 500 // Product code is used to uniquely identify a product in AWS Marketplace. The 501 // product code should be the same as the one used during the publishing of 502 // a new product. 503 // 504 // ProductCode is a required field 505 ProductCode *string `min:"1" type:"string" required:"true"` 506 507 // The set of UsageRecords to submit. BatchMeterUsage accepts up to 25 UsageRecords 508 // at a time. 509 // 510 // UsageRecords is a required field 511 UsageRecords []*UsageRecord `type:"list" required:"true"` 512 } 513 514 // String returns the string representation. 515 // 516 // API parameter values that are decorated as "sensitive" in the API will not 517 // be included in the string output. The member name will be present, but the 518 // value will be replaced with "sensitive". 519 func (s BatchMeterUsageInput) String() string { 520 return awsutil.Prettify(s) 521 } 522 523 // GoString returns the string representation. 524 // 525 // API parameter values that are decorated as "sensitive" in the API will not 526 // be included in the string output. The member name will be present, but the 527 // value will be replaced with "sensitive". 528 func (s BatchMeterUsageInput) GoString() string { 529 return s.String() 530 } 531 532 // Validate inspects the fields of the type to determine if they are valid. 533 func (s *BatchMeterUsageInput) Validate() error { 534 invalidParams := request.ErrInvalidParams{Context: "BatchMeterUsageInput"} 535 if s.ProductCode == nil { 536 invalidParams.Add(request.NewErrParamRequired("ProductCode")) 537 } 538 if s.ProductCode != nil && len(*s.ProductCode) < 1 { 539 invalidParams.Add(request.NewErrParamMinLen("ProductCode", 1)) 540 } 541 if s.UsageRecords == nil { 542 invalidParams.Add(request.NewErrParamRequired("UsageRecords")) 543 } 544 if s.UsageRecords != nil { 545 for i, v := range s.UsageRecords { 546 if v == nil { 547 continue 548 } 549 if err := v.Validate(); err != nil { 550 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UsageRecords", i), err.(request.ErrInvalidParams)) 551 } 552 } 553 } 554 555 if invalidParams.Len() > 0 { 556 return invalidParams 557 } 558 return nil 559 } 560 561 // SetProductCode sets the ProductCode field's value. 562 func (s *BatchMeterUsageInput) SetProductCode(v string) *BatchMeterUsageInput { 563 s.ProductCode = &v 564 return s 565 } 566 567 // SetUsageRecords sets the UsageRecords field's value. 568 func (s *BatchMeterUsageInput) SetUsageRecords(v []*UsageRecord) *BatchMeterUsageInput { 569 s.UsageRecords = v 570 return s 571 } 572 573 // Contains the UsageRecords processed by BatchMeterUsage and any records that 574 // have failed due to transient error. 575 type BatchMeterUsageOutput struct { 576 _ struct{} `type:"structure"` 577 578 // Contains all UsageRecords processed by BatchMeterUsage. These records were 579 // either honored by AWS Marketplace Metering Service or were invalid. 580 Results []*UsageRecordResult `type:"list"` 581 582 // Contains all UsageRecords that were not processed by BatchMeterUsage. This 583 // is a list of UsageRecords. You can retry the failed request by making another 584 // BatchMeterUsage call with this list as input in the BatchMeterUsageRequest. 585 UnprocessedRecords []*UsageRecord `type:"list"` 586 } 587 588 // String returns the string representation. 589 // 590 // API parameter values that are decorated as "sensitive" in the API will not 591 // be included in the string output. The member name will be present, but the 592 // value will be replaced with "sensitive". 593 func (s BatchMeterUsageOutput) String() string { 594 return awsutil.Prettify(s) 595 } 596 597 // GoString returns the string representation. 598 // 599 // API parameter values that are decorated as "sensitive" in the API will not 600 // be included in the string output. The member name will be present, but the 601 // value will be replaced with "sensitive". 602 func (s BatchMeterUsageOutput) GoString() string { 603 return s.String() 604 } 605 606 // SetResults sets the Results field's value. 607 func (s *BatchMeterUsageOutput) SetResults(v []*UsageRecordResult) *BatchMeterUsageOutput { 608 s.Results = v 609 return s 610 } 611 612 // SetUnprocessedRecords sets the UnprocessedRecords field's value. 613 func (s *BatchMeterUsageOutput) SetUnprocessedRecords(v []*UsageRecord) *BatchMeterUsageOutput { 614 s.UnprocessedRecords = v 615 return s 616 } 617 618 // Exception thrown when the customer does not have a valid subscription for 619 // the product. 620 type CustomerNotEntitledException struct { 621 _ struct{} `type:"structure"` 622 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 623 624 Message_ *string `locationName:"message" type:"string"` 625 } 626 627 // String returns the string representation. 628 // 629 // API parameter values that are decorated as "sensitive" in the API will not 630 // be included in the string output. The member name will be present, but the 631 // value will be replaced with "sensitive". 632 func (s CustomerNotEntitledException) String() string { 633 return awsutil.Prettify(s) 634 } 635 636 // GoString returns the string representation. 637 // 638 // API parameter values that are decorated as "sensitive" in the API will not 639 // be included in the string output. The member name will be present, but the 640 // value will be replaced with "sensitive". 641 func (s CustomerNotEntitledException) GoString() string { 642 return s.String() 643 } 644 645 func newErrorCustomerNotEntitledException(v protocol.ResponseMetadata) error { 646 return &CustomerNotEntitledException{ 647 RespMetadata: v, 648 } 649 } 650 651 // Code returns the exception type name. 652 func (s *CustomerNotEntitledException) Code() string { 653 return "CustomerNotEntitledException" 654 } 655 656 // Message returns the exception's message. 657 func (s *CustomerNotEntitledException) Message() string { 658 if s.Message_ != nil { 659 return *s.Message_ 660 } 661 return "" 662 } 663 664 // OrigErr always returns nil, satisfies awserr.Error interface. 665 func (s *CustomerNotEntitledException) OrigErr() error { 666 return nil 667 } 668 669 func (s *CustomerNotEntitledException) Error() string { 670 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 671 } 672 673 // Status code returns the HTTP status code for the request's response error. 674 func (s *CustomerNotEntitledException) StatusCode() int { 675 return s.RespMetadata.StatusCode 676 } 677 678 // RequestID returns the service's response RequestID for request. 679 func (s *CustomerNotEntitledException) RequestID() string { 680 return s.RespMetadata.RequestID 681 } 682 683 // The API is disabled in the Region. 684 type DisabledApiException struct { 685 _ struct{} `type:"structure"` 686 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 687 688 Message_ *string `locationName:"message" type:"string"` 689 } 690 691 // String returns the string representation. 692 // 693 // API parameter values that are decorated as "sensitive" in the API will not 694 // be included in the string output. The member name will be present, but the 695 // value will be replaced with "sensitive". 696 func (s DisabledApiException) String() string { 697 return awsutil.Prettify(s) 698 } 699 700 // GoString returns the string representation. 701 // 702 // API parameter values that are decorated as "sensitive" in the API will not 703 // be included in the string output. The member name will be present, but the 704 // value will be replaced with "sensitive". 705 func (s DisabledApiException) GoString() string { 706 return s.String() 707 } 708 709 func newErrorDisabledApiException(v protocol.ResponseMetadata) error { 710 return &DisabledApiException{ 711 RespMetadata: v, 712 } 713 } 714 715 // Code returns the exception type name. 716 func (s *DisabledApiException) Code() string { 717 return "DisabledApiException" 718 } 719 720 // Message returns the exception's message. 721 func (s *DisabledApiException) Message() string { 722 if s.Message_ != nil { 723 return *s.Message_ 724 } 725 return "" 726 } 727 728 // OrigErr always returns nil, satisfies awserr.Error interface. 729 func (s *DisabledApiException) OrigErr() error { 730 return nil 731 } 732 733 func (s *DisabledApiException) Error() string { 734 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 735 } 736 737 // Status code returns the HTTP status code for the request's response error. 738 func (s *DisabledApiException) StatusCode() int { 739 return s.RespMetadata.StatusCode 740 } 741 742 // RequestID returns the service's response RequestID for request. 743 func (s *DisabledApiException) RequestID() string { 744 return s.RespMetadata.RequestID 745 } 746 747 // A metering record has already been emitted by the same EC2 instance, ECS 748 // task, or EKS pod for the given {usageDimension, timestamp} with a different 749 // usageQuantity. 750 type DuplicateRequestException struct { 751 _ struct{} `type:"structure"` 752 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 753 754 Message_ *string `locationName:"message" type:"string"` 755 } 756 757 // String returns the string representation. 758 // 759 // API parameter values that are decorated as "sensitive" in the API will not 760 // be included in the string output. The member name will be present, but the 761 // value will be replaced with "sensitive". 762 func (s DuplicateRequestException) String() string { 763 return awsutil.Prettify(s) 764 } 765 766 // GoString returns the string representation. 767 // 768 // API parameter values that are decorated as "sensitive" in the API will not 769 // be included in the string output. The member name will be present, but the 770 // value will be replaced with "sensitive". 771 func (s DuplicateRequestException) GoString() string { 772 return s.String() 773 } 774 775 func newErrorDuplicateRequestException(v protocol.ResponseMetadata) error { 776 return &DuplicateRequestException{ 777 RespMetadata: v, 778 } 779 } 780 781 // Code returns the exception type name. 782 func (s *DuplicateRequestException) Code() string { 783 return "DuplicateRequestException" 784 } 785 786 // Message returns the exception's message. 787 func (s *DuplicateRequestException) Message() string { 788 if s.Message_ != nil { 789 return *s.Message_ 790 } 791 return "" 792 } 793 794 // OrigErr always returns nil, satisfies awserr.Error interface. 795 func (s *DuplicateRequestException) OrigErr() error { 796 return nil 797 } 798 799 func (s *DuplicateRequestException) Error() string { 800 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 801 } 802 803 // Status code returns the HTTP status code for the request's response error. 804 func (s *DuplicateRequestException) StatusCode() int { 805 return s.RespMetadata.StatusCode 806 } 807 808 // RequestID returns the service's response RequestID for request. 809 func (s *DuplicateRequestException) RequestID() string { 810 return s.RespMetadata.RequestID 811 } 812 813 // The submitted registration token has expired. This can happen if the buyer's 814 // browser takes too long to redirect to your page, the buyer has resubmitted 815 // the registration token, or your application has held on to the registration 816 // token for too long. Your SaaS registration website should redeem this token 817 // as soon as it is submitted by the buyer's browser. 818 type ExpiredTokenException struct { 819 _ struct{} `type:"structure"` 820 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 821 822 Message_ *string `locationName:"message" type:"string"` 823 } 824 825 // String returns the string representation. 826 // 827 // API parameter values that are decorated as "sensitive" in the API will not 828 // be included in the string output. The member name will be present, but the 829 // value will be replaced with "sensitive". 830 func (s ExpiredTokenException) String() string { 831 return awsutil.Prettify(s) 832 } 833 834 // GoString returns the string representation. 835 // 836 // API parameter values that are decorated as "sensitive" in the API will not 837 // be included in the string output. The member name will be present, but the 838 // value will be replaced with "sensitive". 839 func (s ExpiredTokenException) GoString() string { 840 return s.String() 841 } 842 843 func newErrorExpiredTokenException(v protocol.ResponseMetadata) error { 844 return &ExpiredTokenException{ 845 RespMetadata: v, 846 } 847 } 848 849 // Code returns the exception type name. 850 func (s *ExpiredTokenException) Code() string { 851 return "ExpiredTokenException" 852 } 853 854 // Message returns the exception's message. 855 func (s *ExpiredTokenException) Message() string { 856 if s.Message_ != nil { 857 return *s.Message_ 858 } 859 return "" 860 } 861 862 // OrigErr always returns nil, satisfies awserr.Error interface. 863 func (s *ExpiredTokenException) OrigErr() error { 864 return nil 865 } 866 867 func (s *ExpiredTokenException) Error() string { 868 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 869 } 870 871 // Status code returns the HTTP status code for the request's response error. 872 func (s *ExpiredTokenException) StatusCode() int { 873 return s.RespMetadata.StatusCode 874 } 875 876 // RequestID returns the service's response RequestID for request. 877 func (s *ExpiredTokenException) RequestID() string { 878 return s.RespMetadata.RequestID 879 } 880 881 // An internal error has occurred. Retry your request. If the problem persists, 882 // post a message with details on the AWS forums. 883 type InternalServiceErrorException struct { 884 _ struct{} `type:"structure"` 885 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 886 887 Message_ *string `locationName:"message" type:"string"` 888 } 889 890 // String returns the string representation. 891 // 892 // API parameter values that are decorated as "sensitive" in the API will not 893 // be included in the string output. The member name will be present, but the 894 // value will be replaced with "sensitive". 895 func (s InternalServiceErrorException) String() string { 896 return awsutil.Prettify(s) 897 } 898 899 // GoString returns the string representation. 900 // 901 // API parameter values that are decorated as "sensitive" in the API will not 902 // be included in the string output. The member name will be present, but the 903 // value will be replaced with "sensitive". 904 func (s InternalServiceErrorException) GoString() string { 905 return s.String() 906 } 907 908 func newErrorInternalServiceErrorException(v protocol.ResponseMetadata) error { 909 return &InternalServiceErrorException{ 910 RespMetadata: v, 911 } 912 } 913 914 // Code returns the exception type name. 915 func (s *InternalServiceErrorException) Code() string { 916 return "InternalServiceErrorException" 917 } 918 919 // Message returns the exception's message. 920 func (s *InternalServiceErrorException) Message() string { 921 if s.Message_ != nil { 922 return *s.Message_ 923 } 924 return "" 925 } 926 927 // OrigErr always returns nil, satisfies awserr.Error interface. 928 func (s *InternalServiceErrorException) OrigErr() error { 929 return nil 930 } 931 932 func (s *InternalServiceErrorException) Error() string { 933 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 934 } 935 936 // Status code returns the HTTP status code for the request's response error. 937 func (s *InternalServiceErrorException) StatusCode() int { 938 return s.RespMetadata.StatusCode 939 } 940 941 // RequestID returns the service's response RequestID for request. 942 func (s *InternalServiceErrorException) RequestID() string { 943 return s.RespMetadata.RequestID 944 } 945 946 // You have metered usage for a CustomerIdentifier that does not exist. 947 type InvalidCustomerIdentifierException struct { 948 _ struct{} `type:"structure"` 949 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 950 951 Message_ *string `locationName:"message" type:"string"` 952 } 953 954 // String returns the string representation. 955 // 956 // API parameter values that are decorated as "sensitive" in the API will not 957 // be included in the string output. The member name will be present, but the 958 // value will be replaced with "sensitive". 959 func (s InvalidCustomerIdentifierException) String() string { 960 return awsutil.Prettify(s) 961 } 962 963 // GoString returns the string representation. 964 // 965 // API parameter values that are decorated as "sensitive" in the API will not 966 // be included in the string output. The member name will be present, but the 967 // value will be replaced with "sensitive". 968 func (s InvalidCustomerIdentifierException) GoString() string { 969 return s.String() 970 } 971 972 func newErrorInvalidCustomerIdentifierException(v protocol.ResponseMetadata) error { 973 return &InvalidCustomerIdentifierException{ 974 RespMetadata: v, 975 } 976 } 977 978 // Code returns the exception type name. 979 func (s *InvalidCustomerIdentifierException) Code() string { 980 return "InvalidCustomerIdentifierException" 981 } 982 983 // Message returns the exception's message. 984 func (s *InvalidCustomerIdentifierException) Message() string { 985 if s.Message_ != nil { 986 return *s.Message_ 987 } 988 return "" 989 } 990 991 // OrigErr always returns nil, satisfies awserr.Error interface. 992 func (s *InvalidCustomerIdentifierException) OrigErr() error { 993 return nil 994 } 995 996 func (s *InvalidCustomerIdentifierException) Error() string { 997 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 998 } 999 1000 // Status code returns the HTTP status code for the request's response error. 1001 func (s *InvalidCustomerIdentifierException) StatusCode() int { 1002 return s.RespMetadata.StatusCode 1003 } 1004 1005 // RequestID returns the service's response RequestID for request. 1006 func (s *InvalidCustomerIdentifierException) RequestID() string { 1007 return s.RespMetadata.RequestID 1008 } 1009 1010 // The endpoint being called is in a AWS Region different from your EC2 instance, 1011 // ECS task, or EKS pod. The Region of the Metering Service endpoint and the 1012 // AWS Region of the resource must match. 1013 type InvalidEndpointRegionException struct { 1014 _ struct{} `type:"structure"` 1015 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1016 1017 Message_ *string `locationName:"message" type:"string"` 1018 } 1019 1020 // String returns the string representation. 1021 // 1022 // API parameter values that are decorated as "sensitive" in the API will not 1023 // be included in the string output. The member name will be present, but the 1024 // value will be replaced with "sensitive". 1025 func (s InvalidEndpointRegionException) String() string { 1026 return awsutil.Prettify(s) 1027 } 1028 1029 // GoString returns the string representation. 1030 // 1031 // API parameter values that are decorated as "sensitive" in the API will not 1032 // be included in the string output. The member name will be present, but the 1033 // value will be replaced with "sensitive". 1034 func (s InvalidEndpointRegionException) GoString() string { 1035 return s.String() 1036 } 1037 1038 func newErrorInvalidEndpointRegionException(v protocol.ResponseMetadata) error { 1039 return &InvalidEndpointRegionException{ 1040 RespMetadata: v, 1041 } 1042 } 1043 1044 // Code returns the exception type name. 1045 func (s *InvalidEndpointRegionException) Code() string { 1046 return "InvalidEndpointRegionException" 1047 } 1048 1049 // Message returns the exception's message. 1050 func (s *InvalidEndpointRegionException) Message() string { 1051 if s.Message_ != nil { 1052 return *s.Message_ 1053 } 1054 return "" 1055 } 1056 1057 // OrigErr always returns nil, satisfies awserr.Error interface. 1058 func (s *InvalidEndpointRegionException) OrigErr() error { 1059 return nil 1060 } 1061 1062 func (s *InvalidEndpointRegionException) Error() string { 1063 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1064 } 1065 1066 // Status code returns the HTTP status code for the request's response error. 1067 func (s *InvalidEndpointRegionException) StatusCode() int { 1068 return s.RespMetadata.StatusCode 1069 } 1070 1071 // RequestID returns the service's response RequestID for request. 1072 func (s *InvalidEndpointRegionException) RequestID() string { 1073 return s.RespMetadata.RequestID 1074 } 1075 1076 // The product code passed does not match the product code used for publishing 1077 // the product. 1078 type InvalidProductCodeException struct { 1079 _ struct{} `type:"structure"` 1080 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1081 1082 Message_ *string `locationName:"message" type:"string"` 1083 } 1084 1085 // String returns the string representation. 1086 // 1087 // API parameter values that are decorated as "sensitive" in the API will not 1088 // be included in the string output. The member name will be present, but the 1089 // value will be replaced with "sensitive". 1090 func (s InvalidProductCodeException) String() string { 1091 return awsutil.Prettify(s) 1092 } 1093 1094 // GoString returns the string representation. 1095 // 1096 // API parameter values that are decorated as "sensitive" in the API will not 1097 // be included in the string output. The member name will be present, but the 1098 // value will be replaced with "sensitive". 1099 func (s InvalidProductCodeException) GoString() string { 1100 return s.String() 1101 } 1102 1103 func newErrorInvalidProductCodeException(v protocol.ResponseMetadata) error { 1104 return &InvalidProductCodeException{ 1105 RespMetadata: v, 1106 } 1107 } 1108 1109 // Code returns the exception type name. 1110 func (s *InvalidProductCodeException) Code() string { 1111 return "InvalidProductCodeException" 1112 } 1113 1114 // Message returns the exception's message. 1115 func (s *InvalidProductCodeException) Message() string { 1116 if s.Message_ != nil { 1117 return *s.Message_ 1118 } 1119 return "" 1120 } 1121 1122 // OrigErr always returns nil, satisfies awserr.Error interface. 1123 func (s *InvalidProductCodeException) OrigErr() error { 1124 return nil 1125 } 1126 1127 func (s *InvalidProductCodeException) Error() string { 1128 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1129 } 1130 1131 // Status code returns the HTTP status code for the request's response error. 1132 func (s *InvalidProductCodeException) StatusCode() int { 1133 return s.RespMetadata.StatusCode 1134 } 1135 1136 // RequestID returns the service's response RequestID for request. 1137 func (s *InvalidProductCodeException) RequestID() string { 1138 return s.RespMetadata.RequestID 1139 } 1140 1141 // Public Key version is invalid. 1142 type InvalidPublicKeyVersionException struct { 1143 _ struct{} `type:"structure"` 1144 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1145 1146 Message_ *string `locationName:"message" type:"string"` 1147 } 1148 1149 // String returns the string representation. 1150 // 1151 // API parameter values that are decorated as "sensitive" in the API will not 1152 // be included in the string output. The member name will be present, but the 1153 // value will be replaced with "sensitive". 1154 func (s InvalidPublicKeyVersionException) String() string { 1155 return awsutil.Prettify(s) 1156 } 1157 1158 // GoString returns the string representation. 1159 // 1160 // API parameter values that are decorated as "sensitive" in the API will not 1161 // be included in the string output. The member name will be present, but the 1162 // value will be replaced with "sensitive". 1163 func (s InvalidPublicKeyVersionException) GoString() string { 1164 return s.String() 1165 } 1166 1167 func newErrorInvalidPublicKeyVersionException(v protocol.ResponseMetadata) error { 1168 return &InvalidPublicKeyVersionException{ 1169 RespMetadata: v, 1170 } 1171 } 1172 1173 // Code returns the exception type name. 1174 func (s *InvalidPublicKeyVersionException) Code() string { 1175 return "InvalidPublicKeyVersionException" 1176 } 1177 1178 // Message returns the exception's message. 1179 func (s *InvalidPublicKeyVersionException) Message() string { 1180 if s.Message_ != nil { 1181 return *s.Message_ 1182 } 1183 return "" 1184 } 1185 1186 // OrigErr always returns nil, satisfies awserr.Error interface. 1187 func (s *InvalidPublicKeyVersionException) OrigErr() error { 1188 return nil 1189 } 1190 1191 func (s *InvalidPublicKeyVersionException) Error() string { 1192 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1193 } 1194 1195 // Status code returns the HTTP status code for the request's response error. 1196 func (s *InvalidPublicKeyVersionException) StatusCode() int { 1197 return s.RespMetadata.StatusCode 1198 } 1199 1200 // RequestID returns the service's response RequestID for request. 1201 func (s *InvalidPublicKeyVersionException) RequestID() string { 1202 return s.RespMetadata.RequestID 1203 } 1204 1205 // RegisterUsage must be called in the same AWS Region the ECS task was launched 1206 // in. This prevents a container from hardcoding a Region (e.g. withRegion(“us-east-1”) 1207 // when calling RegisterUsage. 1208 type InvalidRegionException struct { 1209 _ struct{} `type:"structure"` 1210 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1211 1212 Message_ *string `locationName:"message" type:"string"` 1213 } 1214 1215 // String returns the string representation. 1216 // 1217 // API parameter values that are decorated as "sensitive" in the API will not 1218 // be included in the string output. The member name will be present, but the 1219 // value will be replaced with "sensitive". 1220 func (s InvalidRegionException) String() string { 1221 return awsutil.Prettify(s) 1222 } 1223 1224 // GoString returns the string representation. 1225 // 1226 // API parameter values that are decorated as "sensitive" in the API will not 1227 // be included in the string output. The member name will be present, but the 1228 // value will be replaced with "sensitive". 1229 func (s InvalidRegionException) GoString() string { 1230 return s.String() 1231 } 1232 1233 func newErrorInvalidRegionException(v protocol.ResponseMetadata) error { 1234 return &InvalidRegionException{ 1235 RespMetadata: v, 1236 } 1237 } 1238 1239 // Code returns the exception type name. 1240 func (s *InvalidRegionException) Code() string { 1241 return "InvalidRegionException" 1242 } 1243 1244 // Message returns the exception's message. 1245 func (s *InvalidRegionException) Message() string { 1246 if s.Message_ != nil { 1247 return *s.Message_ 1248 } 1249 return "" 1250 } 1251 1252 // OrigErr always returns nil, satisfies awserr.Error interface. 1253 func (s *InvalidRegionException) OrigErr() error { 1254 return nil 1255 } 1256 1257 func (s *InvalidRegionException) Error() string { 1258 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1259 } 1260 1261 // Status code returns the HTTP status code for the request's response error. 1262 func (s *InvalidRegionException) StatusCode() int { 1263 return s.RespMetadata.StatusCode 1264 } 1265 1266 // RequestID returns the service's response RequestID for request. 1267 func (s *InvalidRegionException) RequestID() string { 1268 return s.RespMetadata.RequestID 1269 } 1270 1271 // The tag is invalid, or the number of tags is greater than 5. 1272 type InvalidTagException struct { 1273 _ struct{} `type:"structure"` 1274 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1275 1276 Message_ *string `locationName:"message" type:"string"` 1277 } 1278 1279 // String returns the string representation. 1280 // 1281 // API parameter values that are decorated as "sensitive" in the API will not 1282 // be included in the string output. The member name will be present, but the 1283 // value will be replaced with "sensitive". 1284 func (s InvalidTagException) String() string { 1285 return awsutil.Prettify(s) 1286 } 1287 1288 // GoString returns the string representation. 1289 // 1290 // API parameter values that are decorated as "sensitive" in the API will not 1291 // be included in the string output. The member name will be present, but the 1292 // value will be replaced with "sensitive". 1293 func (s InvalidTagException) GoString() string { 1294 return s.String() 1295 } 1296 1297 func newErrorInvalidTagException(v protocol.ResponseMetadata) error { 1298 return &InvalidTagException{ 1299 RespMetadata: v, 1300 } 1301 } 1302 1303 // Code returns the exception type name. 1304 func (s *InvalidTagException) Code() string { 1305 return "InvalidTagException" 1306 } 1307 1308 // Message returns the exception's message. 1309 func (s *InvalidTagException) Message() string { 1310 if s.Message_ != nil { 1311 return *s.Message_ 1312 } 1313 return "" 1314 } 1315 1316 // OrigErr always returns nil, satisfies awserr.Error interface. 1317 func (s *InvalidTagException) OrigErr() error { 1318 return nil 1319 } 1320 1321 func (s *InvalidTagException) Error() string { 1322 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1323 } 1324 1325 // Status code returns the HTTP status code for the request's response error. 1326 func (s *InvalidTagException) StatusCode() int { 1327 return s.RespMetadata.StatusCode 1328 } 1329 1330 // RequestID returns the service's response RequestID for request. 1331 func (s *InvalidTagException) RequestID() string { 1332 return s.RespMetadata.RequestID 1333 } 1334 1335 // Registration token is invalid. 1336 type InvalidTokenException struct { 1337 _ struct{} `type:"structure"` 1338 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1339 1340 Message_ *string `locationName:"message" type:"string"` 1341 } 1342 1343 // String returns the string representation. 1344 // 1345 // API parameter values that are decorated as "sensitive" in the API will not 1346 // be included in the string output. The member name will be present, but the 1347 // value will be replaced with "sensitive". 1348 func (s InvalidTokenException) String() string { 1349 return awsutil.Prettify(s) 1350 } 1351 1352 // GoString returns the string representation. 1353 // 1354 // API parameter values that are decorated as "sensitive" in the API will not 1355 // be included in the string output. The member name will be present, but the 1356 // value will be replaced with "sensitive". 1357 func (s InvalidTokenException) GoString() string { 1358 return s.String() 1359 } 1360 1361 func newErrorInvalidTokenException(v protocol.ResponseMetadata) error { 1362 return &InvalidTokenException{ 1363 RespMetadata: v, 1364 } 1365 } 1366 1367 // Code returns the exception type name. 1368 func (s *InvalidTokenException) Code() string { 1369 return "InvalidTokenException" 1370 } 1371 1372 // Message returns the exception's message. 1373 func (s *InvalidTokenException) Message() string { 1374 if s.Message_ != nil { 1375 return *s.Message_ 1376 } 1377 return "" 1378 } 1379 1380 // OrigErr always returns nil, satisfies awserr.Error interface. 1381 func (s *InvalidTokenException) OrigErr() error { 1382 return nil 1383 } 1384 1385 func (s *InvalidTokenException) Error() string { 1386 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1387 } 1388 1389 // Status code returns the HTTP status code for the request's response error. 1390 func (s *InvalidTokenException) StatusCode() int { 1391 return s.RespMetadata.StatusCode 1392 } 1393 1394 // RequestID returns the service's response RequestID for request. 1395 func (s *InvalidTokenException) RequestID() string { 1396 return s.RespMetadata.RequestID 1397 } 1398 1399 // The usage allocation objects are invalid, or the number of allocations is 1400 // greater than 500 for a single usage record. 1401 type InvalidUsageAllocationsException struct { 1402 _ struct{} `type:"structure"` 1403 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1404 1405 Message_ *string `locationName:"message" type:"string"` 1406 } 1407 1408 // String returns the string representation. 1409 // 1410 // API parameter values that are decorated as "sensitive" in the API will not 1411 // be included in the string output. The member name will be present, but the 1412 // value will be replaced with "sensitive". 1413 func (s InvalidUsageAllocationsException) String() string { 1414 return awsutil.Prettify(s) 1415 } 1416 1417 // GoString returns the string representation. 1418 // 1419 // API parameter values that are decorated as "sensitive" in the API will not 1420 // be included in the string output. The member name will be present, but the 1421 // value will be replaced with "sensitive". 1422 func (s InvalidUsageAllocationsException) GoString() string { 1423 return s.String() 1424 } 1425 1426 func newErrorInvalidUsageAllocationsException(v protocol.ResponseMetadata) error { 1427 return &InvalidUsageAllocationsException{ 1428 RespMetadata: v, 1429 } 1430 } 1431 1432 // Code returns the exception type name. 1433 func (s *InvalidUsageAllocationsException) Code() string { 1434 return "InvalidUsageAllocationsException" 1435 } 1436 1437 // Message returns the exception's message. 1438 func (s *InvalidUsageAllocationsException) Message() string { 1439 if s.Message_ != nil { 1440 return *s.Message_ 1441 } 1442 return "" 1443 } 1444 1445 // OrigErr always returns nil, satisfies awserr.Error interface. 1446 func (s *InvalidUsageAllocationsException) OrigErr() error { 1447 return nil 1448 } 1449 1450 func (s *InvalidUsageAllocationsException) Error() string { 1451 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1452 } 1453 1454 // Status code returns the HTTP status code for the request's response error. 1455 func (s *InvalidUsageAllocationsException) StatusCode() int { 1456 return s.RespMetadata.StatusCode 1457 } 1458 1459 // RequestID returns the service's response RequestID for request. 1460 func (s *InvalidUsageAllocationsException) RequestID() string { 1461 return s.RespMetadata.RequestID 1462 } 1463 1464 // The usage dimension does not match one of the UsageDimensions associated 1465 // with products. 1466 type InvalidUsageDimensionException struct { 1467 _ struct{} `type:"structure"` 1468 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1469 1470 Message_ *string `locationName:"message" type:"string"` 1471 } 1472 1473 // String returns the string representation. 1474 // 1475 // API parameter values that are decorated as "sensitive" in the API will not 1476 // be included in the string output. The member name will be present, but the 1477 // value will be replaced with "sensitive". 1478 func (s InvalidUsageDimensionException) String() string { 1479 return awsutil.Prettify(s) 1480 } 1481 1482 // GoString returns the string representation. 1483 // 1484 // API parameter values that are decorated as "sensitive" in the API will not 1485 // be included in the string output. The member name will be present, but the 1486 // value will be replaced with "sensitive". 1487 func (s InvalidUsageDimensionException) GoString() string { 1488 return s.String() 1489 } 1490 1491 func newErrorInvalidUsageDimensionException(v protocol.ResponseMetadata) error { 1492 return &InvalidUsageDimensionException{ 1493 RespMetadata: v, 1494 } 1495 } 1496 1497 // Code returns the exception type name. 1498 func (s *InvalidUsageDimensionException) Code() string { 1499 return "InvalidUsageDimensionException" 1500 } 1501 1502 // Message returns the exception's message. 1503 func (s *InvalidUsageDimensionException) Message() string { 1504 if s.Message_ != nil { 1505 return *s.Message_ 1506 } 1507 return "" 1508 } 1509 1510 // OrigErr always returns nil, satisfies awserr.Error interface. 1511 func (s *InvalidUsageDimensionException) OrigErr() error { 1512 return nil 1513 } 1514 1515 func (s *InvalidUsageDimensionException) Error() string { 1516 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1517 } 1518 1519 // Status code returns the HTTP status code for the request's response error. 1520 func (s *InvalidUsageDimensionException) StatusCode() int { 1521 return s.RespMetadata.StatusCode 1522 } 1523 1524 // RequestID returns the service's response RequestID for request. 1525 func (s *InvalidUsageDimensionException) RequestID() string { 1526 return s.RespMetadata.RequestID 1527 } 1528 1529 type MeterUsageInput struct { 1530 _ struct{} `type:"structure"` 1531 1532 // Checks whether you have the permissions required for the action, but does 1533 // not make the request. If you have the permissions, the request returns DryRunOperation; 1534 // otherwise, it returns UnauthorizedException. Defaults to false if not specified. 1535 DryRun *bool `type:"boolean"` 1536 1537 // Product code is used to uniquely identify a product in AWS Marketplace. The 1538 // product code should be the same as the one used during the publishing of 1539 // a new product. 1540 // 1541 // ProductCode is a required field 1542 ProductCode *string `min:"1" type:"string" required:"true"` 1543 1544 // Timestamp, in UTC, for which the usage is being reported. Your application 1545 // can meter usage for up to one hour in the past. Make sure the timestamp value 1546 // is not before the start of the software usage. 1547 // 1548 // Timestamp is a required field 1549 Timestamp *time.Time `type:"timestamp" required:"true"` 1550 1551 // The set of UsageAllocations to submit. 1552 // 1553 // The sum of all UsageAllocation quantities must equal the UsageQuantity of 1554 // the MeterUsage request, and each UsageAllocation must have a unique set of 1555 // tags (include no tags). 1556 UsageAllocations []*UsageAllocation `min:"1" type:"list"` 1557 1558 // It will be one of the fcp dimension name provided during the publishing of 1559 // the product. 1560 // 1561 // UsageDimension is a required field 1562 UsageDimension *string `min:"1" type:"string" required:"true"` 1563 1564 // Consumption value for the hour. Defaults to 0 if not specified. 1565 UsageQuantity *int64 `type:"integer"` 1566 } 1567 1568 // String returns the string representation. 1569 // 1570 // API parameter values that are decorated as "sensitive" in the API will not 1571 // be included in the string output. The member name will be present, but the 1572 // value will be replaced with "sensitive". 1573 func (s MeterUsageInput) String() string { 1574 return awsutil.Prettify(s) 1575 } 1576 1577 // GoString returns the string representation. 1578 // 1579 // API parameter values that are decorated as "sensitive" in the API will not 1580 // be included in the string output. The member name will be present, but the 1581 // value will be replaced with "sensitive". 1582 func (s MeterUsageInput) GoString() string { 1583 return s.String() 1584 } 1585 1586 // Validate inspects the fields of the type to determine if they are valid. 1587 func (s *MeterUsageInput) Validate() error { 1588 invalidParams := request.ErrInvalidParams{Context: "MeterUsageInput"} 1589 if s.ProductCode == nil { 1590 invalidParams.Add(request.NewErrParamRequired("ProductCode")) 1591 } 1592 if s.ProductCode != nil && len(*s.ProductCode) < 1 { 1593 invalidParams.Add(request.NewErrParamMinLen("ProductCode", 1)) 1594 } 1595 if s.Timestamp == nil { 1596 invalidParams.Add(request.NewErrParamRequired("Timestamp")) 1597 } 1598 if s.UsageAllocations != nil && len(s.UsageAllocations) < 1 { 1599 invalidParams.Add(request.NewErrParamMinLen("UsageAllocations", 1)) 1600 } 1601 if s.UsageDimension == nil { 1602 invalidParams.Add(request.NewErrParamRequired("UsageDimension")) 1603 } 1604 if s.UsageDimension != nil && len(*s.UsageDimension) < 1 { 1605 invalidParams.Add(request.NewErrParamMinLen("UsageDimension", 1)) 1606 } 1607 if s.UsageAllocations != nil { 1608 for i, v := range s.UsageAllocations { 1609 if v == nil { 1610 continue 1611 } 1612 if err := v.Validate(); err != nil { 1613 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UsageAllocations", i), err.(request.ErrInvalidParams)) 1614 } 1615 } 1616 } 1617 1618 if invalidParams.Len() > 0 { 1619 return invalidParams 1620 } 1621 return nil 1622 } 1623 1624 // SetDryRun sets the DryRun field's value. 1625 func (s *MeterUsageInput) SetDryRun(v bool) *MeterUsageInput { 1626 s.DryRun = &v 1627 return s 1628 } 1629 1630 // SetProductCode sets the ProductCode field's value. 1631 func (s *MeterUsageInput) SetProductCode(v string) *MeterUsageInput { 1632 s.ProductCode = &v 1633 return s 1634 } 1635 1636 // SetTimestamp sets the Timestamp field's value. 1637 func (s *MeterUsageInput) SetTimestamp(v time.Time) *MeterUsageInput { 1638 s.Timestamp = &v 1639 return s 1640 } 1641 1642 // SetUsageAllocations sets the UsageAllocations field's value. 1643 func (s *MeterUsageInput) SetUsageAllocations(v []*UsageAllocation) *MeterUsageInput { 1644 s.UsageAllocations = v 1645 return s 1646 } 1647 1648 // SetUsageDimension sets the UsageDimension field's value. 1649 func (s *MeterUsageInput) SetUsageDimension(v string) *MeterUsageInput { 1650 s.UsageDimension = &v 1651 return s 1652 } 1653 1654 // SetUsageQuantity sets the UsageQuantity field's value. 1655 func (s *MeterUsageInput) SetUsageQuantity(v int64) *MeterUsageInput { 1656 s.UsageQuantity = &v 1657 return s 1658 } 1659 1660 type MeterUsageOutput struct { 1661 _ struct{} `type:"structure"` 1662 1663 // Metering record id. 1664 MeteringRecordId *string `type:"string"` 1665 } 1666 1667 // String returns the string representation. 1668 // 1669 // API parameter values that are decorated as "sensitive" in the API will not 1670 // be included in the string output. The member name will be present, but the 1671 // value will be replaced with "sensitive". 1672 func (s MeterUsageOutput) String() string { 1673 return awsutil.Prettify(s) 1674 } 1675 1676 // GoString returns the string representation. 1677 // 1678 // API parameter values that are decorated as "sensitive" in the API will not 1679 // be included in the string output. The member name will be present, but the 1680 // value will be replaced with "sensitive". 1681 func (s MeterUsageOutput) GoString() string { 1682 return s.String() 1683 } 1684 1685 // SetMeteringRecordId sets the MeteringRecordId field's value. 1686 func (s *MeterUsageOutput) SetMeteringRecordId(v string) *MeterUsageOutput { 1687 s.MeteringRecordId = &v 1688 return s 1689 } 1690 1691 // AWS Marketplace does not support metering usage from the underlying platform. 1692 // Currently, Amazon ECS, Amazon EKS, and AWS Fargate are supported. 1693 type PlatformNotSupportedException struct { 1694 _ struct{} `type:"structure"` 1695 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1696 1697 Message_ *string `locationName:"message" type:"string"` 1698 } 1699 1700 // String returns the string representation. 1701 // 1702 // API parameter values that are decorated as "sensitive" in the API will not 1703 // be included in the string output. The member name will be present, but the 1704 // value will be replaced with "sensitive". 1705 func (s PlatformNotSupportedException) String() string { 1706 return awsutil.Prettify(s) 1707 } 1708 1709 // GoString returns the string representation. 1710 // 1711 // API parameter values that are decorated as "sensitive" in the API will not 1712 // be included in the string output. The member name will be present, but the 1713 // value will be replaced with "sensitive". 1714 func (s PlatformNotSupportedException) GoString() string { 1715 return s.String() 1716 } 1717 1718 func newErrorPlatformNotSupportedException(v protocol.ResponseMetadata) error { 1719 return &PlatformNotSupportedException{ 1720 RespMetadata: v, 1721 } 1722 } 1723 1724 // Code returns the exception type name. 1725 func (s *PlatformNotSupportedException) Code() string { 1726 return "PlatformNotSupportedException" 1727 } 1728 1729 // Message returns the exception's message. 1730 func (s *PlatformNotSupportedException) Message() string { 1731 if s.Message_ != nil { 1732 return *s.Message_ 1733 } 1734 return "" 1735 } 1736 1737 // OrigErr always returns nil, satisfies awserr.Error interface. 1738 func (s *PlatformNotSupportedException) OrigErr() error { 1739 return nil 1740 } 1741 1742 func (s *PlatformNotSupportedException) Error() string { 1743 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1744 } 1745 1746 // Status code returns the HTTP status code for the request's response error. 1747 func (s *PlatformNotSupportedException) StatusCode() int { 1748 return s.RespMetadata.StatusCode 1749 } 1750 1751 // RequestID returns the service's response RequestID for request. 1752 func (s *PlatformNotSupportedException) RequestID() string { 1753 return s.RespMetadata.RequestID 1754 } 1755 1756 type RegisterUsageInput struct { 1757 _ struct{} `type:"structure"` 1758 1759 // (Optional) To scope down the registration to a specific running software 1760 // instance and guard against replay attacks. 1761 Nonce *string `type:"string"` 1762 1763 // Product code is used to uniquely identify a product in AWS Marketplace. The 1764 // product code should be the same as the one used during the publishing of 1765 // a new product. 1766 // 1767 // ProductCode is a required field 1768 ProductCode *string `min:"1" type:"string" required:"true"` 1769 1770 // Public Key Version provided by AWS Marketplace 1771 // 1772 // PublicKeyVersion is a required field 1773 PublicKeyVersion *int64 `min:"1" type:"integer" required:"true"` 1774 } 1775 1776 // String returns the string representation. 1777 // 1778 // API parameter values that are decorated as "sensitive" in the API will not 1779 // be included in the string output. The member name will be present, but the 1780 // value will be replaced with "sensitive". 1781 func (s RegisterUsageInput) String() string { 1782 return awsutil.Prettify(s) 1783 } 1784 1785 // GoString returns the string representation. 1786 // 1787 // API parameter values that are decorated as "sensitive" in the API will not 1788 // be included in the string output. The member name will be present, but the 1789 // value will be replaced with "sensitive". 1790 func (s RegisterUsageInput) GoString() string { 1791 return s.String() 1792 } 1793 1794 // Validate inspects the fields of the type to determine if they are valid. 1795 func (s *RegisterUsageInput) Validate() error { 1796 invalidParams := request.ErrInvalidParams{Context: "RegisterUsageInput"} 1797 if s.ProductCode == nil { 1798 invalidParams.Add(request.NewErrParamRequired("ProductCode")) 1799 } 1800 if s.ProductCode != nil && len(*s.ProductCode) < 1 { 1801 invalidParams.Add(request.NewErrParamMinLen("ProductCode", 1)) 1802 } 1803 if s.PublicKeyVersion == nil { 1804 invalidParams.Add(request.NewErrParamRequired("PublicKeyVersion")) 1805 } 1806 if s.PublicKeyVersion != nil && *s.PublicKeyVersion < 1 { 1807 invalidParams.Add(request.NewErrParamMinValue("PublicKeyVersion", 1)) 1808 } 1809 1810 if invalidParams.Len() > 0 { 1811 return invalidParams 1812 } 1813 return nil 1814 } 1815 1816 // SetNonce sets the Nonce field's value. 1817 func (s *RegisterUsageInput) SetNonce(v string) *RegisterUsageInput { 1818 s.Nonce = &v 1819 return s 1820 } 1821 1822 // SetProductCode sets the ProductCode field's value. 1823 func (s *RegisterUsageInput) SetProductCode(v string) *RegisterUsageInput { 1824 s.ProductCode = &v 1825 return s 1826 } 1827 1828 // SetPublicKeyVersion sets the PublicKeyVersion field's value. 1829 func (s *RegisterUsageInput) SetPublicKeyVersion(v int64) *RegisterUsageInput { 1830 s.PublicKeyVersion = &v 1831 return s 1832 } 1833 1834 type RegisterUsageOutput struct { 1835 _ struct{} `type:"structure"` 1836 1837 // (Optional) Only included when public key version has expired 1838 PublicKeyRotationTimestamp *time.Time `type:"timestamp"` 1839 1840 // JWT Token 1841 Signature *string `type:"string"` 1842 } 1843 1844 // String returns the string representation. 1845 // 1846 // API parameter values that are decorated as "sensitive" in the API will not 1847 // be included in the string output. The member name will be present, but the 1848 // value will be replaced with "sensitive". 1849 func (s RegisterUsageOutput) String() string { 1850 return awsutil.Prettify(s) 1851 } 1852 1853 // GoString returns the string representation. 1854 // 1855 // API parameter values that are decorated as "sensitive" in the API will not 1856 // be included in the string output. The member name will be present, but the 1857 // value will be replaced with "sensitive". 1858 func (s RegisterUsageOutput) GoString() string { 1859 return s.String() 1860 } 1861 1862 // SetPublicKeyRotationTimestamp sets the PublicKeyRotationTimestamp field's value. 1863 func (s *RegisterUsageOutput) SetPublicKeyRotationTimestamp(v time.Time) *RegisterUsageOutput { 1864 s.PublicKeyRotationTimestamp = &v 1865 return s 1866 } 1867 1868 // SetSignature sets the Signature field's value. 1869 func (s *RegisterUsageOutput) SetSignature(v string) *RegisterUsageOutput { 1870 s.Signature = &v 1871 return s 1872 } 1873 1874 // Contains input to the ResolveCustomer operation. 1875 type ResolveCustomerInput struct { 1876 _ struct{} `type:"structure"` 1877 1878 // When a buyer visits your website during the registration process, the buyer 1879 // submits a registration token through the browser. The registration token 1880 // is resolved to obtain a CustomerIdentifier and product code. 1881 // 1882 // RegistrationToken is a required field 1883 RegistrationToken *string `type:"string" required:"true"` 1884 } 1885 1886 // String returns the string representation. 1887 // 1888 // API parameter values that are decorated as "sensitive" in the API will not 1889 // be included in the string output. The member name will be present, but the 1890 // value will be replaced with "sensitive". 1891 func (s ResolveCustomerInput) String() string { 1892 return awsutil.Prettify(s) 1893 } 1894 1895 // GoString returns the string representation. 1896 // 1897 // API parameter values that are decorated as "sensitive" in the API will not 1898 // be included in the string output. The member name will be present, but the 1899 // value will be replaced with "sensitive". 1900 func (s ResolveCustomerInput) GoString() string { 1901 return s.String() 1902 } 1903 1904 // Validate inspects the fields of the type to determine if they are valid. 1905 func (s *ResolveCustomerInput) Validate() error { 1906 invalidParams := request.ErrInvalidParams{Context: "ResolveCustomerInput"} 1907 if s.RegistrationToken == nil { 1908 invalidParams.Add(request.NewErrParamRequired("RegistrationToken")) 1909 } 1910 1911 if invalidParams.Len() > 0 { 1912 return invalidParams 1913 } 1914 return nil 1915 } 1916 1917 // SetRegistrationToken sets the RegistrationToken field's value. 1918 func (s *ResolveCustomerInput) SetRegistrationToken(v string) *ResolveCustomerInput { 1919 s.RegistrationToken = &v 1920 return s 1921 } 1922 1923 // The result of the ResolveCustomer operation. Contains the CustomerIdentifier 1924 // and product code. 1925 type ResolveCustomerOutput struct { 1926 _ struct{} `type:"structure"` 1927 1928 // The CustomerIdentifier is used to identify an individual customer in your 1929 // application. Calls to BatchMeterUsage require CustomerIdentifiers for each 1930 // UsageRecord. 1931 CustomerIdentifier *string `min:"1" type:"string"` 1932 1933 // The product code is returned to confirm that the buyer is registering for 1934 // your product. Subsequent BatchMeterUsage calls should be made using this 1935 // product code. 1936 ProductCode *string `min:"1" type:"string"` 1937 } 1938 1939 // String returns the string representation. 1940 // 1941 // API parameter values that are decorated as "sensitive" in the API will not 1942 // be included in the string output. The member name will be present, but the 1943 // value will be replaced with "sensitive". 1944 func (s ResolveCustomerOutput) String() string { 1945 return awsutil.Prettify(s) 1946 } 1947 1948 // GoString returns the string representation. 1949 // 1950 // API parameter values that are decorated as "sensitive" in the API will not 1951 // be included in the string output. The member name will be present, but the 1952 // value will be replaced with "sensitive". 1953 func (s ResolveCustomerOutput) GoString() string { 1954 return s.String() 1955 } 1956 1957 // SetCustomerIdentifier sets the CustomerIdentifier field's value. 1958 func (s *ResolveCustomerOutput) SetCustomerIdentifier(v string) *ResolveCustomerOutput { 1959 s.CustomerIdentifier = &v 1960 return s 1961 } 1962 1963 // SetProductCode sets the ProductCode field's value. 1964 func (s *ResolveCustomerOutput) SetProductCode(v string) *ResolveCustomerOutput { 1965 s.ProductCode = &v 1966 return s 1967 } 1968 1969 // Metadata assigned to an allocation. Each tag is made up of a key and a value. 1970 type Tag struct { 1971 _ struct{} `type:"structure"` 1972 1973 // One part of a key-value pair that makes up a tag. A key is a label that acts 1974 // like a category for the specific tag values. 1975 // 1976 // Key is a required field 1977 Key *string `min:"1" type:"string" required:"true"` 1978 1979 // One part of a key-value pair that makes up a tag. A value acts as a descriptor 1980 // within a tag category (key). The value can be empty or null. 1981 // 1982 // Value is a required field 1983 Value *string `min:"1" type:"string" required:"true"` 1984 } 1985 1986 // String returns the string representation. 1987 // 1988 // API parameter values that are decorated as "sensitive" in the API will not 1989 // be included in the string output. The member name will be present, but the 1990 // value will be replaced with "sensitive". 1991 func (s Tag) String() string { 1992 return awsutil.Prettify(s) 1993 } 1994 1995 // GoString returns the string representation. 1996 // 1997 // API parameter values that are decorated as "sensitive" in the API will not 1998 // be included in the string output. The member name will be present, but the 1999 // value will be replaced with "sensitive". 2000 func (s Tag) GoString() string { 2001 return s.String() 2002 } 2003 2004 // Validate inspects the fields of the type to determine if they are valid. 2005 func (s *Tag) Validate() error { 2006 invalidParams := request.ErrInvalidParams{Context: "Tag"} 2007 if s.Key == nil { 2008 invalidParams.Add(request.NewErrParamRequired("Key")) 2009 } 2010 if s.Key != nil && len(*s.Key) < 1 { 2011 invalidParams.Add(request.NewErrParamMinLen("Key", 1)) 2012 } 2013 if s.Value == nil { 2014 invalidParams.Add(request.NewErrParamRequired("Value")) 2015 } 2016 if s.Value != nil && len(*s.Value) < 1 { 2017 invalidParams.Add(request.NewErrParamMinLen("Value", 1)) 2018 } 2019 2020 if invalidParams.Len() > 0 { 2021 return invalidParams 2022 } 2023 return nil 2024 } 2025 2026 // SetKey sets the Key field's value. 2027 func (s *Tag) SetKey(v string) *Tag { 2028 s.Key = &v 2029 return s 2030 } 2031 2032 // SetValue sets the Value field's value. 2033 func (s *Tag) SetValue(v string) *Tag { 2034 s.Value = &v 2035 return s 2036 } 2037 2038 // The calls to the API are throttled. 2039 type ThrottlingException struct { 2040 _ struct{} `type:"structure"` 2041 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2042 2043 Message_ *string `locationName:"message" type:"string"` 2044 } 2045 2046 // String returns the string representation. 2047 // 2048 // API parameter values that are decorated as "sensitive" in the API will not 2049 // be included in the string output. The member name will be present, but the 2050 // value will be replaced with "sensitive". 2051 func (s ThrottlingException) String() string { 2052 return awsutil.Prettify(s) 2053 } 2054 2055 // GoString returns the string representation. 2056 // 2057 // API parameter values that are decorated as "sensitive" in the API will not 2058 // be included in the string output. The member name will be present, but the 2059 // value will be replaced with "sensitive". 2060 func (s ThrottlingException) GoString() string { 2061 return s.String() 2062 } 2063 2064 func newErrorThrottlingException(v protocol.ResponseMetadata) error { 2065 return &ThrottlingException{ 2066 RespMetadata: v, 2067 } 2068 } 2069 2070 // Code returns the exception type name. 2071 func (s *ThrottlingException) Code() string { 2072 return "ThrottlingException" 2073 } 2074 2075 // Message returns the exception's message. 2076 func (s *ThrottlingException) Message() string { 2077 if s.Message_ != nil { 2078 return *s.Message_ 2079 } 2080 return "" 2081 } 2082 2083 // OrigErr always returns nil, satisfies awserr.Error interface. 2084 func (s *ThrottlingException) OrigErr() error { 2085 return nil 2086 } 2087 2088 func (s *ThrottlingException) Error() string { 2089 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2090 } 2091 2092 // Status code returns the HTTP status code for the request's response error. 2093 func (s *ThrottlingException) StatusCode() int { 2094 return s.RespMetadata.StatusCode 2095 } 2096 2097 // RequestID returns the service's response RequestID for request. 2098 func (s *ThrottlingException) RequestID() string { 2099 return s.RespMetadata.RequestID 2100 } 2101 2102 // The timestamp value passed in the meterUsage() is out of allowed range. 2103 type TimestampOutOfBoundsException struct { 2104 _ struct{} `type:"structure"` 2105 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2106 2107 Message_ *string `locationName:"message" type:"string"` 2108 } 2109 2110 // String returns the string representation. 2111 // 2112 // API parameter values that are decorated as "sensitive" in the API will not 2113 // be included in the string output. The member name will be present, but the 2114 // value will be replaced with "sensitive". 2115 func (s TimestampOutOfBoundsException) String() string { 2116 return awsutil.Prettify(s) 2117 } 2118 2119 // GoString returns the string representation. 2120 // 2121 // API parameter values that are decorated as "sensitive" in the API will not 2122 // be included in the string output. The member name will be present, but the 2123 // value will be replaced with "sensitive". 2124 func (s TimestampOutOfBoundsException) GoString() string { 2125 return s.String() 2126 } 2127 2128 func newErrorTimestampOutOfBoundsException(v protocol.ResponseMetadata) error { 2129 return &TimestampOutOfBoundsException{ 2130 RespMetadata: v, 2131 } 2132 } 2133 2134 // Code returns the exception type name. 2135 func (s *TimestampOutOfBoundsException) Code() string { 2136 return "TimestampOutOfBoundsException" 2137 } 2138 2139 // Message returns the exception's message. 2140 func (s *TimestampOutOfBoundsException) Message() string { 2141 if s.Message_ != nil { 2142 return *s.Message_ 2143 } 2144 return "" 2145 } 2146 2147 // OrigErr always returns nil, satisfies awserr.Error interface. 2148 func (s *TimestampOutOfBoundsException) OrigErr() error { 2149 return nil 2150 } 2151 2152 func (s *TimestampOutOfBoundsException) Error() string { 2153 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2154 } 2155 2156 // Status code returns the HTTP status code for the request's response error. 2157 func (s *TimestampOutOfBoundsException) StatusCode() int { 2158 return s.RespMetadata.StatusCode 2159 } 2160 2161 // RequestID returns the service's response RequestID for request. 2162 func (s *TimestampOutOfBoundsException) RequestID() string { 2163 return s.RespMetadata.RequestID 2164 } 2165 2166 // Usage allocations allow you to split usage into buckets by tags. 2167 // 2168 // Each UsageAllocation indicates the usage quantity for a specific set of tags. 2169 type UsageAllocation struct { 2170 _ struct{} `type:"structure"` 2171 2172 // The total quantity allocated to this bucket of usage. 2173 // 2174 // AllocatedUsageQuantity is a required field 2175 AllocatedUsageQuantity *int64 `type:"integer" required:"true"` 2176 2177 // The set of tags that define the bucket of usage. For the bucket of items 2178 // with no tags, this parameter can be left out. 2179 Tags []*Tag `min:"1" type:"list"` 2180 } 2181 2182 // String returns the string representation. 2183 // 2184 // API parameter values that are decorated as "sensitive" in the API will not 2185 // be included in the string output. The member name will be present, but the 2186 // value will be replaced with "sensitive". 2187 func (s UsageAllocation) String() string { 2188 return awsutil.Prettify(s) 2189 } 2190 2191 // GoString returns the string representation. 2192 // 2193 // API parameter values that are decorated as "sensitive" in the API will not 2194 // be included in the string output. The member name will be present, but the 2195 // value will be replaced with "sensitive". 2196 func (s UsageAllocation) GoString() string { 2197 return s.String() 2198 } 2199 2200 // Validate inspects the fields of the type to determine if they are valid. 2201 func (s *UsageAllocation) Validate() error { 2202 invalidParams := request.ErrInvalidParams{Context: "UsageAllocation"} 2203 if s.AllocatedUsageQuantity == nil { 2204 invalidParams.Add(request.NewErrParamRequired("AllocatedUsageQuantity")) 2205 } 2206 if s.Tags != nil && len(s.Tags) < 1 { 2207 invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) 2208 } 2209 if s.Tags != nil { 2210 for i, v := range s.Tags { 2211 if v == nil { 2212 continue 2213 } 2214 if err := v.Validate(); err != nil { 2215 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) 2216 } 2217 } 2218 } 2219 2220 if invalidParams.Len() > 0 { 2221 return invalidParams 2222 } 2223 return nil 2224 } 2225 2226 // SetAllocatedUsageQuantity sets the AllocatedUsageQuantity field's value. 2227 func (s *UsageAllocation) SetAllocatedUsageQuantity(v int64) *UsageAllocation { 2228 s.AllocatedUsageQuantity = &v 2229 return s 2230 } 2231 2232 // SetTags sets the Tags field's value. 2233 func (s *UsageAllocation) SetTags(v []*Tag) *UsageAllocation { 2234 s.Tags = v 2235 return s 2236 } 2237 2238 // A UsageRecord indicates a quantity of usage for a given product, customer, 2239 // dimension and time. 2240 // 2241 // Multiple requests with the same UsageRecords as input will be deduplicated 2242 // to prevent double charges. 2243 type UsageRecord struct { 2244 _ struct{} `type:"structure"` 2245 2246 // The CustomerIdentifier is obtained through the ResolveCustomer operation 2247 // and represents an individual buyer in your application. 2248 // 2249 // CustomerIdentifier is a required field 2250 CustomerIdentifier *string `min:"1" type:"string" required:"true"` 2251 2252 // During the process of registering a product on AWS Marketplace, up to eight 2253 // dimensions are specified. These represent different units of value in your 2254 // application. 2255 // 2256 // Dimension is a required field 2257 Dimension *string `min:"1" type:"string" required:"true"` 2258 2259 // The quantity of usage consumed by the customer for the given dimension and 2260 // time. Defaults to 0 if not specified. 2261 Quantity *int64 `type:"integer"` 2262 2263 // Timestamp, in UTC, for which the usage is being reported. 2264 // 2265 // Your application can meter usage for up to one hour in the past. Make sure 2266 // the timestamp value is not before the start of the software usage. 2267 // 2268 // Timestamp is a required field 2269 Timestamp *time.Time `type:"timestamp" required:"true"` 2270 2271 // The set of UsageAllocations to submit. The sum of all UsageAllocation quantities 2272 // must equal the Quantity of the UsageRecord. 2273 UsageAllocations []*UsageAllocation `min:"1" type:"list"` 2274 } 2275 2276 // String returns the string representation. 2277 // 2278 // API parameter values that are decorated as "sensitive" in the API will not 2279 // be included in the string output. The member name will be present, but the 2280 // value will be replaced with "sensitive". 2281 func (s UsageRecord) String() string { 2282 return awsutil.Prettify(s) 2283 } 2284 2285 // GoString returns the string representation. 2286 // 2287 // API parameter values that are decorated as "sensitive" in the API will not 2288 // be included in the string output. The member name will be present, but the 2289 // value will be replaced with "sensitive". 2290 func (s UsageRecord) GoString() string { 2291 return s.String() 2292 } 2293 2294 // Validate inspects the fields of the type to determine if they are valid. 2295 func (s *UsageRecord) Validate() error { 2296 invalidParams := request.ErrInvalidParams{Context: "UsageRecord"} 2297 if s.CustomerIdentifier == nil { 2298 invalidParams.Add(request.NewErrParamRequired("CustomerIdentifier")) 2299 } 2300 if s.CustomerIdentifier != nil && len(*s.CustomerIdentifier) < 1 { 2301 invalidParams.Add(request.NewErrParamMinLen("CustomerIdentifier", 1)) 2302 } 2303 if s.Dimension == nil { 2304 invalidParams.Add(request.NewErrParamRequired("Dimension")) 2305 } 2306 if s.Dimension != nil && len(*s.Dimension) < 1 { 2307 invalidParams.Add(request.NewErrParamMinLen("Dimension", 1)) 2308 } 2309 if s.Timestamp == nil { 2310 invalidParams.Add(request.NewErrParamRequired("Timestamp")) 2311 } 2312 if s.UsageAllocations != nil && len(s.UsageAllocations) < 1 { 2313 invalidParams.Add(request.NewErrParamMinLen("UsageAllocations", 1)) 2314 } 2315 if s.UsageAllocations != nil { 2316 for i, v := range s.UsageAllocations { 2317 if v == nil { 2318 continue 2319 } 2320 if err := v.Validate(); err != nil { 2321 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UsageAllocations", i), err.(request.ErrInvalidParams)) 2322 } 2323 } 2324 } 2325 2326 if invalidParams.Len() > 0 { 2327 return invalidParams 2328 } 2329 return nil 2330 } 2331 2332 // SetCustomerIdentifier sets the CustomerIdentifier field's value. 2333 func (s *UsageRecord) SetCustomerIdentifier(v string) *UsageRecord { 2334 s.CustomerIdentifier = &v 2335 return s 2336 } 2337 2338 // SetDimension sets the Dimension field's value. 2339 func (s *UsageRecord) SetDimension(v string) *UsageRecord { 2340 s.Dimension = &v 2341 return s 2342 } 2343 2344 // SetQuantity sets the Quantity field's value. 2345 func (s *UsageRecord) SetQuantity(v int64) *UsageRecord { 2346 s.Quantity = &v 2347 return s 2348 } 2349 2350 // SetTimestamp sets the Timestamp field's value. 2351 func (s *UsageRecord) SetTimestamp(v time.Time) *UsageRecord { 2352 s.Timestamp = &v 2353 return s 2354 } 2355 2356 // SetUsageAllocations sets the UsageAllocations field's value. 2357 func (s *UsageRecord) SetUsageAllocations(v []*UsageAllocation) *UsageRecord { 2358 s.UsageAllocations = v 2359 return s 2360 } 2361 2362 // A UsageRecordResult indicates the status of a given UsageRecord processed 2363 // by BatchMeterUsage. 2364 type UsageRecordResult struct { 2365 _ struct{} `type:"structure"` 2366 2367 // The MeteringRecordId is a unique identifier for this metering event. 2368 MeteringRecordId *string `type:"string"` 2369 2370 // The UsageRecordResult Status indicates the status of an individual UsageRecord 2371 // processed by BatchMeterUsage. 2372 // 2373 // * Success- The UsageRecord was accepted and honored by BatchMeterUsage. 2374 // 2375 // * CustomerNotSubscribed- The CustomerIdentifier specified is not subscribed 2376 // to your product. The UsageRecord was not honored. Future UsageRecords 2377 // for this customer will fail until the customer subscribes to your product. 2378 // 2379 // * DuplicateRecord- Indicates that the UsageRecord was invalid and not 2380 // honored. A previously metered UsageRecord had the same customer, dimension, 2381 // and time, but a different quantity. 2382 Status *string `type:"string" enum:"UsageRecordResultStatus"` 2383 2384 // The UsageRecord that was part of the BatchMeterUsage request. 2385 UsageRecord *UsageRecord `type:"structure"` 2386 } 2387 2388 // String returns the string representation. 2389 // 2390 // API parameter values that are decorated as "sensitive" in the API will not 2391 // be included in the string output. The member name will be present, but the 2392 // value will be replaced with "sensitive". 2393 func (s UsageRecordResult) String() string { 2394 return awsutil.Prettify(s) 2395 } 2396 2397 // GoString returns the string representation. 2398 // 2399 // API parameter values that are decorated as "sensitive" in the API will not 2400 // be included in the string output. The member name will be present, but the 2401 // value will be replaced with "sensitive". 2402 func (s UsageRecordResult) GoString() string { 2403 return s.String() 2404 } 2405 2406 // SetMeteringRecordId sets the MeteringRecordId field's value. 2407 func (s *UsageRecordResult) SetMeteringRecordId(v string) *UsageRecordResult { 2408 s.MeteringRecordId = &v 2409 return s 2410 } 2411 2412 // SetStatus sets the Status field's value. 2413 func (s *UsageRecordResult) SetStatus(v string) *UsageRecordResult { 2414 s.Status = &v 2415 return s 2416 } 2417 2418 // SetUsageRecord sets the UsageRecord field's value. 2419 func (s *UsageRecordResult) SetUsageRecord(v *UsageRecord) *UsageRecordResult { 2420 s.UsageRecord = v 2421 return s 2422 } 2423 2424 const ( 2425 // UsageRecordResultStatusSuccess is a UsageRecordResultStatus enum value 2426 UsageRecordResultStatusSuccess = "Success" 2427 2428 // UsageRecordResultStatusCustomerNotSubscribed is a UsageRecordResultStatus enum value 2429 UsageRecordResultStatusCustomerNotSubscribed = "CustomerNotSubscribed" 2430 2431 // UsageRecordResultStatusDuplicateRecord is a UsageRecordResultStatus enum value 2432 UsageRecordResultStatusDuplicateRecord = "DuplicateRecord" 2433 ) 2434 2435 // UsageRecordResultStatus_Values returns all elements of the UsageRecordResultStatus enum 2436 func UsageRecordResultStatus_Values() []string { 2437 return []string{ 2438 UsageRecordResultStatusSuccess, 2439 UsageRecordResultStatusCustomerNotSubscribed, 2440 UsageRecordResultStatusDuplicateRecord, 2441 } 2442 }