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// Updates settings for a FlexMatch matchmaking configuration. These changes affect
15// all matches and game sessions that are created after the update. To update
16// settings, specify the configuration name to be updated and provide the new
17// settings. Learn more  Design a FlexMatch matchmaker
18// (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-configuration.html)
19// Related actions CreateMatchmakingConfiguration |
20// DescribeMatchmakingConfigurations | UpdateMatchmakingConfiguration |
21// DeleteMatchmakingConfiguration | CreateMatchmakingRuleSet |
22// DescribeMatchmakingRuleSets | ValidateMatchmakingRuleSet |
23// DeleteMatchmakingRuleSet | All APIs by task
24// (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets)
25func (c *Client) UpdateMatchmakingConfiguration(ctx context.Context, params *UpdateMatchmakingConfigurationInput, optFns ...func(*Options)) (*UpdateMatchmakingConfigurationOutput, error) {
26	if params == nil {
27		params = &UpdateMatchmakingConfigurationInput{}
28	}
29
30	result, metadata, err := c.invokeOperation(ctx, "UpdateMatchmakingConfiguration", params, optFns, addOperationUpdateMatchmakingConfigurationMiddlewares)
31	if err != nil {
32		return nil, err
33	}
34
35	out := result.(*UpdateMatchmakingConfigurationOutput)
36	out.ResultMetadata = metadata
37	return out, nil
38}
39
40// Represents the input for a request operation.
41type UpdateMatchmakingConfigurationInput struct {
42
43	// A unique identifier for the matchmaking configuration to update. You can use
44	// either the configuration name or ARN value.
45	//
46	// This member is required.
47	Name *string
48
49	// A flag that indicates whether a match that was created with this configuration
50	// must be accepted by the matched players. To require acceptance, set to TRUE.
51	// With this option enabled, matchmaking tickets use the status REQUIRES_ACCEPTANCE
52	// to indicate when a completed potential match is waiting for player acceptance.
53	AcceptanceRequired *bool
54
55	// The length of time (in seconds) to wait for players to accept a proposed match,
56	// if acceptance is required.
57	AcceptanceTimeoutSeconds *int32
58
59	// The number of player slots in a match to keep open for future players. For
60	// example, if the configuration's rule set specifies a match for a single
61	// 12-person team, and the additional player count is set to 2, only 10 players are
62	// selected for the match. This parameter is not used if FlexMatchMode is set to
63	// STANDALONE.
64	AdditionalPlayerCount *int32
65
66	// The method that is used to backfill game sessions created with this matchmaking
67	// configuration. Specify MANUAL when your game manages backfill requests manually
68	// or does not use the match backfill feature. Specify AUTOMATIC to have GameLift
69	// create a StartMatchBackfill request whenever a game session has one or more open
70	// slots. Learn more about manual and automatic backfill in Backfill Existing Games
71	// with FlexMatch
72	// (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html).
73	// Automatic backfill is not available when FlexMatchMode is set to STANDALONE.
74	BackfillMode types.BackfillMode
75
76	// Information to add to all events related to the matchmaking configuration.
77	CustomEventData *string
78
79	// A descriptive label that is associated with matchmaking configuration.
80	Description *string
81
82	// Indicates whether this matchmaking configuration is being used with GameLift
83	// hosting or as a standalone matchmaking solution.
84	//
85	// * STANDALONE - FlexMatch forms
86	// matches and returns match information, including players and team assignments,
87	// in a  MatchmakingSucceeded
88	// (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-events.html#match-events-matchmakingsucceeded)
89	// event.
90	//
91	// * WITH_QUEUE - FlexMatch forms matches and uses the specified GameLift
92	// queue to start a game session for the match.
93	FlexMatchMode types.FlexMatchMode
94
95	// A set of custom properties for a game session, formatted as key:value pairs.
96	// These properties are passed to a game server process in the GameSession object
97	// with a request to start a new game session (see Start a Game Session
98	// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)).
99	// This information is added to the new GameSession object that is created for a
100	// successful match. This parameter is not used if FlexMatchMode is set to
101	// STANDALONE.
102	GameProperties []types.GameProperty
103
104	// A set of custom game session properties, formatted as a single string value.
105	// This data is passed to a game server process in the GameSession object with a
106	// request to start a new game session (see Start a Game Session
107	// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)).
108	// This information is added to the new GameSession object that is created for a
109	// successful match. This parameter is not used if FlexMatchMode is set to
110	// STANDALONE.
111	GameSessionData *string
112
113	// The Amazon Resource Name (ARN
114	// (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) that is
115	// assigned to a GameLift game session queue resource and uniquely identifies it.
116	// ARNs are unique across all Regions. Format is
117	// arn:aws:gamelift:::gamesessionqueue/. Queues can be located in any Region.
118	// Queues are used to start new GameLift-hosted game sessions for matches that are
119	// created with this matchmaking configuration. If FlexMatchMode is set to
120	// STANDALONE, do not set this parameter.
121	GameSessionQueueArns []string
122
123	// An SNS topic ARN that is set up to receive matchmaking notifications. See
124	// Setting up notifications for matchmaking
125	// (https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-notification.html)
126	// for more information.
127	NotificationTarget *string
128
129	// The maximum duration, in seconds, that a matchmaking ticket can remain in
130	// process before timing out. Requests that fail due to timing out can be
131	// resubmitted as needed.
132	RequestTimeoutSeconds *int32
133
134	// A unique identifier for the matchmaking rule set to use with this configuration.
135	// You can use either the rule set name or ARN value. A matchmaking configuration
136	// can only use rule sets that are defined in the same Region.
137	RuleSetName *string
138}
139
140// Represents the returned data in response to a request operation.
141type UpdateMatchmakingConfigurationOutput struct {
142
143	// The updated matchmaking configuration.
144	Configuration *types.MatchmakingConfiguration
145
146	// Metadata pertaining to the operation's result.
147	ResultMetadata middleware.Metadata
148}
149
150func addOperationUpdateMatchmakingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
151	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMatchmakingConfiguration{}, middleware.After)
152	if err != nil {
153		return err
154	}
155	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMatchmakingConfiguration{}, middleware.After)
156	if err != nil {
157		return err
158	}
159	if err = addSetLoggerMiddleware(stack, options); err != nil {
160		return err
161	}
162	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
163		return err
164	}
165	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
166		return err
167	}
168	if err = addResolveEndpointMiddleware(stack, options); err != nil {
169		return err
170	}
171	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
172		return err
173	}
174	if err = addRetryMiddlewares(stack, options); err != nil {
175		return err
176	}
177	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
178		return err
179	}
180	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
181		return err
182	}
183	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
184		return err
185	}
186	if err = addClientUserAgent(stack); err != nil {
187		return err
188	}
189	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
190		return err
191	}
192	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
193		return err
194	}
195	if err = addOpUpdateMatchmakingConfigurationValidationMiddleware(stack); err != nil {
196		return err
197	}
198	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMatchmakingConfiguration(options.Region), middleware.Before); err != nil {
199		return err
200	}
201	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
202		return err
203	}
204	if err = addResponseErrorMiddleware(stack); err != nil {
205		return err
206	}
207	if err = addRequestResponseLogging(stack, options); err != nil {
208		return err
209	}
210	return nil
211}
212
213func newServiceMetadataMiddleware_opUpdateMatchmakingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
214	return &awsmiddleware.RegisterServiceMetadata{
215		Region:        region,
216		ServiceID:     ServiceID,
217		SigningName:   "gamelift",
218		OperationName: "UpdateMatchmakingConfiguration",
219	}
220}
221