1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package gamelift
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/gamelift/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Resumes certain types of activity on fleet instances that were suspended with
15// StopFleetActions. For multi-location fleets, fleet actions are managed
16// separately for each location. Currently, this operation is used to restart a
17// fleet's auto-scaling activity. This operation can be used in the following
18// ways:
19//
20// * To restart actions on instances in the fleet's home Region, provide a
21// fleet ID and the type of actions to resume.
22//
23// * To restart actions on instances
24// in one of the fleet's remote locations, provide a fleet ID, a location name, and
25// the type of actions to resume.
26//
27// If successful, GameLift once again initiates
28// scaling events as triggered by the fleet's scaling policies. If actions on the
29// fleet location were never stopped, this operation will have no effect. You can
30// view a fleet's stopped actions using DescribeFleetAttributes or
31// DescribeFleetLocationAttributes. Learn more Setting up GameLift fleets
32// (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html)
33// Related actions CreateFleet | UpdateFleetCapacity | PutScalingPolicy |
34// DescribeEC2InstanceLimits | DescribeFleetAttributes |
35// DescribeFleetLocationAttributes | UpdateFleetAttributes | StopFleetActions |
36// DeleteFleet | All APIs by task
37// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets)
38func (c *Client) StartFleetActions(ctx context.Context, params *StartFleetActionsInput, optFns ...func(*Options)) (*StartFleetActionsOutput, error) {
39	if params == nil {
40		params = &StartFleetActionsInput{}
41	}
42
43	result, metadata, err := c.invokeOperation(ctx, "StartFleetActions", params, optFns, addOperationStartFleetActionsMiddlewares)
44	if err != nil {
45		return nil, err
46	}
47
48	out := result.(*StartFleetActionsOutput)
49	out.ResultMetadata = metadata
50	return out, nil
51}
52
53// Represents the input for a request operation.
54type StartFleetActionsInput struct {
55
56	// List of actions to restart on the fleet.
57	//
58	// This member is required.
59	Actions []types.FleetAction
60
61	// A unique identifier for the fleet to restart actions on. You can use either the
62	// fleet ID or ARN value.
63	//
64	// This member is required.
65	FleetId *string
66
67	// The fleet location to restart fleet actions for. Specify a location in the form
68	// of an AWS Region code, such as us-west-2.
69	Location *string
70}
71
72// Represents the returned data in response to a request operation.
73type StartFleetActionsOutput struct {
74
75	// The Amazon Resource Name (ARN
76	// (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is
77	// assigned to a GameLift fleet resource and uniquely identifies it. ARNs are
78	// unique across all Regions. Format is
79	// arn:aws:gamelift:::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912.
80	FleetArn *string
81
82	// A unique identifier for the fleet to restart actions on.
83	FleetId *string
84
85	// Metadata pertaining to the operation's result.
86	ResultMetadata middleware.Metadata
87}
88
89func addOperationStartFleetActionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
90	err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartFleetActions{}, middleware.After)
91	if err != nil {
92		return err
93	}
94	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartFleetActions{}, middleware.After)
95	if err != nil {
96		return err
97	}
98	if err = addSetLoggerMiddleware(stack, options); err != nil {
99		return err
100	}
101	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
102		return err
103	}
104	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
105		return err
106	}
107	if err = addResolveEndpointMiddleware(stack, options); err != nil {
108		return err
109	}
110	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
111		return err
112	}
113	if err = addRetryMiddlewares(stack, options); err != nil {
114		return err
115	}
116	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
117		return err
118	}
119	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
120		return err
121	}
122	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
123		return err
124	}
125	if err = addClientUserAgent(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
129		return err
130	}
131	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
132		return err
133	}
134	if err = addOpStartFleetActionsValidationMiddleware(stack); err != nil {
135		return err
136	}
137	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartFleetActions(options.Region), middleware.Before); err != nil {
138		return err
139	}
140	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addResponseErrorMiddleware(stack); err != nil {
144		return err
145	}
146	if err = addRequestResponseLogging(stack, options); err != nil {
147		return err
148	}
149	return nil
150}
151
152func newServiceMetadataMiddleware_opStartFleetActions(region string) *awsmiddleware.RegisterServiceMetadata {
153	return &awsmiddleware.RegisterServiceMetadata{
154		Region:        region,
155		ServiceID:     ServiceID,
156		SigningName:   "gamelift",
157		OperationName: "StartFleetActions",
158	}
159}
160