1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package appstream
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/appstream/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates the specified fleet. If the fleet is in the STOPPED state, you can
15// update any attribute except the fleet name. If the fleet is in the RUNNING
16// state, you can update the DisplayName, ComputeCapacity, ImageARN, ImageName,
17// IdleDisconnectTimeoutInSeconds, and DisconnectTimeoutInSeconds attributes. If
18// the fleet is in the STARTING or STOPPING state, you can't update it.
19func (c *Client) UpdateFleet(ctx context.Context, params *UpdateFleetInput, optFns ...func(*Options)) (*UpdateFleetOutput, error) {
20	if params == nil {
21		params = &UpdateFleetInput{}
22	}
23
24	result, metadata, err := c.invokeOperation(ctx, "UpdateFleet", params, optFns, addOperationUpdateFleetMiddlewares)
25	if err != nil {
26		return nil, err
27	}
28
29	out := result.(*UpdateFleetOutput)
30	out.ResultMetadata = metadata
31	return out, nil
32}
33
34type UpdateFleetInput struct {
35
36	// The fleet attributes to delete.
37	AttributesToDelete []types.FleetAttribute
38
39	// The desired capacity for the fleet.
40	ComputeCapacity *types.ComputeCapacity
41
42	// Deletes the VPC association for the specified fleet.
43	//
44	// Deprecated: This member has been deprecated.
45	DeleteVpcConfig bool
46
47	// The description to display.
48	Description *string
49
50	// The amount of time that a streaming session remains active after users
51	// disconnect. If users try to reconnect to the streaming session after a
52	// disconnection or network interruption within this time interval, they are
53	// connected to their previous session. Otherwise, they are connected to a new
54	// session with a new streaming instance. Specify a value between 60 and 360000.
55	DisconnectTimeoutInSeconds *int32
56
57	// The fleet name to display.
58	DisplayName *string
59
60	// The name of the directory and organizational unit (OU) to use to join the fleet
61	// to a Microsoft Active Directory domain.
62	DomainJoinInfo *types.DomainJoinInfo
63
64	// Enables or disables default internet access for the fleet.
65	EnableDefaultInternetAccess *bool
66
67	// The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To assume
68	// a role, a fleet instance calls the AWS Security Token Service (STS) AssumeRole
69	// API operation and passes the ARN of the role to use. The operation creates a new
70	// session with temporary credentials. AppStream 2.0 retrieves the temporary
71	// credentials and creates the appstream_machine_role credential profile on the
72	// instance. For more information, see Using an IAM Role to Grant Permissions to
73	// Applications and Scripts Running on AppStream 2.0 Streaming Instances
74	// (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html)
75	// in the Amazon AppStream 2.0 Administration Guide.
76	IamRoleArn *string
77
78	// The amount of time that users can be idle (inactive) before they are
79	// disconnected from their streaming session and the DisconnectTimeoutInSeconds
80	// time interval begins. Users are notified before they are disconnected due to
81	// inactivity. If users try to reconnect to the streaming session before the time
82	// interval specified in DisconnectTimeoutInSeconds elapses, they are connected to
83	// their previous session. Users are considered idle when they stop providing
84	// keyboard or mouse input during their streaming session. File uploads and
85	// downloads, audio in, audio out, and pixels changing do not qualify as user
86	// activity. If users continue to be idle after the time interval in
87	// IdleDisconnectTimeoutInSeconds elapses, they are disconnected. To prevent users
88	// from being disconnected due to inactivity, specify a value of 0. Otherwise,
89	// specify a value between 60 and 3600. The default value is 0. If you enable this
90	// feature, we recommend that you specify a value that corresponds exactly to a
91	// whole number of minutes (for example, 60, 120, and 180). If you don't do this,
92	// the value is rounded to the nearest minute. For example, if you specify a value
93	// of 70, users are disconnected after 1 minute of inactivity. If you specify a
94	// value that is at the midpoint between two different minutes, the value is
95	// rounded up. For example, if you specify a value of 90, users are disconnected
96	// after 2 minutes of inactivity.
97	IdleDisconnectTimeoutInSeconds *int32
98
99	// The ARN of the public, private, or shared image to use.
100	ImageArn *string
101
102	// The name of the image used to create the fleet.
103	ImageName *string
104
105	// The instance type to use when launching fleet instances. The following instance
106	// types are available:
107	//
108	// * stream.standard.small
109	//
110	// * stream.standard.medium
111	//
112	// *
113	// stream.standard.large
114	//
115	// * stream.compute.large
116	//
117	// * stream.compute.xlarge
118	//
119	// *
120	// stream.compute.2xlarge
121	//
122	// * stream.compute.4xlarge
123	//
124	// * stream.compute.8xlarge
125	//
126	// *
127	// stream.memory.large
128	//
129	// * stream.memory.xlarge
130	//
131	// * stream.memory.2xlarge
132	//
133	// *
134	// stream.memory.4xlarge
135	//
136	// * stream.memory.8xlarge
137	//
138	// * stream.memory.z1d.large
139	//
140	// *
141	// stream.memory.z1d.xlarge
142	//
143	// * stream.memory.z1d.2xlarge
144	//
145	// *
146	// stream.memory.z1d.3xlarge
147	//
148	// * stream.memory.z1d.6xlarge
149	//
150	// *
151	// stream.memory.z1d.12xlarge
152	//
153	// * stream.graphics-design.large
154	//
155	// *
156	// stream.graphics-design.xlarge
157	//
158	// * stream.graphics-design.2xlarge
159	//
160	// *
161	// stream.graphics-design.4xlarge
162	//
163	// * stream.graphics-desktop.2xlarge
164	//
165	// *
166	// stream.graphics.g4dn.xlarge
167	//
168	// * stream.graphics.g4dn.2xlarge
169	//
170	// *
171	// stream.graphics.g4dn.4xlarge
172	//
173	// * stream.graphics.g4dn.8xlarge
174	//
175	// *
176	// stream.graphics.g4dn.12xlarge
177	//
178	// * stream.graphics.g4dn.16xlarge
179	//
180	// *
181	// stream.graphics-pro.4xlarge
182	//
183	// * stream.graphics-pro.8xlarge
184	//
185	// *
186	// stream.graphics-pro.16xlarge
187	InstanceType *string
188
189	// The maximum amount of time that a streaming session can remain active, in
190	// seconds. If users are still connected to a streaming instance five minutes
191	// before this limit is reached, they are prompted to save any open documents
192	// before being disconnected. After this time elapses, the instance is terminated
193	// and replaced by a new instance. Specify a value between 600 and 360000.
194	MaxUserDurationInSeconds *int32
195
196	// A unique name for the fleet.
197	Name *string
198
199	// The AppStream 2.0 view that is displayed to your users when they stream from the
200	// fleet. When APP is specified, only the windows of applications opened by users
201	// display. When DESKTOP is specified, the standard desktop that is provided by the
202	// operating system displays. The default value is APP.
203	StreamView types.StreamView
204
205	// The VPC configuration for the fleet.
206	VpcConfig *types.VpcConfig
207}
208
209type UpdateFleetOutput struct {
210
211	// Information about the fleet.
212	Fleet *types.Fleet
213
214	// Metadata pertaining to the operation's result.
215	ResultMetadata middleware.Metadata
216}
217
218func addOperationUpdateFleetMiddlewares(stack *middleware.Stack, options Options) (err error) {
219	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateFleet{}, middleware.After)
220	if err != nil {
221		return err
222	}
223	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateFleet{}, middleware.After)
224	if err != nil {
225		return err
226	}
227	if err = addSetLoggerMiddleware(stack, options); err != nil {
228		return err
229	}
230	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
231		return err
232	}
233	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
234		return err
235	}
236	if err = addResolveEndpointMiddleware(stack, options); err != nil {
237		return err
238	}
239	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
240		return err
241	}
242	if err = addRetryMiddlewares(stack, options); err != nil {
243		return err
244	}
245	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
246		return err
247	}
248	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
249		return err
250	}
251	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
252		return err
253	}
254	if err = addClientUserAgent(stack); err != nil {
255		return err
256	}
257	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
258		return err
259	}
260	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
261		return err
262	}
263	if err = addOpUpdateFleetValidationMiddleware(stack); err != nil {
264		return err
265	}
266	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFleet(options.Region), middleware.Before); err != nil {
267		return err
268	}
269	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
270		return err
271	}
272	if err = addResponseErrorMiddleware(stack); err != nil {
273		return err
274	}
275	if err = addRequestResponseLogging(stack, options); err != nil {
276		return err
277	}
278	return nil
279}
280
281func newServiceMetadataMiddleware_opUpdateFleet(region string) *awsmiddleware.RegisterServiceMetadata {
282	return &awsmiddleware.RegisterServiceMetadata{
283		Region:        region,
284		ServiceID:     ServiceID,
285		SigningName:   "appstream",
286		OperationName: "UpdateFleet",
287	}
288}
289