1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package timestreamquery 4 5import ( 6 "fmt" 7 "net/url" 8 "strings" 9 "time" 10 11 "github.com/aws/aws-sdk-go/aws" 12 "github.com/aws/aws-sdk-go/aws/awsutil" 13 "github.com/aws/aws-sdk-go/aws/crr" 14 "github.com/aws/aws-sdk-go/aws/request" 15 "github.com/aws/aws-sdk-go/private/protocol" 16) 17 18const opCancelQuery = "CancelQuery" 19 20// CancelQueryRequest generates a "aws/request.Request" representing the 21// client's request for the CancelQuery operation. The "output" return 22// value will be populated with the request's response once the request completes 23// successfully. 24// 25// Use "Send" method on the returned Request to send the API call to the service. 26// the "output" return value is not valid until after Send returns without error. 27// 28// See CancelQuery for more information on using the CancelQuery 29// API call, and error handling. 30// 31// This method is useful when you want to inject custom logic or configuration 32// into the SDK's request lifecycle. Such as custom headers, or retry logic. 33// 34// 35// // Example sending a request using the CancelQueryRequest method. 36// req, resp := client.CancelQueryRequest(params) 37// 38// err := req.Send() 39// if err == nil { // resp is now filled 40// fmt.Println(resp) 41// } 42// 43// See also, https://docs.aws.amazon.com/goto/WebAPI/timestream-query-2018-11-01/CancelQuery 44func (c *TimestreamQuery) CancelQueryRequest(input *CancelQueryInput) (req *request.Request, output *CancelQueryOutput) { 45 op := &request.Operation{ 46 Name: opCancelQuery, 47 HTTPMethod: "POST", 48 HTTPPath: "/", 49 } 50 51 if input == nil { 52 input = &CancelQueryInput{} 53 } 54 55 output = &CancelQueryOutput{} 56 req = c.newRequest(op, input, output) 57 // if custom endpoint for the request is set to a non empty string, 58 // we skip the endpoint discovery workflow. 59 if req.Config.Endpoint == nil || *req.Config.Endpoint == "" { 60 de := discovererDescribeEndpoints{ 61 Required: true, 62 EndpointCache: c.endpointCache, 63 Params: map[string]*string{ 64 "op": aws.String(req.Operation.Name), 65 }, 66 Client: c, 67 } 68 69 for k, v := range de.Params { 70 if v == nil { 71 delete(de.Params, k) 72 } 73 } 74 75 req.Handlers.Build.PushFrontNamed(request.NamedHandler{ 76 Name: "crr.endpointdiscovery", 77 Fn: de.Handler, 78 }) 79 } 80 return 81} 82 83// CancelQuery API operation for Amazon Timestream Query. 84// 85// Cancels a query that has been issued. Cancellation is guaranteed only if 86// the query has not completed execution before the cancellation request was 87// issued. Because cancellation is an idempotent operation, subsequent cancellation 88// requests will return a CancellationMessage, indicating that the query has 89// already been canceled. 90// 91// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 92// with awserr.Error's Code and Message methods to get detailed information about 93// the error. 94// 95// See the AWS API reference guide for Amazon Timestream Query's 96// API operation CancelQuery for usage and error information. 97// 98// Returned Error Types: 99// * AccessDeniedException 100// You are not authorized to perform this action. 101// 102// * InternalServerException 103// Timestream was unable to fully process this request because of an internal 104// server error. 105// 106// * ThrottlingException 107// The request was denied due to request throttling. 108// 109// * ValidationException 110// Invalid or malformed request. 111// 112// * InvalidEndpointException 113// The requested endpoint was invalid. 114// 115// See also, https://docs.aws.amazon.com/goto/WebAPI/timestream-query-2018-11-01/CancelQuery 116func (c *TimestreamQuery) CancelQuery(input *CancelQueryInput) (*CancelQueryOutput, error) { 117 req, out := c.CancelQueryRequest(input) 118 return out, req.Send() 119} 120 121// CancelQueryWithContext is the same as CancelQuery with the addition of 122// the ability to pass a context and additional request options. 123// 124// See CancelQuery 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. 130func (c *TimestreamQuery) CancelQueryWithContext(ctx aws.Context, input *CancelQueryInput, opts ...request.Option) (*CancelQueryOutput, error) { 131 req, out := c.CancelQueryRequest(input) 132 req.SetContext(ctx) 133 req.ApplyOptions(opts...) 134 return out, req.Send() 135} 136 137const opDescribeEndpoints = "DescribeEndpoints" 138 139// DescribeEndpointsRequest generates a "aws/request.Request" representing the 140// client's request for the DescribeEndpoints 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 DescribeEndpoints for more information on using the DescribeEndpoints 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 DescribeEndpointsRequest method. 155// req, resp := client.DescribeEndpointsRequest(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/timestream-query-2018-11-01/DescribeEndpoints 163func (c *TimestreamQuery) DescribeEndpointsRequest(input *DescribeEndpointsInput) (req *request.Request, output *DescribeEndpointsOutput) { 164 op := &request.Operation{ 165 Name: opDescribeEndpoints, 166 HTTPMethod: "POST", 167 HTTPPath: "/", 168 } 169 170 if input == nil { 171 input = &DescribeEndpointsInput{} 172 } 173 174 output = &DescribeEndpointsOutput{} 175 req = c.newRequest(op, input, output) 176 return 177} 178 179// DescribeEndpoints API operation for Amazon Timestream Query. 180// 181// DescribeEndpoints returns a list of available endpoints to make Timestream 182// API calls against. This API is available through both Write and Query. 183// 184// Because Timestream’s SDKs are designed to transparently work with the service’s 185// architecture, including the management and mapping of the service endpoints, 186// it is not recommended that you use this API unless: 187// 188// * Your application uses a programming language that does not yet have 189// SDK support 190// 191// * You require better control over the client-side implementation 192// 193// For detailed information on how to use DescribeEndpoints, see The Endpoint 194// Discovery Pattern and REST APIs (https://docs.aws.amazon.com/timestream/latest/developerguide/Using-API.endpoint-discovery.html). 195// 196// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 197// with awserr.Error's Code and Message methods to get detailed information about 198// the error. 199// 200// See the AWS API reference guide for Amazon Timestream Query's 201// API operation DescribeEndpoints for usage and error information. 202// 203// Returned Error Types: 204// * InternalServerException 205// Timestream was unable to fully process this request because of an internal 206// server error. 207// 208// * ValidationException 209// Invalid or malformed request. 210// 211// * ThrottlingException 212// The request was denied due to request throttling. 213// 214// See also, https://docs.aws.amazon.com/goto/WebAPI/timestream-query-2018-11-01/DescribeEndpoints 215func (c *TimestreamQuery) DescribeEndpoints(input *DescribeEndpointsInput) (*DescribeEndpointsOutput, error) { 216 req, out := c.DescribeEndpointsRequest(input) 217 return out, req.Send() 218} 219 220// DescribeEndpointsWithContext is the same as DescribeEndpoints with the addition of 221// the ability to pass a context and additional request options. 222// 223// See DescribeEndpoints for details on how to use this API operation. 224// 225// The context must be non-nil and will be used for request cancellation. If 226// the context is nil a panic will occur. In the future the SDK may create 227// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 228// for more information on using Contexts. 229func (c *TimestreamQuery) DescribeEndpointsWithContext(ctx aws.Context, input *DescribeEndpointsInput, opts ...request.Option) (*DescribeEndpointsOutput, error) { 230 req, out := c.DescribeEndpointsRequest(input) 231 req.SetContext(ctx) 232 req.ApplyOptions(opts...) 233 return out, req.Send() 234} 235 236type discovererDescribeEndpoints struct { 237 Client *TimestreamQuery 238 Required bool 239 EndpointCache *crr.EndpointCache 240 Params map[string]*string 241 Key string 242 req *request.Request 243} 244 245func (d *discovererDescribeEndpoints) Discover() (crr.Endpoint, error) { 246 input := &DescribeEndpointsInput{} 247 248 resp, err := d.Client.DescribeEndpoints(input) 249 if err != nil { 250 return crr.Endpoint{}, err 251 } 252 253 endpoint := crr.Endpoint{ 254 Key: d.Key, 255 } 256 257 for _, e := range resp.Endpoints { 258 if e.Address == nil { 259 continue 260 } 261 262 address := *e.Address 263 264 var scheme string 265 if idx := strings.Index(address, "://"); idx != -1 { 266 scheme = address[:idx] 267 } 268 269 if len(scheme) == 0 { 270 address = fmt.Sprintf("%s://%s", d.req.HTTPRequest.URL.Scheme, address) 271 } 272 273 cachedInMinutes := aws.Int64Value(e.CachePeriodInMinutes) 274 u, err := url.Parse(address) 275 if err != nil { 276 continue 277 } 278 279 addr := crr.WeightedAddress{ 280 URL: u, 281 Expired: time.Now().Add(time.Duration(cachedInMinutes) * time.Minute), 282 } 283 284 endpoint.Add(addr) 285 } 286 287 d.EndpointCache.Add(endpoint) 288 289 return endpoint, nil 290} 291 292func (d *discovererDescribeEndpoints) Handler(r *request.Request) { 293 endpointKey := crr.BuildEndpointKey(d.Params) 294 d.Key = endpointKey 295 d.req = r 296 297 endpoint, err := d.EndpointCache.Get(d, endpointKey, d.Required) 298 if err != nil { 299 r.Error = err 300 return 301 } 302 303 if endpoint.URL != nil && len(endpoint.URL.String()) > 0 { 304 r.HTTPRequest.URL = endpoint.URL 305 } 306} 307 308const opQuery = "Query" 309 310// QueryRequest generates a "aws/request.Request" representing the 311// client's request for the Query operation. The "output" return 312// value will be populated with the request's response once the request completes 313// successfully. 314// 315// Use "Send" method on the returned Request to send the API call to the service. 316// the "output" return value is not valid until after Send returns without error. 317// 318// See Query for more information on using the Query 319// API call, and error handling. 320// 321// This method is useful when you want to inject custom logic or configuration 322// into the SDK's request lifecycle. Such as custom headers, or retry logic. 323// 324// 325// // Example sending a request using the QueryRequest method. 326// req, resp := client.QueryRequest(params) 327// 328// err := req.Send() 329// if err == nil { // resp is now filled 330// fmt.Println(resp) 331// } 332// 333// See also, https://docs.aws.amazon.com/goto/WebAPI/timestream-query-2018-11-01/Query 334func (c *TimestreamQuery) QueryRequest(input *QueryInput) (req *request.Request, output *QueryOutput) { 335 op := &request.Operation{ 336 Name: opQuery, 337 HTTPMethod: "POST", 338 HTTPPath: "/", 339 Paginator: &request.Paginator{ 340 InputTokens: []string{"NextToken"}, 341 OutputTokens: []string{"NextToken"}, 342 LimitToken: "MaxRows", 343 TruncationToken: "", 344 }, 345 } 346 347 if input == nil { 348 input = &QueryInput{} 349 } 350 351 output = &QueryOutput{} 352 req = c.newRequest(op, input, output) 353 // if custom endpoint for the request is set to a non empty string, 354 // we skip the endpoint discovery workflow. 355 if req.Config.Endpoint == nil || *req.Config.Endpoint == "" { 356 de := discovererDescribeEndpoints{ 357 Required: true, 358 EndpointCache: c.endpointCache, 359 Params: map[string]*string{ 360 "op": aws.String(req.Operation.Name), 361 }, 362 Client: c, 363 } 364 365 for k, v := range de.Params { 366 if v == nil { 367 delete(de.Params, k) 368 } 369 } 370 371 req.Handlers.Build.PushFrontNamed(request.NamedHandler{ 372 Name: "crr.endpointdiscovery", 373 Fn: de.Handler, 374 }) 375 } 376 return 377} 378 379// Query API operation for Amazon Timestream Query. 380// 381// Query is a synchronous operation that enables you to execute a query. Query 382// will timeout after 60 seconds. You must update the default timeout in the 383// SDK to support a timeout of 60 seconds. The result set will be truncated 384// to 1MB. Service quotas apply. For more information, see Quotas in the Timestream 385// Developer Guide. 386// 387// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 388// with awserr.Error's Code and Message methods to get detailed information about 389// the error. 390// 391// See the AWS API reference guide for Amazon Timestream Query's 392// API operation Query for usage and error information. 393// 394// Returned Error Types: 395// * AccessDeniedException 396// You are not authorized to perform this action. 397// 398// * ConflictException 399// Unable to poll results for a cancelled query. 400// 401// * InternalServerException 402// Timestream was unable to fully process this request because of an internal 403// server error. 404// 405// * QueryExecutionException 406// Timestream was unable to run the query successfully. 407// 408// * ThrottlingException 409// The request was denied due to request throttling. 410// 411// * ValidationException 412// Invalid or malformed request. 413// 414// * InvalidEndpointException 415// The requested endpoint was invalid. 416// 417// See also, https://docs.aws.amazon.com/goto/WebAPI/timestream-query-2018-11-01/Query 418func (c *TimestreamQuery) Query(input *QueryInput) (*QueryOutput, error) { 419 req, out := c.QueryRequest(input) 420 return out, req.Send() 421} 422 423// QueryWithContext is the same as Query with the addition of 424// the ability to pass a context and additional request options. 425// 426// See Query for details on how to use this API operation. 427// 428// The context must be non-nil and will be used for request cancellation. If 429// the context is nil a panic will occur. In the future the SDK may create 430// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 431// for more information on using Contexts. 432func (c *TimestreamQuery) QueryWithContext(ctx aws.Context, input *QueryInput, opts ...request.Option) (*QueryOutput, error) { 433 req, out := c.QueryRequest(input) 434 req.SetContext(ctx) 435 req.ApplyOptions(opts...) 436 return out, req.Send() 437} 438 439// QueryPages iterates over the pages of a Query operation, 440// calling the "fn" function with the response data for each page. To stop 441// iterating, return false from the fn function. 442// 443// See Query method for more information on how to use this operation. 444// 445// Note: This operation can generate multiple requests to a service. 446// 447// // Example iterating over at most 3 pages of a Query operation. 448// pageNum := 0 449// err := client.QueryPages(params, 450// func(page *timestreamquery.QueryOutput, lastPage bool) bool { 451// pageNum++ 452// fmt.Println(page) 453// return pageNum <= 3 454// }) 455// 456func (c *TimestreamQuery) QueryPages(input *QueryInput, fn func(*QueryOutput, bool) bool) error { 457 return c.QueryPagesWithContext(aws.BackgroundContext(), input, fn) 458} 459 460// QueryPagesWithContext same as QueryPages except 461// it takes a Context and allows setting request options on the pages. 462// 463// The context must be non-nil and will be used for request cancellation. If 464// the context is nil a panic will occur. In the future the SDK may create 465// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 466// for more information on using Contexts. 467func (c *TimestreamQuery) QueryPagesWithContext(ctx aws.Context, input *QueryInput, fn func(*QueryOutput, bool) bool, opts ...request.Option) error { 468 p := request.Pagination{ 469 NewRequest: func() (*request.Request, error) { 470 var inCpy *QueryInput 471 if input != nil { 472 tmp := *input 473 inCpy = &tmp 474 } 475 req, _ := c.QueryRequest(inCpy) 476 req.SetContext(ctx) 477 req.ApplyOptions(opts...) 478 return req, nil 479 }, 480 } 481 482 for p.Next() { 483 if !fn(p.Page().(*QueryOutput), !p.HasNextPage()) { 484 break 485 } 486 } 487 488 return p.Err() 489} 490 491// You are not authorized to perform this action. 492type AccessDeniedException struct { 493 _ struct{} `type:"structure"` 494 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 495 496 Message_ *string `locationName:"Message" type:"string"` 497} 498 499// String returns the string representation 500func (s AccessDeniedException) String() string { 501 return awsutil.Prettify(s) 502} 503 504// GoString returns the string representation 505func (s AccessDeniedException) GoString() string { 506 return s.String() 507} 508 509func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { 510 return &AccessDeniedException{ 511 RespMetadata: v, 512 } 513} 514 515// Code returns the exception type name. 516func (s *AccessDeniedException) Code() string { 517 return "AccessDeniedException" 518} 519 520// Message returns the exception's message. 521func (s *AccessDeniedException) Message() string { 522 if s.Message_ != nil { 523 return *s.Message_ 524 } 525 return "" 526} 527 528// OrigErr always returns nil, satisfies awserr.Error interface. 529func (s *AccessDeniedException) OrigErr() error { 530 return nil 531} 532 533func (s *AccessDeniedException) Error() string { 534 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 535} 536 537// Status code returns the HTTP status code for the request's response error. 538func (s *AccessDeniedException) StatusCode() int { 539 return s.RespMetadata.StatusCode 540} 541 542// RequestID returns the service's response RequestID for request. 543func (s *AccessDeniedException) RequestID() string { 544 return s.RespMetadata.RequestID 545} 546 547type CancelQueryInput struct { 548 _ struct{} `type:"structure"` 549 550 // The id of the query that needs to be cancelled. QueryID is returned as part 551 // of QueryResult. 552 // 553 // QueryId is a required field 554 QueryId *string `min:"1" type:"string" required:"true"` 555} 556 557// String returns the string representation 558func (s CancelQueryInput) String() string { 559 return awsutil.Prettify(s) 560} 561 562// GoString returns the string representation 563func (s CancelQueryInput) GoString() string { 564 return s.String() 565} 566 567// Validate inspects the fields of the type to determine if they are valid. 568func (s *CancelQueryInput) Validate() error { 569 invalidParams := request.ErrInvalidParams{Context: "CancelQueryInput"} 570 if s.QueryId == nil { 571 invalidParams.Add(request.NewErrParamRequired("QueryId")) 572 } 573 if s.QueryId != nil && len(*s.QueryId) < 1 { 574 invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) 575 } 576 577 if invalidParams.Len() > 0 { 578 return invalidParams 579 } 580 return nil 581} 582 583// SetQueryId sets the QueryId field's value. 584func (s *CancelQueryInput) SetQueryId(v string) *CancelQueryInput { 585 s.QueryId = &v 586 return s 587} 588 589type CancelQueryOutput struct { 590 _ struct{} `type:"structure"` 591 592 // A CancellationMessage is returned when a CancelQuery request for the query 593 // specified by QueryId has already been issued. 594 CancellationMessage *string `type:"string"` 595} 596 597// String returns the string representation 598func (s CancelQueryOutput) String() string { 599 return awsutil.Prettify(s) 600} 601 602// GoString returns the string representation 603func (s CancelQueryOutput) GoString() string { 604 return s.String() 605} 606 607// SetCancellationMessage sets the CancellationMessage field's value. 608func (s *CancelQueryOutput) SetCancellationMessage(v string) *CancelQueryOutput { 609 s.CancellationMessage = &v 610 return s 611} 612 613// Contains the meta data for query results such as the column names, data types, 614// and other attributes. 615type ColumnInfo struct { 616 _ struct{} `type:"structure"` 617 618 // The name of the result set column. The name of the result set is available 619 // for columns of all data types except for arrays. 620 Name *string `type:"string"` 621 622 // The data type of the result set column. The data type can be a scalar or 623 // complex. Scalar data types are integers, strings, doubles, booleans, and 624 // others. Complex data types are types such as arrays, rows, and others. 625 // 626 // Type is a required field 627 Type *Type `type:"structure" required:"true"` 628} 629 630// String returns the string representation 631func (s ColumnInfo) String() string { 632 return awsutil.Prettify(s) 633} 634 635// GoString returns the string representation 636func (s ColumnInfo) GoString() string { 637 return s.String() 638} 639 640// SetName sets the Name field's value. 641func (s *ColumnInfo) SetName(v string) *ColumnInfo { 642 s.Name = &v 643 return s 644} 645 646// SetType sets the Type field's value. 647func (s *ColumnInfo) SetType(v *Type) *ColumnInfo { 648 s.Type = v 649 return s 650} 651 652// Unable to poll results for a cancelled query. 653type ConflictException struct { 654 _ struct{} `type:"structure"` 655 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 656 657 Message_ *string `locationName:"Message" type:"string"` 658} 659 660// String returns the string representation 661func (s ConflictException) String() string { 662 return awsutil.Prettify(s) 663} 664 665// GoString returns the string representation 666func (s ConflictException) GoString() string { 667 return s.String() 668} 669 670func newErrorConflictException(v protocol.ResponseMetadata) error { 671 return &ConflictException{ 672 RespMetadata: v, 673 } 674} 675 676// Code returns the exception type name. 677func (s *ConflictException) Code() string { 678 return "ConflictException" 679} 680 681// Message returns the exception's message. 682func (s *ConflictException) Message() string { 683 if s.Message_ != nil { 684 return *s.Message_ 685 } 686 return "" 687} 688 689// OrigErr always returns nil, satisfies awserr.Error interface. 690func (s *ConflictException) OrigErr() error { 691 return nil 692} 693 694func (s *ConflictException) Error() string { 695 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 696} 697 698// Status code returns the HTTP status code for the request's response error. 699func (s *ConflictException) StatusCode() int { 700 return s.RespMetadata.StatusCode 701} 702 703// RequestID returns the service's response RequestID for request. 704func (s *ConflictException) RequestID() string { 705 return s.RespMetadata.RequestID 706} 707 708// Datum represents a single data point in a query result. 709type Datum struct { 710 _ struct{} `type:"structure"` 711 712 // Indicates if the data point is an array. 713 ArrayValue []*Datum `type:"list"` 714 715 // Indicates if the data point is null. 716 NullValue *bool `type:"boolean"` 717 718 // Indicates if the data point is a row. 719 RowValue *Row `type:"structure"` 720 721 // Indicates if the data point is a scalar value such as integer, string, double, 722 // or boolean. 723 ScalarValue *string `type:"string"` 724 725 // Indicates if the data point is of timeseries data type. 726 TimeSeriesValue []*TimeSeriesDataPoint `type:"list"` 727} 728 729// String returns the string representation 730func (s Datum) String() string { 731 return awsutil.Prettify(s) 732} 733 734// GoString returns the string representation 735func (s Datum) GoString() string { 736 return s.String() 737} 738 739// SetArrayValue sets the ArrayValue field's value. 740func (s *Datum) SetArrayValue(v []*Datum) *Datum { 741 s.ArrayValue = v 742 return s 743} 744 745// SetNullValue sets the NullValue field's value. 746func (s *Datum) SetNullValue(v bool) *Datum { 747 s.NullValue = &v 748 return s 749} 750 751// SetRowValue sets the RowValue field's value. 752func (s *Datum) SetRowValue(v *Row) *Datum { 753 s.RowValue = v 754 return s 755} 756 757// SetScalarValue sets the ScalarValue field's value. 758func (s *Datum) SetScalarValue(v string) *Datum { 759 s.ScalarValue = &v 760 return s 761} 762 763// SetTimeSeriesValue sets the TimeSeriesValue field's value. 764func (s *Datum) SetTimeSeriesValue(v []*TimeSeriesDataPoint) *Datum { 765 s.TimeSeriesValue = v 766 return s 767} 768 769type DescribeEndpointsInput struct { 770 _ struct{} `type:"structure"` 771} 772 773// String returns the string representation 774func (s DescribeEndpointsInput) String() string { 775 return awsutil.Prettify(s) 776} 777 778// GoString returns the string representation 779func (s DescribeEndpointsInput) GoString() string { 780 return s.String() 781} 782 783type DescribeEndpointsOutput struct { 784 _ struct{} `type:"structure"` 785 786 // An Endpoints object is returned when a DescribeEndpoints request is made. 787 // 788 // Endpoints is a required field 789 Endpoints []*Endpoint `type:"list" required:"true"` 790} 791 792// String returns the string representation 793func (s DescribeEndpointsOutput) String() string { 794 return awsutil.Prettify(s) 795} 796 797// GoString returns the string representation 798func (s DescribeEndpointsOutput) GoString() string { 799 return s.String() 800} 801 802// SetEndpoints sets the Endpoints field's value. 803func (s *DescribeEndpointsOutput) SetEndpoints(v []*Endpoint) *DescribeEndpointsOutput { 804 s.Endpoints = v 805 return s 806} 807 808// Represents an available endpoint against which to make API calls agaisnt, 809// as well as the TTL for that endpoint. 810type Endpoint struct { 811 _ struct{} `type:"structure"` 812 813 // An endpoint address. 814 // 815 // Address is a required field 816 Address *string `type:"string" required:"true"` 817 818 // The TTL for the endpoint, in minutes. 819 // 820 // CachePeriodInMinutes is a required field 821 CachePeriodInMinutes *int64 `type:"long" required:"true"` 822} 823 824// String returns the string representation 825func (s Endpoint) String() string { 826 return awsutil.Prettify(s) 827} 828 829// GoString returns the string representation 830func (s Endpoint) GoString() string { 831 return s.String() 832} 833 834// SetAddress sets the Address field's value. 835func (s *Endpoint) SetAddress(v string) *Endpoint { 836 s.Address = &v 837 return s 838} 839 840// SetCachePeriodInMinutes sets the CachePeriodInMinutes field's value. 841func (s *Endpoint) SetCachePeriodInMinutes(v int64) *Endpoint { 842 s.CachePeriodInMinutes = &v 843 return s 844} 845 846// Timestream was unable to fully process this request because of an internal 847// server error. 848type InternalServerException struct { 849 _ struct{} `type:"structure"` 850 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 851 852 Message_ *string `locationName:"Message" type:"string"` 853} 854 855// String returns the string representation 856func (s InternalServerException) String() string { 857 return awsutil.Prettify(s) 858} 859 860// GoString returns the string representation 861func (s InternalServerException) GoString() string { 862 return s.String() 863} 864 865func newErrorInternalServerException(v protocol.ResponseMetadata) error { 866 return &InternalServerException{ 867 RespMetadata: v, 868 } 869} 870 871// Code returns the exception type name. 872func (s *InternalServerException) Code() string { 873 return "InternalServerException" 874} 875 876// Message returns the exception's message. 877func (s *InternalServerException) Message() string { 878 if s.Message_ != nil { 879 return *s.Message_ 880 } 881 return "" 882} 883 884// OrigErr always returns nil, satisfies awserr.Error interface. 885func (s *InternalServerException) OrigErr() error { 886 return nil 887} 888 889func (s *InternalServerException) Error() string { 890 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 891} 892 893// Status code returns the HTTP status code for the request's response error. 894func (s *InternalServerException) StatusCode() int { 895 return s.RespMetadata.StatusCode 896} 897 898// RequestID returns the service's response RequestID for request. 899func (s *InternalServerException) RequestID() string { 900 return s.RespMetadata.RequestID 901} 902 903// The requested endpoint was invalid. 904type InvalidEndpointException struct { 905 _ struct{} `type:"structure"` 906 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 907 908 Message_ *string `locationName:"Message" type:"string"` 909} 910 911// String returns the string representation 912func (s InvalidEndpointException) String() string { 913 return awsutil.Prettify(s) 914} 915 916// GoString returns the string representation 917func (s InvalidEndpointException) GoString() string { 918 return s.String() 919} 920 921func newErrorInvalidEndpointException(v protocol.ResponseMetadata) error { 922 return &InvalidEndpointException{ 923 RespMetadata: v, 924 } 925} 926 927// Code returns the exception type name. 928func (s *InvalidEndpointException) Code() string { 929 return "InvalidEndpointException" 930} 931 932// Message returns the exception's message. 933func (s *InvalidEndpointException) Message() string { 934 if s.Message_ != nil { 935 return *s.Message_ 936 } 937 return "" 938} 939 940// OrigErr always returns nil, satisfies awserr.Error interface. 941func (s *InvalidEndpointException) OrigErr() error { 942 return nil 943} 944 945func (s *InvalidEndpointException) Error() string { 946 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 947} 948 949// Status code returns the HTTP status code for the request's response error. 950func (s *InvalidEndpointException) StatusCode() int { 951 return s.RespMetadata.StatusCode 952} 953 954// RequestID returns the service's response RequestID for request. 955func (s *InvalidEndpointException) RequestID() string { 956 return s.RespMetadata.RequestID 957} 958 959// Timestream was unable to run the query successfully. 960type QueryExecutionException struct { 961 _ struct{} `type:"structure"` 962 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 963 964 Message_ *string `locationName:"Message" type:"string"` 965} 966 967// String returns the string representation 968func (s QueryExecutionException) String() string { 969 return awsutil.Prettify(s) 970} 971 972// GoString returns the string representation 973func (s QueryExecutionException) GoString() string { 974 return s.String() 975} 976 977func newErrorQueryExecutionException(v protocol.ResponseMetadata) error { 978 return &QueryExecutionException{ 979 RespMetadata: v, 980 } 981} 982 983// Code returns the exception type name. 984func (s *QueryExecutionException) Code() string { 985 return "QueryExecutionException" 986} 987 988// Message returns the exception's message. 989func (s *QueryExecutionException) Message() string { 990 if s.Message_ != nil { 991 return *s.Message_ 992 } 993 return "" 994} 995 996// OrigErr always returns nil, satisfies awserr.Error interface. 997func (s *QueryExecutionException) OrigErr() error { 998 return nil 999} 1000 1001func (s *QueryExecutionException) Error() string { 1002 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1003} 1004 1005// Status code returns the HTTP status code for the request's response error. 1006func (s *QueryExecutionException) StatusCode() int { 1007 return s.RespMetadata.StatusCode 1008} 1009 1010// RequestID returns the service's response RequestID for request. 1011func (s *QueryExecutionException) RequestID() string { 1012 return s.RespMetadata.RequestID 1013} 1014 1015type QueryInput struct { 1016 _ struct{} `type:"structure"` 1017 1018 // Unique, case-sensitive string of up to 64 ASCII characters that you specify 1019 // when you make a Query request. Providing a ClientToken makes the call to 1020 // Query idempotent, meaning that multiple identical calls have the same effect 1021 // as one single call. 1022 // 1023 // Your query request will fail in the following cases: 1024 // 1025 // * If you submit a request with the same client token outside the 5-minute 1026 // idepotency window. 1027 // 1028 // * If you submit a request with the same client token but a change in other 1029 // parameters within the 5-minute idempotency window. 1030 // 1031 // After 4 hours, any request with the same client token is treated as a new 1032 // request. 1033 ClientToken *string `min:"32" type:"string" idempotencyToken:"true" sensitive:"true"` 1034 1035 // The total number of rows to return in the output. If the total number of 1036 // rows available is more than the value specified, a NextToken is provided 1037 // in the command's output. To resume pagination, provide the NextToken value 1038 // in the starting-token argument of a subsequent command. 1039 MaxRows *int64 `min:"1" type:"integer"` 1040 1041 // A pagination token passed to get a set of results. 1042 NextToken *string `type:"string"` 1043 1044 // The query to be executed by Timestream. 1045 // 1046 // QueryString is a required field 1047 QueryString *string `type:"string" required:"true" sensitive:"true"` 1048} 1049 1050// String returns the string representation 1051func (s QueryInput) String() string { 1052 return awsutil.Prettify(s) 1053} 1054 1055// GoString returns the string representation 1056func (s QueryInput) GoString() string { 1057 return s.String() 1058} 1059 1060// Validate inspects the fields of the type to determine if they are valid. 1061func (s *QueryInput) Validate() error { 1062 invalidParams := request.ErrInvalidParams{Context: "QueryInput"} 1063 if s.ClientToken != nil && len(*s.ClientToken) < 32 { 1064 invalidParams.Add(request.NewErrParamMinLen("ClientToken", 32)) 1065 } 1066 if s.MaxRows != nil && *s.MaxRows < 1 { 1067 invalidParams.Add(request.NewErrParamMinValue("MaxRows", 1)) 1068 } 1069 if s.QueryString == nil { 1070 invalidParams.Add(request.NewErrParamRequired("QueryString")) 1071 } 1072 1073 if invalidParams.Len() > 0 { 1074 return invalidParams 1075 } 1076 return nil 1077} 1078 1079// SetClientToken sets the ClientToken field's value. 1080func (s *QueryInput) SetClientToken(v string) *QueryInput { 1081 s.ClientToken = &v 1082 return s 1083} 1084 1085// SetMaxRows sets the MaxRows field's value. 1086func (s *QueryInput) SetMaxRows(v int64) *QueryInput { 1087 s.MaxRows = &v 1088 return s 1089} 1090 1091// SetNextToken sets the NextToken field's value. 1092func (s *QueryInput) SetNextToken(v string) *QueryInput { 1093 s.NextToken = &v 1094 return s 1095} 1096 1097// SetQueryString sets the QueryString field's value. 1098func (s *QueryInput) SetQueryString(v string) *QueryInput { 1099 s.QueryString = &v 1100 return s 1101} 1102 1103type QueryOutput struct { 1104 _ struct{} `type:"structure"` 1105 1106 // The column data types of the returned result set. 1107 // 1108 // ColumnInfo is a required field 1109 ColumnInfo []*ColumnInfo `type:"list" required:"true"` 1110 1111 // A pagination token that can be used again on a Query call to get the next 1112 // set of results. 1113 NextToken *string `type:"string"` 1114 1115 // A unique ID for the given query. 1116 // 1117 // QueryId is a required field 1118 QueryId *string `min:"1" type:"string" required:"true"` 1119 1120 // Information about the status of the query, including progress and bytes scannned. 1121 QueryStatus *QueryStatus `type:"structure"` 1122 1123 // The result set rows returned by the query. 1124 // 1125 // Rows is a required field 1126 Rows []*Row `type:"list" required:"true"` 1127} 1128 1129// String returns the string representation 1130func (s QueryOutput) String() string { 1131 return awsutil.Prettify(s) 1132} 1133 1134// GoString returns the string representation 1135func (s QueryOutput) GoString() string { 1136 return s.String() 1137} 1138 1139// SetColumnInfo sets the ColumnInfo field's value. 1140func (s *QueryOutput) SetColumnInfo(v []*ColumnInfo) *QueryOutput { 1141 s.ColumnInfo = v 1142 return s 1143} 1144 1145// SetNextToken sets the NextToken field's value. 1146func (s *QueryOutput) SetNextToken(v string) *QueryOutput { 1147 s.NextToken = &v 1148 return s 1149} 1150 1151// SetQueryId sets the QueryId field's value. 1152func (s *QueryOutput) SetQueryId(v string) *QueryOutput { 1153 s.QueryId = &v 1154 return s 1155} 1156 1157// SetQueryStatus sets the QueryStatus field's value. 1158func (s *QueryOutput) SetQueryStatus(v *QueryStatus) *QueryOutput { 1159 s.QueryStatus = v 1160 return s 1161} 1162 1163// SetRows sets the Rows field's value. 1164func (s *QueryOutput) SetRows(v []*Row) *QueryOutput { 1165 s.Rows = v 1166 return s 1167} 1168 1169// Information about the status of the query, including progress and bytes scannned. 1170type QueryStatus struct { 1171 _ struct{} `type:"structure"` 1172 1173 // The amount of data scanned by the query in bytes that you will be charged 1174 // for. This is a cumulative sum and represents the total amount of data that 1175 // you will be charged for since the query was started. The charge is applied 1176 // only once and is either applied when the query completes execution or when 1177 // the query is cancelled. 1178 CumulativeBytesMetered *int64 `type:"long"` 1179 1180 // The amount of data scanned by the query in bytes. This is a cumulative sum 1181 // and represents the total amount of bytes scanned since the query was started. 1182 CumulativeBytesScanned *int64 `type:"long"` 1183 1184 // The progress of the query, expressed as a percentage. 1185 ProgressPercentage *float64 `type:"double"` 1186} 1187 1188// String returns the string representation 1189func (s QueryStatus) String() string { 1190 return awsutil.Prettify(s) 1191} 1192 1193// GoString returns the string representation 1194func (s QueryStatus) GoString() string { 1195 return s.String() 1196} 1197 1198// SetCumulativeBytesMetered sets the CumulativeBytesMetered field's value. 1199func (s *QueryStatus) SetCumulativeBytesMetered(v int64) *QueryStatus { 1200 s.CumulativeBytesMetered = &v 1201 return s 1202} 1203 1204// SetCumulativeBytesScanned sets the CumulativeBytesScanned field's value. 1205func (s *QueryStatus) SetCumulativeBytesScanned(v int64) *QueryStatus { 1206 s.CumulativeBytesScanned = &v 1207 return s 1208} 1209 1210// SetProgressPercentage sets the ProgressPercentage field's value. 1211func (s *QueryStatus) SetProgressPercentage(v float64) *QueryStatus { 1212 s.ProgressPercentage = &v 1213 return s 1214} 1215 1216// Represents a single row in the query results. 1217type Row struct { 1218 _ struct{} `type:"structure"` 1219 1220 // List of data points in a single row of the result set. 1221 // 1222 // Data is a required field 1223 Data []*Datum `type:"list" required:"true"` 1224} 1225 1226// String returns the string representation 1227func (s Row) String() string { 1228 return awsutil.Prettify(s) 1229} 1230 1231// GoString returns the string representation 1232func (s Row) GoString() string { 1233 return s.String() 1234} 1235 1236// SetData sets the Data field's value. 1237func (s *Row) SetData(v []*Datum) *Row { 1238 s.Data = v 1239 return s 1240} 1241 1242// The request was denied due to request throttling. 1243type ThrottlingException struct { 1244 _ struct{} `type:"structure"` 1245 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1246 1247 Message_ *string `locationName:"Message" type:"string"` 1248} 1249 1250// String returns the string representation 1251func (s ThrottlingException) String() string { 1252 return awsutil.Prettify(s) 1253} 1254 1255// GoString returns the string representation 1256func (s ThrottlingException) GoString() string { 1257 return s.String() 1258} 1259 1260func newErrorThrottlingException(v protocol.ResponseMetadata) error { 1261 return &ThrottlingException{ 1262 RespMetadata: v, 1263 } 1264} 1265 1266// Code returns the exception type name. 1267func (s *ThrottlingException) Code() string { 1268 return "ThrottlingException" 1269} 1270 1271// Message returns the exception's message. 1272func (s *ThrottlingException) Message() string { 1273 if s.Message_ != nil { 1274 return *s.Message_ 1275 } 1276 return "" 1277} 1278 1279// OrigErr always returns nil, satisfies awserr.Error interface. 1280func (s *ThrottlingException) OrigErr() error { 1281 return nil 1282} 1283 1284func (s *ThrottlingException) Error() string { 1285 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1286} 1287 1288// Status code returns the HTTP status code for the request's response error. 1289func (s *ThrottlingException) StatusCode() int { 1290 return s.RespMetadata.StatusCode 1291} 1292 1293// RequestID returns the service's response RequestID for request. 1294func (s *ThrottlingException) RequestID() string { 1295 return s.RespMetadata.RequestID 1296} 1297 1298// The timeseries datatype represents the values of a measure over time. A time 1299// series is an array of rows of timestamps and measure values, with rows sorted 1300// in ascending order of time. A TimeSeriesDataPoint is a single data point 1301// in the timeseries. It represents a tuple of (time, measure value) in a timeseries. 1302type TimeSeriesDataPoint struct { 1303 _ struct{} `type:"structure"` 1304 1305 // The timestamp when the measure value was collected. 1306 // 1307 // Time is a required field 1308 Time *string `type:"string" required:"true"` 1309 1310 // The measure value for the data point. 1311 // 1312 // Value is a required field 1313 Value *Datum `type:"structure" required:"true"` 1314} 1315 1316// String returns the string representation 1317func (s TimeSeriesDataPoint) String() string { 1318 return awsutil.Prettify(s) 1319} 1320 1321// GoString returns the string representation 1322func (s TimeSeriesDataPoint) GoString() string { 1323 return s.String() 1324} 1325 1326// SetTime sets the Time field's value. 1327func (s *TimeSeriesDataPoint) SetTime(v string) *TimeSeriesDataPoint { 1328 s.Time = &v 1329 return s 1330} 1331 1332// SetValue sets the Value field's value. 1333func (s *TimeSeriesDataPoint) SetValue(v *Datum) *TimeSeriesDataPoint { 1334 s.Value = v 1335 return s 1336} 1337 1338// Contains the data type of a column in a query result set. The data type can 1339// be scalar or complex. The supported scalar data types are integers, boolean, 1340// string, double, timestamp, date, time, and intervals. The supported complex 1341// data types are arrays, rows, and timeseries. 1342type Type struct { 1343 _ struct{} `type:"structure"` 1344 1345 // Indicates if the column is an array. 1346 ArrayColumnInfo *ColumnInfo `type:"structure"` 1347 1348 // Indicates if the column is a row. 1349 RowColumnInfo []*ColumnInfo `type:"list"` 1350 1351 // Indicates if the column is of type string, integer, boolean, double, timestamp, 1352 // date, time. 1353 ScalarType *string `type:"string" enum:"ScalarType"` 1354 1355 // Indicates if the column is a timeseries data type. 1356 TimeSeriesMeasureValueColumnInfo *ColumnInfo `type:"structure"` 1357} 1358 1359// String returns the string representation 1360func (s Type) String() string { 1361 return awsutil.Prettify(s) 1362} 1363 1364// GoString returns the string representation 1365func (s Type) GoString() string { 1366 return s.String() 1367} 1368 1369// SetArrayColumnInfo sets the ArrayColumnInfo field's value. 1370func (s *Type) SetArrayColumnInfo(v *ColumnInfo) *Type { 1371 s.ArrayColumnInfo = v 1372 return s 1373} 1374 1375// SetRowColumnInfo sets the RowColumnInfo field's value. 1376func (s *Type) SetRowColumnInfo(v []*ColumnInfo) *Type { 1377 s.RowColumnInfo = v 1378 return s 1379} 1380 1381// SetScalarType sets the ScalarType field's value. 1382func (s *Type) SetScalarType(v string) *Type { 1383 s.ScalarType = &v 1384 return s 1385} 1386 1387// SetTimeSeriesMeasureValueColumnInfo sets the TimeSeriesMeasureValueColumnInfo field's value. 1388func (s *Type) SetTimeSeriesMeasureValueColumnInfo(v *ColumnInfo) *Type { 1389 s.TimeSeriesMeasureValueColumnInfo = v 1390 return s 1391} 1392 1393// Invalid or malformed request. 1394type ValidationException struct { 1395 _ struct{} `type:"structure"` 1396 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1397 1398 Message_ *string `locationName:"Message" type:"string"` 1399} 1400 1401// String returns the string representation 1402func (s ValidationException) String() string { 1403 return awsutil.Prettify(s) 1404} 1405 1406// GoString returns the string representation 1407func (s ValidationException) GoString() string { 1408 return s.String() 1409} 1410 1411func newErrorValidationException(v protocol.ResponseMetadata) error { 1412 return &ValidationException{ 1413 RespMetadata: v, 1414 } 1415} 1416 1417// Code returns the exception type name. 1418func (s *ValidationException) Code() string { 1419 return "ValidationException" 1420} 1421 1422// Message returns the exception's message. 1423func (s *ValidationException) Message() string { 1424 if s.Message_ != nil { 1425 return *s.Message_ 1426 } 1427 return "" 1428} 1429 1430// OrigErr always returns nil, satisfies awserr.Error interface. 1431func (s *ValidationException) OrigErr() error { 1432 return nil 1433} 1434 1435func (s *ValidationException) Error() string { 1436 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1437} 1438 1439// Status code returns the HTTP status code for the request's response error. 1440func (s *ValidationException) StatusCode() int { 1441 return s.RespMetadata.StatusCode 1442} 1443 1444// RequestID returns the service's response RequestID for request. 1445func (s *ValidationException) RequestID() string { 1446 return s.RespMetadata.RequestID 1447} 1448 1449const ( 1450 // ScalarTypeVarchar is a ScalarType enum value 1451 ScalarTypeVarchar = "VARCHAR" 1452 1453 // ScalarTypeBoolean is a ScalarType enum value 1454 ScalarTypeBoolean = "BOOLEAN" 1455 1456 // ScalarTypeBigint is a ScalarType enum value 1457 ScalarTypeBigint = "BIGINT" 1458 1459 // ScalarTypeDouble is a ScalarType enum value 1460 ScalarTypeDouble = "DOUBLE" 1461 1462 // ScalarTypeTimestamp is a ScalarType enum value 1463 ScalarTypeTimestamp = "TIMESTAMP" 1464 1465 // ScalarTypeDate is a ScalarType enum value 1466 ScalarTypeDate = "DATE" 1467 1468 // ScalarTypeTime is a ScalarType enum value 1469 ScalarTypeTime = "TIME" 1470 1471 // ScalarTypeIntervalDayToSecond is a ScalarType enum value 1472 ScalarTypeIntervalDayToSecond = "INTERVAL_DAY_TO_SECOND" 1473 1474 // ScalarTypeIntervalYearToMonth is a ScalarType enum value 1475 ScalarTypeIntervalYearToMonth = "INTERVAL_YEAR_TO_MONTH" 1476 1477 // ScalarTypeUnknown is a ScalarType enum value 1478 ScalarTypeUnknown = "UNKNOWN" 1479 1480 // ScalarTypeInteger is a ScalarType enum value 1481 ScalarTypeInteger = "INTEGER" 1482) 1483 1484// ScalarType_Values returns all elements of the ScalarType enum 1485func ScalarType_Values() []string { 1486 return []string{ 1487 ScalarTypeVarchar, 1488 ScalarTypeBoolean, 1489 ScalarTypeBigint, 1490 ScalarTypeDouble, 1491 ScalarTypeTimestamp, 1492 ScalarTypeDate, 1493 ScalarTypeTime, 1494 ScalarTypeIntervalDayToSecond, 1495 ScalarTypeIntervalYearToMonth, 1496 ScalarTypeUnknown, 1497 ScalarTypeInteger, 1498 } 1499} 1500