1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package amplify
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/amplify/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates an existing Amplify app.
15func (c *Client) UpdateApp(ctx context.Context, params *UpdateAppInput, optFns ...func(*Options)) (*UpdateAppOutput, error) {
16	if params == nil {
17		params = &UpdateAppInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "UpdateApp", params, optFns, addOperationUpdateAppMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*UpdateAppOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30// The request structure for the update app request.
31type UpdateAppInput struct {
32
33	// The unique ID for an Amplify app.
34	//
35	// This member is required.
36	AppId *string
37
38	// The personal access token for a third-party source control system for an Amplify
39	// app. The token is used to create webhook and a read-only deploy key. The token
40	// is not stored.
41	AccessToken *string
42
43	// The automated branch creation configuration for an Amplify app.
44	AutoBranchCreationConfig *types.AutoBranchCreationConfig
45
46	// Describes the automated branch creation glob patterns for an Amplify app.
47	AutoBranchCreationPatterns []string
48
49	// The basic authorization credentials for an Amplify app.
50	BasicAuthCredentials *string
51
52	// The build specification (build spec) for an Amplify app.
53	BuildSpec *string
54
55	// The custom HTTP headers for an Amplify app.
56	CustomHeaders *string
57
58	// The custom redirect and rewrite rules for an Amplify app.
59	CustomRules []types.CustomRule
60
61	// The description for an Amplify app.
62	Description *string
63
64	// Enables automated branch creation for an Amplify app.
65	EnableAutoBranchCreation *bool
66
67	// Enables basic authorization for an Amplify app.
68	EnableBasicAuth *bool
69
70	// Enables branch auto-building for an Amplify app.
71	EnableBranchAutoBuild *bool
72
73	// Automatically disconnects a branch in the Amplify Console when you delete a
74	// branch from your Git repository.
75	EnableBranchAutoDeletion *bool
76
77	// The environment variables for an Amplify app.
78	EnvironmentVariables map[string]string
79
80	// The AWS Identity and Access Management (IAM) service role for an Amplify app.
81	IamServiceRoleArn *string
82
83	// The name for an Amplify app.
84	Name *string
85
86	// The OAuth token for a third-party source control system for an Amplify app. The
87	// token is used to create a webhook and a read-only deploy key. The OAuth token is
88	// not stored.
89	OauthToken *string
90
91	// The platform for an Amplify app.
92	Platform types.Platform
93
94	// The name of the repository for an Amplify app
95	Repository *string
96}
97
98// The result structure for an Amplify app update request.
99type UpdateAppOutput struct {
100
101	// Represents the updated Amplify app.
102	//
103	// This member is required.
104	App *types.App
105
106	// Metadata pertaining to the operation's result.
107	ResultMetadata middleware.Metadata
108}
109
110func addOperationUpdateAppMiddlewares(stack *middleware.Stack, options Options) (err error) {
111	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApp{}, middleware.After)
112	if err != nil {
113		return err
114	}
115	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApp{}, middleware.After)
116	if err != nil {
117		return err
118	}
119	if err = addSetLoggerMiddleware(stack, options); err != nil {
120		return err
121	}
122	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
123		return err
124	}
125	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
126		return err
127	}
128	if err = addResolveEndpointMiddleware(stack, options); err != nil {
129		return err
130	}
131	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
132		return err
133	}
134	if err = addRetryMiddlewares(stack, options); err != nil {
135		return err
136	}
137	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
138		return err
139	}
140	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
141		return err
142	}
143	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
144		return err
145	}
146	if err = addClientUserAgent(stack); err != nil {
147		return err
148	}
149	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
150		return err
151	}
152	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
153		return err
154	}
155	if err = addOpUpdateAppValidationMiddleware(stack); err != nil {
156		return err
157	}
158	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApp(options.Region), middleware.Before); err != nil {
159		return err
160	}
161	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
162		return err
163	}
164	if err = addResponseErrorMiddleware(stack); err != nil {
165		return err
166	}
167	if err = addRequestResponseLogging(stack, options); err != nil {
168		return err
169	}
170	return nil
171}
172
173func newServiceMetadataMiddleware_opUpdateApp(region string) *awsmiddleware.RegisterServiceMetadata {
174	return &awsmiddleware.RegisterServiceMetadata{
175		Region:        region,
176		ServiceID:     ServiceID,
177		SigningName:   "amplify",
178		OperationName: "UpdateApp",
179	}
180}
181