1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package pi
4
5import (
6	"fmt"
7	"time"
8
9	"github.com/aws/aws-sdk-go/aws"
10	"github.com/aws/aws-sdk-go/aws/awsutil"
11	"github.com/aws/aws-sdk-go/aws/request"
12	"github.com/aws/aws-sdk-go/private/protocol"
13)
14
15const opDescribeDimensionKeys = "DescribeDimensionKeys"
16
17// DescribeDimensionKeysRequest generates a "aws/request.Request" representing the
18// client's request for the DescribeDimensionKeys 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 DescribeDimensionKeys for more information on using the DescribeDimensionKeys
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 DescribeDimensionKeysRequest method.
33//    req, resp := client.DescribeDimensionKeysRequest(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/pi-2018-02-27/DescribeDimensionKeys
41func (c *PI) DescribeDimensionKeysRequest(input *DescribeDimensionKeysInput) (req *request.Request, output *DescribeDimensionKeysOutput) {
42	op := &request.Operation{
43		Name:       opDescribeDimensionKeys,
44		HTTPMethod: "POST",
45		HTTPPath:   "/",
46	}
47
48	if input == nil {
49		input = &DescribeDimensionKeysInput{}
50	}
51
52	output = &DescribeDimensionKeysOutput{}
53	req = c.newRequest(op, input, output)
54	return
55}
56
57// DescribeDimensionKeys API operation for AWS Performance Insights.
58//
59// For a specific time period, retrieve the top N dimension keys for a metric.
60//
61// Each response element returns a maximum of 500 bytes. For larger elements,
62// such as SQL statements, only the first 500 bytes are returned.
63//
64// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
65// with awserr.Error's Code and Message methods to get detailed information about
66// the error.
67//
68// See the AWS API reference guide for AWS Performance Insights's
69// API operation DescribeDimensionKeys for usage and error information.
70//
71// Returned Error Types:
72//   * InvalidArgumentException
73//   One of the arguments provided is invalid for this request.
74//
75//   * InternalServiceError
76//   The request failed due to an unknown error.
77//
78//   * NotAuthorizedException
79//   The user is not authorized to perform this request.
80//
81// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/DescribeDimensionKeys
82func (c *PI) DescribeDimensionKeys(input *DescribeDimensionKeysInput) (*DescribeDimensionKeysOutput, error) {
83	req, out := c.DescribeDimensionKeysRequest(input)
84	return out, req.Send()
85}
86
87// DescribeDimensionKeysWithContext is the same as DescribeDimensionKeys with the addition of
88// the ability to pass a context and additional request options.
89//
90// See DescribeDimensionKeys for details on how to use this API operation.
91//
92// The context must be non-nil and will be used for request cancellation. If
93// the context is nil a panic will occur. In the future the SDK may create
94// sub-contexts for http.Requests. See https://golang.org/pkg/context/
95// for more information on using Contexts.
96func (c *PI) DescribeDimensionKeysWithContext(ctx aws.Context, input *DescribeDimensionKeysInput, opts ...request.Option) (*DescribeDimensionKeysOutput, error) {
97	req, out := c.DescribeDimensionKeysRequest(input)
98	req.SetContext(ctx)
99	req.ApplyOptions(opts...)
100	return out, req.Send()
101}
102
103const opGetDimensionKeyDetails = "GetDimensionKeyDetails"
104
105// GetDimensionKeyDetailsRequest generates a "aws/request.Request" representing the
106// client's request for the GetDimensionKeyDetails operation. The "output" return
107// value will be populated with the request's response once the request completes
108// successfully.
109//
110// Use "Send" method on the returned Request to send the API call to the service.
111// the "output" return value is not valid until after Send returns without error.
112//
113// See GetDimensionKeyDetails for more information on using the GetDimensionKeyDetails
114// API call, and error handling.
115//
116// This method is useful when you want to inject custom logic or configuration
117// into the SDK's request lifecycle. Such as custom headers, or retry logic.
118//
119//
120//    // Example sending a request using the GetDimensionKeyDetailsRequest method.
121//    req, resp := client.GetDimensionKeyDetailsRequest(params)
122//
123//    err := req.Send()
124//    if err == nil { // resp is now filled
125//        fmt.Println(resp)
126//    }
127//
128// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetDimensionKeyDetails
129func (c *PI) GetDimensionKeyDetailsRequest(input *GetDimensionKeyDetailsInput) (req *request.Request, output *GetDimensionKeyDetailsOutput) {
130	op := &request.Operation{
131		Name:       opGetDimensionKeyDetails,
132		HTTPMethod: "POST",
133		HTTPPath:   "/",
134	}
135
136	if input == nil {
137		input = &GetDimensionKeyDetailsInput{}
138	}
139
140	output = &GetDimensionKeyDetailsOutput{}
141	req = c.newRequest(op, input, output)
142	return
143}
144
145// GetDimensionKeyDetails API operation for AWS Performance Insights.
146//
147// Get the attributes of the specified dimension group for a DB instance or
148// data source. For example, if you specify a SQL ID, GetDimensionKeyDetails
149// retrieves the full text of the dimension db.sql.statement associated with
150// this ID. This operation is useful because GetResourceMetrics and DescribeDimensionKeys
151// don't support retrieval of large SQL statement text.
152//
153// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
154// with awserr.Error's Code and Message methods to get detailed information about
155// the error.
156//
157// See the AWS API reference guide for AWS Performance Insights's
158// API operation GetDimensionKeyDetails for usage and error information.
159//
160// Returned Error Types:
161//   * InvalidArgumentException
162//   One of the arguments provided is invalid for this request.
163//
164//   * InternalServiceError
165//   The request failed due to an unknown error.
166//
167//   * NotAuthorizedException
168//   The user is not authorized to perform this request.
169//
170// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetDimensionKeyDetails
171func (c *PI) GetDimensionKeyDetails(input *GetDimensionKeyDetailsInput) (*GetDimensionKeyDetailsOutput, error) {
172	req, out := c.GetDimensionKeyDetailsRequest(input)
173	return out, req.Send()
174}
175
176// GetDimensionKeyDetailsWithContext is the same as GetDimensionKeyDetails with the addition of
177// the ability to pass a context and additional request options.
178//
179// See GetDimensionKeyDetails for details on how to use this API operation.
180//
181// The context must be non-nil and will be used for request cancellation. If
182// the context is nil a panic will occur. In the future the SDK may create
183// sub-contexts for http.Requests. See https://golang.org/pkg/context/
184// for more information on using Contexts.
185func (c *PI) GetDimensionKeyDetailsWithContext(ctx aws.Context, input *GetDimensionKeyDetailsInput, opts ...request.Option) (*GetDimensionKeyDetailsOutput, error) {
186	req, out := c.GetDimensionKeyDetailsRequest(input)
187	req.SetContext(ctx)
188	req.ApplyOptions(opts...)
189	return out, req.Send()
190}
191
192const opGetResourceMetrics = "GetResourceMetrics"
193
194// GetResourceMetricsRequest generates a "aws/request.Request" representing the
195// client's request for the GetResourceMetrics operation. The "output" return
196// value will be populated with the request's response once the request completes
197// successfully.
198//
199// Use "Send" method on the returned Request to send the API call to the service.
200// the "output" return value is not valid until after Send returns without error.
201//
202// See GetResourceMetrics for more information on using the GetResourceMetrics
203// API call, and error handling.
204//
205// This method is useful when you want to inject custom logic or configuration
206// into the SDK's request lifecycle. Such as custom headers, or retry logic.
207//
208//
209//    // Example sending a request using the GetResourceMetricsRequest method.
210//    req, resp := client.GetResourceMetricsRequest(params)
211//
212//    err := req.Send()
213//    if err == nil { // resp is now filled
214//        fmt.Println(resp)
215//    }
216//
217// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetResourceMetrics
218func (c *PI) GetResourceMetricsRequest(input *GetResourceMetricsInput) (req *request.Request, output *GetResourceMetricsOutput) {
219	op := &request.Operation{
220		Name:       opGetResourceMetrics,
221		HTTPMethod: "POST",
222		HTTPPath:   "/",
223	}
224
225	if input == nil {
226		input = &GetResourceMetricsInput{}
227	}
228
229	output = &GetResourceMetricsOutput{}
230	req = c.newRequest(op, input, output)
231	return
232}
233
234// GetResourceMetrics API operation for AWS Performance Insights.
235//
236// Retrieve Performance Insights metrics for a set of data sources, over a time
237// period. You can provide specific dimension groups and dimensions, and provide
238// aggregation and filtering criteria for each group.
239//
240// Each response element returns a maximum of 500 bytes. For larger elements,
241// such as SQL statements, only the first 500 bytes are returned.
242//
243// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
244// with awserr.Error's Code and Message methods to get detailed information about
245// the error.
246//
247// See the AWS API reference guide for AWS Performance Insights's
248// API operation GetResourceMetrics for usage and error information.
249//
250// Returned Error Types:
251//   * InvalidArgumentException
252//   One of the arguments provided is invalid for this request.
253//
254//   * InternalServiceError
255//   The request failed due to an unknown error.
256//
257//   * NotAuthorizedException
258//   The user is not authorized to perform this request.
259//
260// See also, https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/GetResourceMetrics
261func (c *PI) GetResourceMetrics(input *GetResourceMetricsInput) (*GetResourceMetricsOutput, error) {
262	req, out := c.GetResourceMetricsRequest(input)
263	return out, req.Send()
264}
265
266// GetResourceMetricsWithContext is the same as GetResourceMetrics with the addition of
267// the ability to pass a context and additional request options.
268//
269// See GetResourceMetrics for details on how to use this API operation.
270//
271// The context must be non-nil and will be used for request cancellation. If
272// the context is nil a panic will occur. In the future the SDK may create
273// sub-contexts for http.Requests. See https://golang.org/pkg/context/
274// for more information on using Contexts.
275func (c *PI) GetResourceMetricsWithContext(ctx aws.Context, input *GetResourceMetricsInput, opts ...request.Option) (*GetResourceMetricsOutput, error) {
276	req, out := c.GetResourceMetricsRequest(input)
277	req.SetContext(ctx)
278	req.ApplyOptions(opts...)
279	return out, req.Send()
280}
281
282// A timestamp, and a single numerical value, which together represent a measurement
283// at a particular point in time.
284type DataPoint struct {
285	_ struct{} `type:"structure"`
286
287	// The time, in epoch format, associated with a particular Value.
288	//
289	// Timestamp is a required field
290	Timestamp *time.Time `type:"timestamp" required:"true"`
291
292	// The actual value associated with a particular Timestamp.
293	//
294	// Value is a required field
295	Value *float64 `type:"double" required:"true"`
296}
297
298// String returns the string representation
299func (s DataPoint) String() string {
300	return awsutil.Prettify(s)
301}
302
303// GoString returns the string representation
304func (s DataPoint) GoString() string {
305	return s.String()
306}
307
308// SetTimestamp sets the Timestamp field's value.
309func (s *DataPoint) SetTimestamp(v time.Time) *DataPoint {
310	s.Timestamp = &v
311	return s
312}
313
314// SetValue sets the Value field's value.
315func (s *DataPoint) SetValue(v float64) *DataPoint {
316	s.Value = &v
317	return s
318}
319
320type DescribeDimensionKeysInput struct {
321	_ struct{} `type:"structure"`
322
323	// The date and time specifying the end of the requested time series data. The
324	// value specified is exclusive, which means that data points less than (but
325	// not equal to) EndTime are returned.
326	//
327	// The value for EndTime must be later than the value for StartTime.
328	//
329	// EndTime is a required field
330	EndTime *time.Time `type:"timestamp" required:"true"`
331
332	// One or more filters to apply in the request. Restrictions:
333	//
334	//    * Any number of filters by the same dimension, as specified in the GroupBy
335	//    or Partition parameters.
336	//
337	//    * A single filter for any other dimension in this dimension group.
338	Filter map[string]*string `type:"map"`
339
340	// A specification for how to aggregate the data points from a query result.
341	// You must specify a valid dimension group. Performance Insights returns all
342	// dimensions within this group, unless you provide the names of specific dimensions
343	// within this group. You can also request that Performance Insights return
344	// a limited number of values for a dimension.
345	//
346	// GroupBy is a required field
347	GroupBy *DimensionGroup `type:"structure" required:"true"`
348
349	// An immutable, AWS Region-unique identifier for a data source. Performance
350	// Insights gathers metrics from this data source.
351	//
352	// To use an Amazon RDS instance as a data source, you specify its DbiResourceId
353	// value. For example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A
354	//
355	// Identifier is a required field
356	Identifier *string `type:"string" required:"true"`
357
358	// The maximum number of items to return in the response. If more items exist
359	// than the specified MaxRecords value, a pagination token is included in the
360	// response so that the remaining results can be retrieved.
361	MaxResults *int64 `type:"integer"`
362
363	// The name of a Performance Insights metric to be measured.
364	//
365	// Valid values for Metric are:
366	//
367	//    * db.load.avg - a scaled representation of the number of active sessions
368	//    for the database engine.
369	//
370	//    * db.sampledload.avg - the raw number of active sessions for the database
371	//    engine.
372	//
373	// If the number of active sessions is less than an internal Performance Insights
374	// threshold, db.load.avg and db.sampledload.avg are the same value. If the
375	// number of active sessions is greater than the internal threshold, Performance
376	// Insights samples the active sessions, with db.load.avg showing the scaled
377	// values, db.sampledload.avg showing the raw values, and db.sampledload.avg
378	// less than db.load.avg. For most use cases, you can query db.load.avg only.
379	//
380	// Metric is a required field
381	Metric *string `type:"string" required:"true"`
382
383	// An optional pagination token provided by a previous request. If this parameter
384	// is specified, the response includes only records beyond the token, up to
385	// the value specified by MaxRecords.
386	NextToken *string `min:"1" type:"string"`
387
388	// For each dimension specified in GroupBy, specify a secondary dimension to
389	// further subdivide the partition keys in the response.
390	PartitionBy *DimensionGroup `type:"structure"`
391
392	// The granularity, in seconds, of the data points returned from Performance
393	// Insights. A period can be as short as one second, or as long as one day (86400
394	// seconds). Valid values are:
395	//
396	//    * 1 (one second)
397	//
398	//    * 60 (one minute)
399	//
400	//    * 300 (five minutes)
401	//
402	//    * 3600 (one hour)
403	//
404	//    * 86400 (twenty-four hours)
405	//
406	// If you don't specify PeriodInSeconds, then Performance Insights chooses a
407	// value for you, with a goal of returning roughly 100-200 data points in the
408	// response.
409	PeriodInSeconds *int64 `type:"integer"`
410
411	// The AWS service for which Performance Insights will return metrics. The only
412	// valid value for ServiceType is RDS.
413	//
414	// ServiceType is a required field
415	ServiceType *string `type:"string" required:"true" enum:"ServiceType"`
416
417	// The date and time specifying the beginning of the requested time series data.
418	// You must specify a StartTime within the past 7 days. The value specified
419	// is inclusive, which means that data points equal to or greater than StartTime
420	// are returned.
421	//
422	// The value for StartTime must be earlier than the value for EndTime.
423	//
424	// StartTime is a required field
425	StartTime *time.Time `type:"timestamp" required:"true"`
426}
427
428// String returns the string representation
429func (s DescribeDimensionKeysInput) String() string {
430	return awsutil.Prettify(s)
431}
432
433// GoString returns the string representation
434func (s DescribeDimensionKeysInput) GoString() string {
435	return s.String()
436}
437
438// Validate inspects the fields of the type to determine if they are valid.
439func (s *DescribeDimensionKeysInput) Validate() error {
440	invalidParams := request.ErrInvalidParams{Context: "DescribeDimensionKeysInput"}
441	if s.EndTime == nil {
442		invalidParams.Add(request.NewErrParamRequired("EndTime"))
443	}
444	if s.GroupBy == nil {
445		invalidParams.Add(request.NewErrParamRequired("GroupBy"))
446	}
447	if s.Identifier == nil {
448		invalidParams.Add(request.NewErrParamRequired("Identifier"))
449	}
450	if s.Metric == nil {
451		invalidParams.Add(request.NewErrParamRequired("Metric"))
452	}
453	if s.NextToken != nil && len(*s.NextToken) < 1 {
454		invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
455	}
456	if s.ServiceType == nil {
457		invalidParams.Add(request.NewErrParamRequired("ServiceType"))
458	}
459	if s.StartTime == nil {
460		invalidParams.Add(request.NewErrParamRequired("StartTime"))
461	}
462	if s.GroupBy != nil {
463		if err := s.GroupBy.Validate(); err != nil {
464			invalidParams.AddNested("GroupBy", err.(request.ErrInvalidParams))
465		}
466	}
467	if s.PartitionBy != nil {
468		if err := s.PartitionBy.Validate(); err != nil {
469			invalidParams.AddNested("PartitionBy", err.(request.ErrInvalidParams))
470		}
471	}
472
473	if invalidParams.Len() > 0 {
474		return invalidParams
475	}
476	return nil
477}
478
479// SetEndTime sets the EndTime field's value.
480func (s *DescribeDimensionKeysInput) SetEndTime(v time.Time) *DescribeDimensionKeysInput {
481	s.EndTime = &v
482	return s
483}
484
485// SetFilter sets the Filter field's value.
486func (s *DescribeDimensionKeysInput) SetFilter(v map[string]*string) *DescribeDimensionKeysInput {
487	s.Filter = v
488	return s
489}
490
491// SetGroupBy sets the GroupBy field's value.
492func (s *DescribeDimensionKeysInput) SetGroupBy(v *DimensionGroup) *DescribeDimensionKeysInput {
493	s.GroupBy = v
494	return s
495}
496
497// SetIdentifier sets the Identifier field's value.
498func (s *DescribeDimensionKeysInput) SetIdentifier(v string) *DescribeDimensionKeysInput {
499	s.Identifier = &v
500	return s
501}
502
503// SetMaxResults sets the MaxResults field's value.
504func (s *DescribeDimensionKeysInput) SetMaxResults(v int64) *DescribeDimensionKeysInput {
505	s.MaxResults = &v
506	return s
507}
508
509// SetMetric sets the Metric field's value.
510func (s *DescribeDimensionKeysInput) SetMetric(v string) *DescribeDimensionKeysInput {
511	s.Metric = &v
512	return s
513}
514
515// SetNextToken sets the NextToken field's value.
516func (s *DescribeDimensionKeysInput) SetNextToken(v string) *DescribeDimensionKeysInput {
517	s.NextToken = &v
518	return s
519}
520
521// SetPartitionBy sets the PartitionBy field's value.
522func (s *DescribeDimensionKeysInput) SetPartitionBy(v *DimensionGroup) *DescribeDimensionKeysInput {
523	s.PartitionBy = v
524	return s
525}
526
527// SetPeriodInSeconds sets the PeriodInSeconds field's value.
528func (s *DescribeDimensionKeysInput) SetPeriodInSeconds(v int64) *DescribeDimensionKeysInput {
529	s.PeriodInSeconds = &v
530	return s
531}
532
533// SetServiceType sets the ServiceType field's value.
534func (s *DescribeDimensionKeysInput) SetServiceType(v string) *DescribeDimensionKeysInput {
535	s.ServiceType = &v
536	return s
537}
538
539// SetStartTime sets the StartTime field's value.
540func (s *DescribeDimensionKeysInput) SetStartTime(v time.Time) *DescribeDimensionKeysInput {
541	s.StartTime = &v
542	return s
543}
544
545type DescribeDimensionKeysOutput struct {
546	_ struct{} `type:"structure"`
547
548	// The end time for the returned dimension keys, after alignment to a granular
549	// boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater
550	// than or equal to the value of the user-specified Endtime.
551	AlignedEndTime *time.Time `type:"timestamp"`
552
553	// The start time for the returned dimension keys, after alignment to a granular
554	// boundary (as specified by PeriodInSeconds). AlignedStartTime will be less
555	// than or equal to the value of the user-specified StartTime.
556	AlignedStartTime *time.Time `type:"timestamp"`
557
558	// The dimension keys that were requested.
559	Keys []*DimensionKeyDescription `type:"list"`
560
561	// An optional pagination token provided by a previous request. If this parameter
562	// is specified, the response includes only records beyond the token, up to
563	// the value specified by MaxRecords.
564	NextToken *string `min:"1" type:"string"`
565
566	// If PartitionBy was present in the request, PartitionKeys contains the breakdown
567	// of dimension keys by the specified partitions.
568	PartitionKeys []*ResponsePartitionKey `type:"list"`
569}
570
571// String returns the string representation
572func (s DescribeDimensionKeysOutput) String() string {
573	return awsutil.Prettify(s)
574}
575
576// GoString returns the string representation
577func (s DescribeDimensionKeysOutput) GoString() string {
578	return s.String()
579}
580
581// SetAlignedEndTime sets the AlignedEndTime field's value.
582func (s *DescribeDimensionKeysOutput) SetAlignedEndTime(v time.Time) *DescribeDimensionKeysOutput {
583	s.AlignedEndTime = &v
584	return s
585}
586
587// SetAlignedStartTime sets the AlignedStartTime field's value.
588func (s *DescribeDimensionKeysOutput) SetAlignedStartTime(v time.Time) *DescribeDimensionKeysOutput {
589	s.AlignedStartTime = &v
590	return s
591}
592
593// SetKeys sets the Keys field's value.
594func (s *DescribeDimensionKeysOutput) SetKeys(v []*DimensionKeyDescription) *DescribeDimensionKeysOutput {
595	s.Keys = v
596	return s
597}
598
599// SetNextToken sets the NextToken field's value.
600func (s *DescribeDimensionKeysOutput) SetNextToken(v string) *DescribeDimensionKeysOutput {
601	s.NextToken = &v
602	return s
603}
604
605// SetPartitionKeys sets the PartitionKeys field's value.
606func (s *DescribeDimensionKeysOutput) SetPartitionKeys(v []*ResponsePartitionKey) *DescribeDimensionKeysOutput {
607	s.PartitionKeys = v
608	return s
609}
610
611// A logical grouping of Performance Insights metrics for a related subject
612// area. For example, the db.sql dimension group consists of the following dimensions:
613// db.sql.id, db.sql.db_id, db.sql.statement, and db.sql.tokenized_id.
614//
615// Each response element returns a maximum of 500 bytes. For larger elements,
616// such as SQL statements, only the first 500 bytes are returned.
617type DimensionGroup struct {
618	_ struct{} `type:"structure"`
619
620	// A list of specific dimensions from a dimension group. If this parameter is
621	// not present, then it signifies that all of the dimensions in the group were
622	// requested, or are present in the response.
623	//
624	// Valid values for elements in the Dimensions array are:
625	//
626	//    * db.application.name - The name of the application that is connected
627	//    to the database (only Aurora PostgreSQL and RDS PostgreSQL)
628	//
629	//    * db.host.id - The host ID of the connected client (all engines)
630	//
631	//    * db.host.name - The host name of the connected client (all engines)
632	//
633	//    * db.name - The name of the database to which the client is connected
634	//    (only Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and
635	//    MariaDB)
636	//
637	//    * db.session_type.name - The type of the current session (only Aurora
638	//    PostgreSQL and RDS PostgreSQL)
639	//
640	//    * db.sql.id - The SQL ID generated by Performance Insights (all engines)
641	//
642	//    * db.sql.db_id - The SQL ID generated by the database (all engines)
643	//
644	//    * db.sql.statement - The SQL text that is being executed (all engines)
645	//
646	//    * db.sql.tokenized_id
647	//
648	//    * db.sql_tokenized.id - The SQL digest ID generated by Performance Insights
649	//    (all engines)
650	//
651	//    * db.sql_tokenized.db_id - SQL digest ID generated by the database (all
652	//    engines)
653	//
654	//    * db.sql_tokenized.statement - The SQL digest text (all engines)
655	//
656	//    * db.user.id - The ID of the user logged in to the database (all engines)
657	//
658	//    * db.user.name - The name of the user logged in to the database (all engines)
659	//
660	//    * db.wait_event.name - The event for which the backend is waiting (all
661	//    engines)
662	//
663	//    * db.wait_event.type - The type of event for which the backend is waiting
664	//    (all engines)
665	//
666	//    * db.wait_event_type.name - The name of the event type for which the backend
667	//    is waiting (all engines)
668	Dimensions []*string `min:"1" type:"list"`
669
670	// The name of the dimension group. Valid values are:
671	//
672	//    * db - The name of the database to which the client is connected (only
673	//    Aurora PostgreSQL, RDS PostgreSQL, Aurora MySQL, RDS MySQL, and MariaDB)
674	//
675	//    * db.application - The name of the application that is connected to the
676	//    database (only Aurora PostgreSQL and RDS PostgreSQL)
677	//
678	//    * db.host - The host name of the connected client (all engines)
679	//
680	//    * db.session_type - The type of the current session (only Aurora PostgreSQL
681	//    and RDS PostgreSQL)
682	//
683	//    * db.sql - The SQL that is currently executing (all engines)
684	//
685	//    * db.sql_tokenized - The SQL digest (all engines)
686	//
687	//    * db.wait_event - The event for which the database backend is waiting
688	//    (all engines)
689	//
690	//    * db.wait_event_type - The type of event for which the database backend
691	//    is waiting (all engines)
692	//
693	//    * db.user - The user logged in to the database (all engines)
694	//
695	// Group is a required field
696	Group *string `type:"string" required:"true"`
697
698	// The maximum number of items to fetch for this dimension group.
699	Limit *int64 `min:"1" type:"integer"`
700}
701
702// String returns the string representation
703func (s DimensionGroup) String() string {
704	return awsutil.Prettify(s)
705}
706
707// GoString returns the string representation
708func (s DimensionGroup) GoString() string {
709	return s.String()
710}
711
712// Validate inspects the fields of the type to determine if they are valid.
713func (s *DimensionGroup) Validate() error {
714	invalidParams := request.ErrInvalidParams{Context: "DimensionGroup"}
715	if s.Dimensions != nil && len(s.Dimensions) < 1 {
716		invalidParams.Add(request.NewErrParamMinLen("Dimensions", 1))
717	}
718	if s.Group == nil {
719		invalidParams.Add(request.NewErrParamRequired("Group"))
720	}
721	if s.Limit != nil && *s.Limit < 1 {
722		invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
723	}
724
725	if invalidParams.Len() > 0 {
726		return invalidParams
727	}
728	return nil
729}
730
731// SetDimensions sets the Dimensions field's value.
732func (s *DimensionGroup) SetDimensions(v []*string) *DimensionGroup {
733	s.Dimensions = v
734	return s
735}
736
737// SetGroup sets the Group field's value.
738func (s *DimensionGroup) SetGroup(v string) *DimensionGroup {
739	s.Group = &v
740	return s
741}
742
743// SetLimit sets the Limit field's value.
744func (s *DimensionGroup) SetLimit(v int64) *DimensionGroup {
745	s.Limit = &v
746	return s
747}
748
749// An array of descriptions and aggregated values for each dimension within
750// a dimension group.
751type DimensionKeyDescription struct {
752	_ struct{} `type:"structure"`
753
754	// A map of name-value pairs for the dimensions in the group.
755	Dimensions map[string]*string `type:"map"`
756
757	// If PartitionBy was specified, PartitionKeys contains the dimensions that
758	// were.
759	Partitions []*float64 `type:"list"`
760
761	// The aggregated metric value for the dimension(s), over the requested time
762	// range.
763	Total *float64 `type:"double"`
764}
765
766// String returns the string representation
767func (s DimensionKeyDescription) String() string {
768	return awsutil.Prettify(s)
769}
770
771// GoString returns the string representation
772func (s DimensionKeyDescription) GoString() string {
773	return s.String()
774}
775
776// SetDimensions sets the Dimensions field's value.
777func (s *DimensionKeyDescription) SetDimensions(v map[string]*string) *DimensionKeyDescription {
778	s.Dimensions = v
779	return s
780}
781
782// SetPartitions sets the Partitions field's value.
783func (s *DimensionKeyDescription) SetPartitions(v []*float64) *DimensionKeyDescription {
784	s.Partitions = v
785	return s
786}
787
788// SetTotal sets the Total field's value.
789func (s *DimensionKeyDescription) SetTotal(v float64) *DimensionKeyDescription {
790	s.Total = &v
791	return s
792}
793
794// An object that describes the details for a specified dimension.
795type DimensionKeyDetail struct {
796	_ struct{} `type:"structure"`
797
798	// The full name of the dimension. The full name includes the group name and
799	// key name. The only valid value is db.sql.statement.
800	Dimension *string `type:"string"`
801
802	// The status of the dimension detail data. Possible values include the following:
803	//
804	//    * AVAILABLE - The dimension detail data is ready to be retrieved.
805	//
806	//    * PROCESSING - The dimension detail data isn't ready to be retrieved because
807	//    more processing time is required. If the requested detail data for db.sql.statement
808	//    has the status PROCESSING, Performance Insights returns the truncated
809	//    query.
810	//
811	//    * UNAVAILABLE - The dimension detail data could not be collected successfully.
812	Status *string `type:"string" enum:"DetailStatus"`
813
814	// The value of the dimension detail data. For the db.sql.statement dimension,
815	// this value is either the full or truncated SQL query, depending on the return
816	// status.
817	Value *string `type:"string"`
818}
819
820// String returns the string representation
821func (s DimensionKeyDetail) String() string {
822	return awsutil.Prettify(s)
823}
824
825// GoString returns the string representation
826func (s DimensionKeyDetail) GoString() string {
827	return s.String()
828}
829
830// SetDimension sets the Dimension field's value.
831func (s *DimensionKeyDetail) SetDimension(v string) *DimensionKeyDetail {
832	s.Dimension = &v
833	return s
834}
835
836// SetStatus sets the Status field's value.
837func (s *DimensionKeyDetail) SetStatus(v string) *DimensionKeyDetail {
838	s.Status = &v
839	return s
840}
841
842// SetValue sets the Value field's value.
843func (s *DimensionKeyDetail) SetValue(v string) *DimensionKeyDetail {
844	s.Value = &v
845	return s
846}
847
848type GetDimensionKeyDetailsInput struct {
849	_ struct{} `type:"structure"`
850
851	// The name of the dimension group. The only valid value is db.sql. Performance
852	// Insights searches the specified group for the dimension group ID.
853	//
854	// Group is a required field
855	Group *string `type:"string" required:"true"`
856
857	// The ID of the dimension group from which to retrieve dimension details. For
858	// dimension group db.sql, the group ID is db.sql.id.
859	//
860	// GroupIdentifier is a required field
861	GroupIdentifier *string `type:"string" required:"true"`
862
863	// The ID for a data source from which to gather dimension data. This ID must
864	// be immutable and unique within an AWS Region. When a DB instance is the data
865	// source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.
866	//
867	// Identifier is a required field
868	Identifier *string `type:"string" required:"true"`
869
870	// A list of dimensions to retrieve the detail data for within the given dimension
871	// group. For the dimension group db.sql, specify either the full dimension
872	// name db.sql.statement or the short dimension name statement. If you don't
873	// specify this parameter, Performance Insights returns all dimension data within
874	// the specified dimension group.
875	RequestedDimensions []*string `min:"1" type:"list"`
876
877	// The AWS service for which Performance Insights returns data. The only valid
878	// value is RDS.
879	//
880	// ServiceType is a required field
881	ServiceType *string `type:"string" required:"true" enum:"ServiceType"`
882}
883
884// String returns the string representation
885func (s GetDimensionKeyDetailsInput) String() string {
886	return awsutil.Prettify(s)
887}
888
889// GoString returns the string representation
890func (s GetDimensionKeyDetailsInput) GoString() string {
891	return s.String()
892}
893
894// Validate inspects the fields of the type to determine if they are valid.
895func (s *GetDimensionKeyDetailsInput) Validate() error {
896	invalidParams := request.ErrInvalidParams{Context: "GetDimensionKeyDetailsInput"}
897	if s.Group == nil {
898		invalidParams.Add(request.NewErrParamRequired("Group"))
899	}
900	if s.GroupIdentifier == nil {
901		invalidParams.Add(request.NewErrParamRequired("GroupIdentifier"))
902	}
903	if s.Identifier == nil {
904		invalidParams.Add(request.NewErrParamRequired("Identifier"))
905	}
906	if s.RequestedDimensions != nil && len(s.RequestedDimensions) < 1 {
907		invalidParams.Add(request.NewErrParamMinLen("RequestedDimensions", 1))
908	}
909	if s.ServiceType == nil {
910		invalidParams.Add(request.NewErrParamRequired("ServiceType"))
911	}
912
913	if invalidParams.Len() > 0 {
914		return invalidParams
915	}
916	return nil
917}
918
919// SetGroup sets the Group field's value.
920func (s *GetDimensionKeyDetailsInput) SetGroup(v string) *GetDimensionKeyDetailsInput {
921	s.Group = &v
922	return s
923}
924
925// SetGroupIdentifier sets the GroupIdentifier field's value.
926func (s *GetDimensionKeyDetailsInput) SetGroupIdentifier(v string) *GetDimensionKeyDetailsInput {
927	s.GroupIdentifier = &v
928	return s
929}
930
931// SetIdentifier sets the Identifier field's value.
932func (s *GetDimensionKeyDetailsInput) SetIdentifier(v string) *GetDimensionKeyDetailsInput {
933	s.Identifier = &v
934	return s
935}
936
937// SetRequestedDimensions sets the RequestedDimensions field's value.
938func (s *GetDimensionKeyDetailsInput) SetRequestedDimensions(v []*string) *GetDimensionKeyDetailsInput {
939	s.RequestedDimensions = v
940	return s
941}
942
943// SetServiceType sets the ServiceType field's value.
944func (s *GetDimensionKeyDetailsInput) SetServiceType(v string) *GetDimensionKeyDetailsInput {
945	s.ServiceType = &v
946	return s
947}
948
949type GetDimensionKeyDetailsOutput struct {
950	_ struct{} `type:"structure"`
951
952	// The details for the requested dimensions.
953	Dimensions []*DimensionKeyDetail `type:"list"`
954}
955
956// String returns the string representation
957func (s GetDimensionKeyDetailsOutput) String() string {
958	return awsutil.Prettify(s)
959}
960
961// GoString returns the string representation
962func (s GetDimensionKeyDetailsOutput) GoString() string {
963	return s.String()
964}
965
966// SetDimensions sets the Dimensions field's value.
967func (s *GetDimensionKeyDetailsOutput) SetDimensions(v []*DimensionKeyDetail) *GetDimensionKeyDetailsOutput {
968	s.Dimensions = v
969	return s
970}
971
972type GetResourceMetricsInput struct {
973	_ struct{} `type:"structure"`
974
975	// The date and time specifying the end of the requested time series data. The
976	// value specified is exclusive - data points less than (but not equal to) EndTime
977	// will be returned.
978	//
979	// The value for EndTime must be later than the value for StartTime.
980	//
981	// EndTime is a required field
982	EndTime *time.Time `type:"timestamp" required:"true"`
983
984	// An immutable, AWS Region-unique identifier for a data source. Performance
985	// Insights gathers metrics from this data source.
986	//
987	// To use a DB instance as a data source, specify its DbiResourceId value. For
988	// example, specify db-FAIHNTYBKTGAUSUZQYPDS2GW4A.
989	//
990	// Identifier is a required field
991	Identifier *string `type:"string" required:"true"`
992
993	// The maximum number of items to return in the response. If more items exist
994	// than the specified MaxRecords value, a pagination token is included in the
995	// response so that the remaining results can be retrieved.
996	MaxResults *int64 `type:"integer"`
997
998	// An array of one or more queries to perform. Each query must specify a Performance
999	// Insights metric, and can optionally specify aggregation and filtering criteria.
1000	//
1001	// MetricQueries is a required field
1002	MetricQueries []*MetricQuery `min:"1" type:"list" required:"true"`
1003
1004	// An optional pagination token provided by a previous request. If this parameter
1005	// is specified, the response includes only records beyond the token, up to
1006	// the value specified by MaxRecords.
1007	NextToken *string `min:"1" type:"string"`
1008
1009	// The granularity, in seconds, of the data points returned from Performance
1010	// Insights. A period can be as short as one second, or as long as one day (86400
1011	// seconds). Valid values are:
1012	//
1013	//    * 1 (one second)
1014	//
1015	//    * 60 (one minute)
1016	//
1017	//    * 300 (five minutes)
1018	//
1019	//    * 3600 (one hour)
1020	//
1021	//    * 86400 (twenty-four hours)
1022	//
1023	// If you don't specify PeriodInSeconds, then Performance Insights will choose
1024	// a value for you, with a goal of returning roughly 100-200 data points in
1025	// the response.
1026	PeriodInSeconds *int64 `type:"integer"`
1027
1028	// The AWS service for which Performance Insights returns metrics. The only
1029	// valid value for ServiceType is RDS.
1030	//
1031	// ServiceType is a required field
1032	ServiceType *string `type:"string" required:"true" enum:"ServiceType"`
1033
1034	// The date and time specifying the beginning of the requested time series data.
1035	// You can't specify a StartTime that's earlier than 7 days ago. The value specified
1036	// is inclusive - data points equal to or greater than StartTime will be returned.
1037	//
1038	// The value for StartTime must be earlier than the value for EndTime.
1039	//
1040	// StartTime is a required field
1041	StartTime *time.Time `type:"timestamp" required:"true"`
1042}
1043
1044// String returns the string representation
1045func (s GetResourceMetricsInput) String() string {
1046	return awsutil.Prettify(s)
1047}
1048
1049// GoString returns the string representation
1050func (s GetResourceMetricsInput) GoString() string {
1051	return s.String()
1052}
1053
1054// Validate inspects the fields of the type to determine if they are valid.
1055func (s *GetResourceMetricsInput) Validate() error {
1056	invalidParams := request.ErrInvalidParams{Context: "GetResourceMetricsInput"}
1057	if s.EndTime == nil {
1058		invalidParams.Add(request.NewErrParamRequired("EndTime"))
1059	}
1060	if s.Identifier == nil {
1061		invalidParams.Add(request.NewErrParamRequired("Identifier"))
1062	}
1063	if s.MetricQueries == nil {
1064		invalidParams.Add(request.NewErrParamRequired("MetricQueries"))
1065	}
1066	if s.MetricQueries != nil && len(s.MetricQueries) < 1 {
1067		invalidParams.Add(request.NewErrParamMinLen("MetricQueries", 1))
1068	}
1069	if s.NextToken != nil && len(*s.NextToken) < 1 {
1070		invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
1071	}
1072	if s.ServiceType == nil {
1073		invalidParams.Add(request.NewErrParamRequired("ServiceType"))
1074	}
1075	if s.StartTime == nil {
1076		invalidParams.Add(request.NewErrParamRequired("StartTime"))
1077	}
1078	if s.MetricQueries != nil {
1079		for i, v := range s.MetricQueries {
1080			if v == nil {
1081				continue
1082			}
1083			if err := v.Validate(); err != nil {
1084				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricQueries", i), err.(request.ErrInvalidParams))
1085			}
1086		}
1087	}
1088
1089	if invalidParams.Len() > 0 {
1090		return invalidParams
1091	}
1092	return nil
1093}
1094
1095// SetEndTime sets the EndTime field's value.
1096func (s *GetResourceMetricsInput) SetEndTime(v time.Time) *GetResourceMetricsInput {
1097	s.EndTime = &v
1098	return s
1099}
1100
1101// SetIdentifier sets the Identifier field's value.
1102func (s *GetResourceMetricsInput) SetIdentifier(v string) *GetResourceMetricsInput {
1103	s.Identifier = &v
1104	return s
1105}
1106
1107// SetMaxResults sets the MaxResults field's value.
1108func (s *GetResourceMetricsInput) SetMaxResults(v int64) *GetResourceMetricsInput {
1109	s.MaxResults = &v
1110	return s
1111}
1112
1113// SetMetricQueries sets the MetricQueries field's value.
1114func (s *GetResourceMetricsInput) SetMetricQueries(v []*MetricQuery) *GetResourceMetricsInput {
1115	s.MetricQueries = v
1116	return s
1117}
1118
1119// SetNextToken sets the NextToken field's value.
1120func (s *GetResourceMetricsInput) SetNextToken(v string) *GetResourceMetricsInput {
1121	s.NextToken = &v
1122	return s
1123}
1124
1125// SetPeriodInSeconds sets the PeriodInSeconds field's value.
1126func (s *GetResourceMetricsInput) SetPeriodInSeconds(v int64) *GetResourceMetricsInput {
1127	s.PeriodInSeconds = &v
1128	return s
1129}
1130
1131// SetServiceType sets the ServiceType field's value.
1132func (s *GetResourceMetricsInput) SetServiceType(v string) *GetResourceMetricsInput {
1133	s.ServiceType = &v
1134	return s
1135}
1136
1137// SetStartTime sets the StartTime field's value.
1138func (s *GetResourceMetricsInput) SetStartTime(v time.Time) *GetResourceMetricsInput {
1139	s.StartTime = &v
1140	return s
1141}
1142
1143type GetResourceMetricsOutput struct {
1144	_ struct{} `type:"structure"`
1145
1146	// The end time for the returned metrics, after alignment to a granular boundary
1147	// (as specified by PeriodInSeconds). AlignedEndTime will be greater than or
1148	// equal to the value of the user-specified Endtime.
1149	AlignedEndTime *time.Time `type:"timestamp"`
1150
1151	// The start time for the returned metrics, after alignment to a granular boundary
1152	// (as specified by PeriodInSeconds). AlignedStartTime will be less than or
1153	// equal to the value of the user-specified StartTime.
1154	AlignedStartTime *time.Time `type:"timestamp"`
1155
1156	// An immutable, AWS Region-unique identifier for a data source. Performance
1157	// Insights gathers metrics from this data source.
1158	//
1159	// To use a DB instance as a data source, you specify its DbiResourceId value
1160	// - for example: db-FAIHNTYBKTGAUSUZQYPDS2GW4A
1161	Identifier *string `type:"string"`
1162
1163	// An array of metric results,, where each array element contains all of the
1164	// data points for a particular dimension.
1165	MetricList []*MetricKeyDataPoints `type:"list"`
1166
1167	// An optional pagination token provided by a previous request. If this parameter
1168	// is specified, the response includes only records beyond the token, up to
1169	// the value specified by MaxRecords.
1170	NextToken *string `min:"1" type:"string"`
1171}
1172
1173// String returns the string representation
1174func (s GetResourceMetricsOutput) String() string {
1175	return awsutil.Prettify(s)
1176}
1177
1178// GoString returns the string representation
1179func (s GetResourceMetricsOutput) GoString() string {
1180	return s.String()
1181}
1182
1183// SetAlignedEndTime sets the AlignedEndTime field's value.
1184func (s *GetResourceMetricsOutput) SetAlignedEndTime(v time.Time) *GetResourceMetricsOutput {
1185	s.AlignedEndTime = &v
1186	return s
1187}
1188
1189// SetAlignedStartTime sets the AlignedStartTime field's value.
1190func (s *GetResourceMetricsOutput) SetAlignedStartTime(v time.Time) *GetResourceMetricsOutput {
1191	s.AlignedStartTime = &v
1192	return s
1193}
1194
1195// SetIdentifier sets the Identifier field's value.
1196func (s *GetResourceMetricsOutput) SetIdentifier(v string) *GetResourceMetricsOutput {
1197	s.Identifier = &v
1198	return s
1199}
1200
1201// SetMetricList sets the MetricList field's value.
1202func (s *GetResourceMetricsOutput) SetMetricList(v []*MetricKeyDataPoints) *GetResourceMetricsOutput {
1203	s.MetricList = v
1204	return s
1205}
1206
1207// SetNextToken sets the NextToken field's value.
1208func (s *GetResourceMetricsOutput) SetNextToken(v string) *GetResourceMetricsOutput {
1209	s.NextToken = &v
1210	return s
1211}
1212
1213// The request failed due to an unknown error.
1214type InternalServiceError struct {
1215	_            struct{}                  `type:"structure"`
1216	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1217
1218	Message_ *string `locationName:"Message" type:"string"`
1219}
1220
1221// String returns the string representation
1222func (s InternalServiceError) String() string {
1223	return awsutil.Prettify(s)
1224}
1225
1226// GoString returns the string representation
1227func (s InternalServiceError) GoString() string {
1228	return s.String()
1229}
1230
1231func newErrorInternalServiceError(v protocol.ResponseMetadata) error {
1232	return &InternalServiceError{
1233		RespMetadata: v,
1234	}
1235}
1236
1237// Code returns the exception type name.
1238func (s *InternalServiceError) Code() string {
1239	return "InternalServiceError"
1240}
1241
1242// Message returns the exception's message.
1243func (s *InternalServiceError) Message() string {
1244	if s.Message_ != nil {
1245		return *s.Message_
1246	}
1247	return ""
1248}
1249
1250// OrigErr always returns nil, satisfies awserr.Error interface.
1251func (s *InternalServiceError) OrigErr() error {
1252	return nil
1253}
1254
1255func (s *InternalServiceError) Error() string {
1256	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
1257}
1258
1259// Status code returns the HTTP status code for the request's response error.
1260func (s *InternalServiceError) StatusCode() int {
1261	return s.RespMetadata.StatusCode
1262}
1263
1264// RequestID returns the service's response RequestID for request.
1265func (s *InternalServiceError) RequestID() string {
1266	return s.RespMetadata.RequestID
1267}
1268
1269// One of the arguments provided is invalid for this request.
1270type InvalidArgumentException struct {
1271	_            struct{}                  `type:"structure"`
1272	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1273
1274	Message_ *string `locationName:"Message" type:"string"`
1275}
1276
1277// String returns the string representation
1278func (s InvalidArgumentException) String() string {
1279	return awsutil.Prettify(s)
1280}
1281
1282// GoString returns the string representation
1283func (s InvalidArgumentException) GoString() string {
1284	return s.String()
1285}
1286
1287func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error {
1288	return &InvalidArgumentException{
1289		RespMetadata: v,
1290	}
1291}
1292
1293// Code returns the exception type name.
1294func (s *InvalidArgumentException) Code() string {
1295	return "InvalidArgumentException"
1296}
1297
1298// Message returns the exception's message.
1299func (s *InvalidArgumentException) Message() string {
1300	if s.Message_ != nil {
1301		return *s.Message_
1302	}
1303	return ""
1304}
1305
1306// OrigErr always returns nil, satisfies awserr.Error interface.
1307func (s *InvalidArgumentException) OrigErr() error {
1308	return nil
1309}
1310
1311func (s *InvalidArgumentException) Error() string {
1312	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
1313}
1314
1315// Status code returns the HTTP status code for the request's response error.
1316func (s *InvalidArgumentException) StatusCode() int {
1317	return s.RespMetadata.StatusCode
1318}
1319
1320// RequestID returns the service's response RequestID for request.
1321func (s *InvalidArgumentException) RequestID() string {
1322	return s.RespMetadata.RequestID
1323}
1324
1325// A time-ordered series of data points, corresponding to a dimension of a Performance
1326// Insights metric.
1327type MetricKeyDataPoints struct {
1328	_ struct{} `type:"structure"`
1329
1330	// An array of timestamp-value pairs, representing measurements over a period
1331	// of time.
1332	DataPoints []*DataPoint `type:"list"`
1333
1334	// The dimension(s) to which the data points apply.
1335	Key *ResponseResourceMetricKey `type:"structure"`
1336}
1337
1338// String returns the string representation
1339func (s MetricKeyDataPoints) String() string {
1340	return awsutil.Prettify(s)
1341}
1342
1343// GoString returns the string representation
1344func (s MetricKeyDataPoints) GoString() string {
1345	return s.String()
1346}
1347
1348// SetDataPoints sets the DataPoints field's value.
1349func (s *MetricKeyDataPoints) SetDataPoints(v []*DataPoint) *MetricKeyDataPoints {
1350	s.DataPoints = v
1351	return s
1352}
1353
1354// SetKey sets the Key field's value.
1355func (s *MetricKeyDataPoints) SetKey(v *ResponseResourceMetricKey) *MetricKeyDataPoints {
1356	s.Key = v
1357	return s
1358}
1359
1360// A single query to be processed. You must provide the metric to query. If
1361// no other parameters are specified, Performance Insights returns all of the
1362// data points for that metric. You can optionally request that the data points
1363// be aggregated by dimension group ( GroupBy), and return only those data points
1364// that match your criteria (Filter).
1365type MetricQuery struct {
1366	_ struct{} `type:"structure"`
1367
1368	// One or more filters to apply in the request. Restrictions:
1369	//
1370	//    * Any number of filters by the same dimension, as specified in the GroupBy
1371	//    parameter.
1372	//
1373	//    * A single filter for any other dimension in this dimension group.
1374	Filter map[string]*string `type:"map"`
1375
1376	// A specification for how to aggregate the data points from a query result.
1377	// You must specify a valid dimension group. Performance Insights will return
1378	// all of the dimensions within that group, unless you provide the names of
1379	// specific dimensions within that group. You can also request that Performance
1380	// Insights return a limited number of values for a dimension.
1381	GroupBy *DimensionGroup `type:"structure"`
1382
1383	// The name of a Performance Insights metric to be measured.
1384	//
1385	// Valid values for Metric are:
1386	//
1387	//    * db.load.avg - a scaled representation of the number of active sessions
1388	//    for the database engine.
1389	//
1390	//    * db.sampledload.avg - the raw number of active sessions for the database
1391	//    engine.
1392	//
1393	// If the number of active sessions is less than an internal Performance Insights
1394	// threshold, db.load.avg and db.sampledload.avg are the same value. If the
1395	// number of active sessions is greater than the internal threshold, Performance
1396	// Insights samples the active sessions, with db.load.avg showing the scaled
1397	// values, db.sampledload.avg showing the raw values, and db.sampledload.avg
1398	// less than db.load.avg. For most use cases, you can query db.load.avg only.
1399	//
1400	// Metric is a required field
1401	Metric *string `type:"string" required:"true"`
1402}
1403
1404// String returns the string representation
1405func (s MetricQuery) String() string {
1406	return awsutil.Prettify(s)
1407}
1408
1409// GoString returns the string representation
1410func (s MetricQuery) GoString() string {
1411	return s.String()
1412}
1413
1414// Validate inspects the fields of the type to determine if they are valid.
1415func (s *MetricQuery) Validate() error {
1416	invalidParams := request.ErrInvalidParams{Context: "MetricQuery"}
1417	if s.Metric == nil {
1418		invalidParams.Add(request.NewErrParamRequired("Metric"))
1419	}
1420	if s.GroupBy != nil {
1421		if err := s.GroupBy.Validate(); err != nil {
1422			invalidParams.AddNested("GroupBy", err.(request.ErrInvalidParams))
1423		}
1424	}
1425
1426	if invalidParams.Len() > 0 {
1427		return invalidParams
1428	}
1429	return nil
1430}
1431
1432// SetFilter sets the Filter field's value.
1433func (s *MetricQuery) SetFilter(v map[string]*string) *MetricQuery {
1434	s.Filter = v
1435	return s
1436}
1437
1438// SetGroupBy sets the GroupBy field's value.
1439func (s *MetricQuery) SetGroupBy(v *DimensionGroup) *MetricQuery {
1440	s.GroupBy = v
1441	return s
1442}
1443
1444// SetMetric sets the Metric field's value.
1445func (s *MetricQuery) SetMetric(v string) *MetricQuery {
1446	s.Metric = &v
1447	return s
1448}
1449
1450// The user is not authorized to perform this request.
1451type NotAuthorizedException struct {
1452	_            struct{}                  `type:"structure"`
1453	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1454
1455	Message_ *string `locationName:"Message" type:"string"`
1456}
1457
1458// String returns the string representation
1459func (s NotAuthorizedException) String() string {
1460	return awsutil.Prettify(s)
1461}
1462
1463// GoString returns the string representation
1464func (s NotAuthorizedException) GoString() string {
1465	return s.String()
1466}
1467
1468func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error {
1469	return &NotAuthorizedException{
1470		RespMetadata: v,
1471	}
1472}
1473
1474// Code returns the exception type name.
1475func (s *NotAuthorizedException) Code() string {
1476	return "NotAuthorizedException"
1477}
1478
1479// Message returns the exception's message.
1480func (s *NotAuthorizedException) Message() string {
1481	if s.Message_ != nil {
1482		return *s.Message_
1483	}
1484	return ""
1485}
1486
1487// OrigErr always returns nil, satisfies awserr.Error interface.
1488func (s *NotAuthorizedException) OrigErr() error {
1489	return nil
1490}
1491
1492func (s *NotAuthorizedException) Error() string {
1493	return fmt.Sprintf("%s: %s", s.Code(), s.Message())
1494}
1495
1496// Status code returns the HTTP status code for the request's response error.
1497func (s *NotAuthorizedException) StatusCode() int {
1498	return s.RespMetadata.StatusCode
1499}
1500
1501// RequestID returns the service's response RequestID for request.
1502func (s *NotAuthorizedException) RequestID() string {
1503	return s.RespMetadata.RequestID
1504}
1505
1506// If PartitionBy was specified in a DescribeDimensionKeys request, the dimensions
1507// are returned in an array. Each element in the array specifies one dimension.
1508type ResponsePartitionKey struct {
1509	_ struct{} `type:"structure"`
1510
1511	// A dimension map that contains the dimension(s) for this partition.
1512	//
1513	// Dimensions is a required field
1514	Dimensions map[string]*string `type:"map" required:"true"`
1515}
1516
1517// String returns the string representation
1518func (s ResponsePartitionKey) String() string {
1519	return awsutil.Prettify(s)
1520}
1521
1522// GoString returns the string representation
1523func (s ResponsePartitionKey) GoString() string {
1524	return s.String()
1525}
1526
1527// SetDimensions sets the Dimensions field's value.
1528func (s *ResponsePartitionKey) SetDimensions(v map[string]*string) *ResponsePartitionKey {
1529	s.Dimensions = v
1530	return s
1531}
1532
1533// An object describing a Performance Insights metric and one or more dimensions
1534// for that metric.
1535type ResponseResourceMetricKey struct {
1536	_ struct{} `type:"structure"`
1537
1538	// The valid dimensions for the metric.
1539	Dimensions map[string]*string `type:"map"`
1540
1541	// The name of a Performance Insights metric to be measured.
1542	//
1543	// Valid values for Metric are:
1544	//
1545	//    * db.load.avg - a scaled representation of the number of active sessions
1546	//    for the database engine.
1547	//
1548	//    * db.sampledload.avg - the raw number of active sessions for the database
1549	//    engine.
1550	//
1551	// If the number of active sessions is less than an internal Performance Insights
1552	// threshold, db.load.avg and db.sampledload.avg are the same value. If the
1553	// number of active sessions is greater than the internal threshold, Performance
1554	// Insights samples the active sessions, with db.load.avg showing the scaled
1555	// values, db.sampledload.avg showing the raw values, and db.sampledload.avg
1556	// less than db.load.avg. For most use cases, you can query db.load.avg only.
1557	//
1558	// Metric is a required field
1559	Metric *string `type:"string" required:"true"`
1560}
1561
1562// String returns the string representation
1563func (s ResponseResourceMetricKey) String() string {
1564	return awsutil.Prettify(s)
1565}
1566
1567// GoString returns the string representation
1568func (s ResponseResourceMetricKey) GoString() string {
1569	return s.String()
1570}
1571
1572// SetDimensions sets the Dimensions field's value.
1573func (s *ResponseResourceMetricKey) SetDimensions(v map[string]*string) *ResponseResourceMetricKey {
1574	s.Dimensions = v
1575	return s
1576}
1577
1578// SetMetric sets the Metric field's value.
1579func (s *ResponseResourceMetricKey) SetMetric(v string) *ResponseResourceMetricKey {
1580	s.Metric = &v
1581	return s
1582}
1583
1584const (
1585	// DetailStatusAvailable is a DetailStatus enum value
1586	DetailStatusAvailable = "AVAILABLE"
1587
1588	// DetailStatusProcessing is a DetailStatus enum value
1589	DetailStatusProcessing = "PROCESSING"
1590
1591	// DetailStatusUnavailable is a DetailStatus enum value
1592	DetailStatusUnavailable = "UNAVAILABLE"
1593)
1594
1595// DetailStatus_Values returns all elements of the DetailStatus enum
1596func DetailStatus_Values() []string {
1597	return []string{
1598		DetailStatusAvailable,
1599		DetailStatusProcessing,
1600		DetailStatusUnavailable,
1601	}
1602}
1603
1604const (
1605	// ServiceTypeRds is a ServiceType enum value
1606	ServiceTypeRds = "RDS"
1607)
1608
1609// ServiceType_Values returns all elements of the ServiceType enum
1610func ServiceType_Values() []string {
1611	return []string{
1612		ServiceTypeRds,
1613	}
1614}
1615