1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package servicecatalog
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/servicecatalog/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates the specified product.
15func (c *Client) UpdateProduct(ctx context.Context, params *UpdateProductInput, optFns ...func(*Options)) (*UpdateProductOutput, error) {
16	if params == nil {
17		params = &UpdateProductInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "UpdateProduct", params, optFns, addOperationUpdateProductMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*UpdateProductOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type UpdateProductInput struct {
31
32	// The product identifier.
33	//
34	// This member is required.
35	Id *string
36
37	// The language code.
38	//
39	// * en - English (default)
40	//
41	// * jp - Japanese
42	//
43	// * zh - Chinese
44	AcceptLanguage *string
45
46	// The tags to add to the product.
47	AddTags []types.Tag
48
49	// The updated description of the product.
50	Description *string
51
52	// The updated distributor of the product.
53	Distributor *string
54
55	// The updated product name.
56	Name *string
57
58	// The updated owner of the product.
59	Owner *string
60
61	// The tags to remove from the product.
62	RemoveTags []string
63
64	// The updated support description for the product.
65	SupportDescription *string
66
67	// The updated support email for the product.
68	SupportEmail *string
69
70	// The updated support URL for the product.
71	SupportUrl *string
72}
73
74type UpdateProductOutput struct {
75
76	// Information about the product view.
77	ProductViewDetail *types.ProductViewDetail
78
79	// Information about the tags associated with the product.
80	Tags []types.Tag
81
82	// Metadata pertaining to the operation's result.
83	ResultMetadata middleware.Metadata
84}
85
86func addOperationUpdateProductMiddlewares(stack *middleware.Stack, options Options) (err error) {
87	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateProduct{}, middleware.After)
88	if err != nil {
89		return err
90	}
91	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateProduct{}, middleware.After)
92	if err != nil {
93		return err
94	}
95	if err = addSetLoggerMiddleware(stack, options); err != nil {
96		return err
97	}
98	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
99		return err
100	}
101	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
102		return err
103	}
104	if err = addResolveEndpointMiddleware(stack, options); err != nil {
105		return err
106	}
107	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
108		return err
109	}
110	if err = addRetryMiddlewares(stack, options); err != nil {
111		return err
112	}
113	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
114		return err
115	}
116	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
117		return err
118	}
119	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
120		return err
121	}
122	if err = addClientUserAgent(stack); err != nil {
123		return err
124	}
125	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addOpUpdateProductValidationMiddleware(stack); err != nil {
132		return err
133	}
134	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProduct(options.Region), middleware.Before); err != nil {
135		return err
136	}
137	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
138		return err
139	}
140	if err = addResponseErrorMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addRequestResponseLogging(stack, options); err != nil {
144		return err
145	}
146	return nil
147}
148
149func newServiceMetadataMiddleware_opUpdateProduct(region string) *awsmiddleware.RegisterServiceMetadata {
150	return &awsmiddleware.RegisterServiceMetadata{
151		Region:        region,
152		ServiceID:     ServiceID,
153		SigningName:   "servicecatalog",
154		OperationName: "UpdateProduct",
155	}
156}
157