1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package dataexchange
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/dataexchange/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// This operation updates a data set.
16func (c *Client) UpdateDataSet(ctx context.Context, params *UpdateDataSetInput, optFns ...func(*Options)) (*UpdateDataSetOutput, error) {
17	if params == nil {
18		params = &UpdateDataSetInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "UpdateDataSet", params, optFns, addOperationUpdateDataSetMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*UpdateDataSetOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31// The request body for UpdateDataSet.
32type UpdateDataSetInput struct {
33
34	// The unique identifier for a data set.
35	//
36	// This member is required.
37	DataSetId *string
38
39	// The description for the data set.
40	Description *string
41
42	// The name of the data set.
43	Name *string
44}
45
46type UpdateDataSetOutput struct {
47
48	// The ARN for the data set.
49	Arn *string
50
51	// The type of file your data is stored in. Currently, the supported asset type is
52	// S3_SNAPSHOT.
53	AssetType types.AssetType
54
55	// The date and time that the data set was created, in ISO 8601 format.
56	CreatedAt *time.Time
57
58	// The description for the data set.
59	Description *string
60
61	// The unique identifier for the data set.
62	Id *string
63
64	// The name of the data set.
65	Name *string
66
67	// A property that defines the data set as OWNED by the account (for providers) or
68	// ENTITLED to the account (for subscribers).
69	Origin types.Origin
70
71	// If the origin of this data set is ENTITLED, includes the details for the product
72	// on AWS Marketplace.
73	OriginDetails *types.OriginDetails
74
75	// The data set ID of the owned data set corresponding to the entitled data set
76	// being viewed. This parameter is returned when a data set owner is viewing the
77	// entitled copy of its owned data set.
78	SourceId *string
79
80	// The date and time that the data set was last updated, in ISO 8601 format.
81	UpdatedAt *time.Time
82
83	// Metadata pertaining to the operation's result.
84	ResultMetadata middleware.Metadata
85}
86
87func addOperationUpdateDataSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
88	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDataSet{}, middleware.After)
89	if err != nil {
90		return err
91	}
92	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDataSet{}, middleware.After)
93	if err != nil {
94		return err
95	}
96	if err = addSetLoggerMiddleware(stack, options); err != nil {
97		return err
98	}
99	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
100		return err
101	}
102	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
103		return err
104	}
105	if err = addResolveEndpointMiddleware(stack, options); err != nil {
106		return err
107	}
108	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
109		return err
110	}
111	if err = addRetryMiddlewares(stack, options); err != nil {
112		return err
113	}
114	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
115		return err
116	}
117	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
118		return err
119	}
120	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
121		return err
122	}
123	if err = addClientUserAgent(stack); err != nil {
124		return err
125	}
126	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
127		return err
128	}
129	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
130		return err
131	}
132	if err = addOpUpdateDataSetValidationMiddleware(stack); err != nil {
133		return err
134	}
135	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDataSet(options.Region), middleware.Before); err != nil {
136		return err
137	}
138	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
139		return err
140	}
141	if err = addResponseErrorMiddleware(stack); err != nil {
142		return err
143	}
144	if err = addRequestResponseLogging(stack, options); err != nil {
145		return err
146	}
147	return nil
148}
149
150func newServiceMetadataMiddleware_opUpdateDataSet(region string) *awsmiddleware.RegisterServiceMetadata {
151	return &awsmiddleware.RegisterServiceMetadata{
152		Region:        region,
153		ServiceID:     ServiceID,
154		SigningName:   "dataexchange",
155		OperationName: "UpdateDataSet",
156	}
157}
158