1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package forecast
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/smithy-go/middleware"
10	smithyhttp "github.com/aws/smithy-go/transport/http"
11	"time"
12)
13
14// Describes a forecast created using the CreateForecast operation. In addition to
15// listing the properties provided in the CreateForecast request, this operation
16// lists the following properties:
17//
18// * DatasetGroupArn - The dataset group that
19// provided the training data.
20//
21// * CreationTime
22//
23// * LastModificationTime
24//
25// * Status
26//
27// *
28// Message - If an error occurred, information about the error.
29func (c *Client) DescribeForecast(ctx context.Context, params *DescribeForecastInput, optFns ...func(*Options)) (*DescribeForecastOutput, error) {
30	if params == nil {
31		params = &DescribeForecastInput{}
32	}
33
34	result, metadata, err := c.invokeOperation(ctx, "DescribeForecast", params, optFns, addOperationDescribeForecastMiddlewares)
35	if err != nil {
36		return nil, err
37	}
38
39	out := result.(*DescribeForecastOutput)
40	out.ResultMetadata = metadata
41	return out, nil
42}
43
44type DescribeForecastInput struct {
45
46	// The Amazon Resource Name (ARN) of the forecast.
47	//
48	// This member is required.
49	ForecastArn *string
50}
51
52type DescribeForecastOutput struct {
53
54	// When the forecast creation task was created.
55	CreationTime *time.Time
56
57	// The ARN of the dataset group that provided the data used to train the predictor.
58	DatasetGroupArn *string
59
60	// The forecast ARN as specified in the request.
61	ForecastArn *string
62
63	// The name of the forecast.
64	ForecastName *string
65
66	// The quantiles at which probabilistic forecasts were generated.
67	ForecastTypes []string
68
69	// The last time the resource was modified. The timestamp depends on the status of
70	// the job:
71	//
72	// * CREATE_PENDING - The CreationTime.
73	//
74	// * CREATE_IN_PROGRESS - The
75	// current timestamp.
76	//
77	// * CREATE_STOPPING - The current timestamp.
78	//
79	// * CREATE_STOPPED
80	// - When the job stopped.
81	//
82	// * ACTIVE or CREATE_FAILED - When the job finished or
83	// failed.
84	LastModificationTime *time.Time
85
86	// If an error occurred, an informational message about the error.
87	Message *string
88
89	// The ARN of the predictor used to generate the forecast.
90	PredictorArn *string
91
92	// The status of the forecast. States include:
93	//
94	// * ACTIVE
95	//
96	// * CREATE_PENDING,
97	// CREATE_IN_PROGRESS, CREATE_FAILED
98	//
99	// * CREATE_STOPPING, CREATE_STOPPED
100	//
101	// *
102	// DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED
103	//
104	// The Status of the forecast
105	// must be ACTIVE before you can query or export the forecast.
106	Status *string
107
108	// Metadata pertaining to the operation's result.
109	ResultMetadata middleware.Metadata
110}
111
112func addOperationDescribeForecastMiddlewares(stack *middleware.Stack, options Options) (err error) {
113	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeForecast{}, middleware.After)
114	if err != nil {
115		return err
116	}
117	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeForecast{}, middleware.After)
118	if err != nil {
119		return err
120	}
121	if err = addSetLoggerMiddleware(stack, options); err != nil {
122		return err
123	}
124	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
125		return err
126	}
127	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
128		return err
129	}
130	if err = addResolveEndpointMiddleware(stack, options); err != nil {
131		return err
132	}
133	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
134		return err
135	}
136	if err = addRetryMiddlewares(stack, options); err != nil {
137		return err
138	}
139	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
140		return err
141	}
142	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
143		return err
144	}
145	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
146		return err
147	}
148	if err = addClientUserAgent(stack); err != nil {
149		return err
150	}
151	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
152		return err
153	}
154	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addOpDescribeForecastValidationMiddleware(stack); err != nil {
158		return err
159	}
160	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeForecast(options.Region), middleware.Before); err != nil {
161		return err
162	}
163	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
164		return err
165	}
166	if err = addResponseErrorMiddleware(stack); err != nil {
167		return err
168	}
169	if err = addRequestResponseLogging(stack, options); err != nil {
170		return err
171	}
172	return nil
173}
174
175func newServiceMetadataMiddleware_opDescribeForecast(region string) *awsmiddleware.RegisterServiceMetadata {
176	return &awsmiddleware.RegisterServiceMetadata{
177		Region:        region,
178		ServiceID:     ServiceID,
179		SigningName:   "forecast",
180		OperationName: "DescribeForecast",
181	}
182}
183