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/aws-sdk-go-v2/service/forecast/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Creates a dataset group, which holds a collection of related datasets. You can
15// add datasets to the dataset group when you create the dataset group, or later by
16// using the UpdateDatasetGroup operation. After creating a dataset group and
17// adding datasets, you use the dataset group when you create a predictor. For more
18// information, see howitworks-datasets-groups. To get a list of all your datasets
19// groups, use the ListDatasetGroups operation. The Status of a dataset group must
20// be ACTIVE before you can use the dataset group to create a predictor. To get the
21// status, use the DescribeDatasetGroup operation.
22func (c *Client) CreateDatasetGroup(ctx context.Context, params *CreateDatasetGroupInput, optFns ...func(*Options)) (*CreateDatasetGroupOutput, error) {
23	if params == nil {
24		params = &CreateDatasetGroupInput{}
25	}
26
27	result, metadata, err := c.invokeOperation(ctx, "CreateDatasetGroup", params, optFns, addOperationCreateDatasetGroupMiddlewares)
28	if err != nil {
29		return nil, err
30	}
31
32	out := result.(*CreateDatasetGroupOutput)
33	out.ResultMetadata = metadata
34	return out, nil
35}
36
37type CreateDatasetGroupInput struct {
38
39	// A name for the dataset group.
40	//
41	// This member is required.
42	DatasetGroupName *string
43
44	// The domain associated with the dataset group. When you add a dataset to a
45	// dataset group, this value and the value specified for the Domain parameter of
46	// the CreateDataset operation must match. The Domain and DatasetType that you
47	// choose determine the fields that must be present in training data that you
48	// import to a dataset. For example, if you choose the RETAIL domain and
49	// TARGET_TIME_SERIES as the DatasetType, Amazon Forecast requires that item_id,
50	// timestamp, and demand fields are present in your data. For more information, see
51	// howitworks-datasets-groups.
52	//
53	// This member is required.
54	Domain types.Domain
55
56	// An array of Amazon Resource Names (ARNs) of the datasets that you want to
57	// include in the dataset group.
58	DatasetArns []string
59
60	// The optional metadata that you apply to the dataset group to help you categorize
61	// and organize them. Each tag consists of a key and an optional value, both of
62	// which you define. The following basic restrictions apply to tags:
63	//
64	// * Maximum
65	// number of tags per resource - 50.
66	//
67	// * For each resource, each tag key must be
68	// unique, and each tag key can have only one value.
69	//
70	// * Maximum key length - 128
71	// Unicode characters in UTF-8.
72	//
73	// * Maximum value length - 256 Unicode characters in
74	// UTF-8.
75	//
76	// * If your tagging schema is used across multiple services and resources,
77	// remember that other services may have restrictions on allowed characters.
78	// Generally allowed characters are: letters, numbers, and spaces representable in
79	// UTF-8, and the following characters: + - = . _ : / @.
80	//
81	// * Tag keys and values are
82	// case sensitive.
83	//
84	// * Do not use aws:, AWS:, or any upper or lowercase combination
85	// of such as a prefix for keys as it is reserved for AWS use. You cannot edit or
86	// delete tag keys with this prefix. Values can have this prefix. If a tag value
87	// has aws as its prefix but the key does not, then Forecast considers it to be a
88	// user tag and will count against the limit of 50 tags. Tags with only the key
89	// prefix of aws do not count against your tags per resource limit.
90	Tags []types.Tag
91}
92
93type CreateDatasetGroupOutput struct {
94
95	// The Amazon Resource Name (ARN) of the dataset group.
96	DatasetGroupArn *string
97
98	// Metadata pertaining to the operation's result.
99	ResultMetadata middleware.Metadata
100}
101
102func addOperationCreateDatasetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
103	err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDatasetGroup{}, middleware.After)
104	if err != nil {
105		return err
106	}
107	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDatasetGroup{}, middleware.After)
108	if err != nil {
109		return err
110	}
111	if err = addSetLoggerMiddleware(stack, options); err != nil {
112		return err
113	}
114	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
115		return err
116	}
117	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
118		return err
119	}
120	if err = addResolveEndpointMiddleware(stack, options); err != nil {
121		return err
122	}
123	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
124		return err
125	}
126	if err = addRetryMiddlewares(stack, options); err != nil {
127		return err
128	}
129	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
130		return err
131	}
132	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
133		return err
134	}
135	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
136		return err
137	}
138	if err = addClientUserAgent(stack); err != nil {
139		return err
140	}
141	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
142		return err
143	}
144	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
145		return err
146	}
147	if err = addOpCreateDatasetGroupValidationMiddleware(stack); err != nil {
148		return err
149	}
150	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDatasetGroup(options.Region), middleware.Before); err != nil {
151		return err
152	}
153	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
154		return err
155	}
156	if err = addResponseErrorMiddleware(stack); err != nil {
157		return err
158	}
159	if err = addRequestResponseLogging(stack, options); err != nil {
160		return err
161	}
162	return nil
163}
164
165func newServiceMetadataMiddleware_opCreateDatasetGroup(region string) *awsmiddleware.RegisterServiceMetadata {
166	return &awsmiddleware.RegisterServiceMetadata{
167		Region:        region,
168		ServiceID:     ServiceID,
169		SigningName:   "forecast",
170		OperationName: "CreateDatasetGroup",
171	}
172}
173