Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
+2917 -1633
View File
File diff suppressed because it is too large Load Diff
+19 -267
View File
@@ -10,280 +10,32 @@
// your resources to meet player demand and manage costs, and (4) track in-depth
// metrics on game server performance and player usage.
//
// The Amazon GameLift service API includes two important function sets:
// When setting up hosting resources, you can deploy your custom game server
// or use the Amazon GameLift Realtime Servers. Realtime Servers gives you the
// ability to quickly stand up lightweight, efficient game servers with the
// core Amazon GameLift infrastructure already built in.
//
// * Manage game sessions and player access -- Retrieve information on available
// game sessions; create new game sessions; send player requests to join
// a game session.
// Get Amazon GameLift Tools and Resources
//
// * Configure and manage game server resources -- Manage builds, fleets,
// queues, and aliases; set autoscaling policies; retrieve logs and metrics.
// This reference guide describes the low-level service API for Amazon GameLift
// and provides links to language-specific SDK reference topics. See also Amazon
// GameLift Tools and Resources (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-components.html).
//
// This reference guide describes the low-level service API for Amazon GameLift.
// You can use the API functionality with these tools:
// API Summary
//
// * The Amazon Web Services software development kit (AWS SDK (http://aws.amazon.com/tools/#sdk))
// is available in multiple languages (http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-supported.html#gamelift-supported-clients)
// including C++ and C#. Use the SDK to access the API programmatically from
// an application, such as a game client.
// The Amazon GameLift service API includes two key sets of actions:
//
// * The AWS command-line interface (http://aws.amazon.com/cli/) (CLI) tool
// is primarily useful for handling administrative actions, such as setting
// up and managing Amazon GameLift settings and resources. You can use the
// AWS CLI to manage all of your AWS services.
// * Manage game sessions and player access -- Integrate this functionality
// into game client services in order to create new game sessions, retrieve
// information on existing game sessions; reserve a player slot in a game
// session, request matchmaking, etc.
//
// * The AWS Management Console (https://console.aws.amazon.com/gamelift/home)
// for Amazon GameLift provides a web interface to manage your Amazon GameLift
// settings and resources. The console includes a dashboard for tracking
// key resources, including builds and fleets, and displays usage and performance
// metrics for your games as customizable graphs.
// * Configure and manage game server resources -- Manage your Amazon GameLift
// hosting resources, including builds, scripts, fleets, queues, and aliases.
// Set up matchmakers, configure auto-scaling, retrieve game logs, and get
// hosting and game metrics.
//
// * Amazon GameLift Local is a tool for testing your game's integration
// with Amazon GameLift before deploying it on the service. This tools supports
// a subset of key API actions, which can be called from either the AWS CLI
// or programmatically. See Testing an Integration (http://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing-local.html).
//
// Learn more
//
// * Developer Guide (http://docs.aws.amazon.com/gamelift/latest/developerguide/)
// -- Read about Amazon GameLift features and how to use them.
//
// * Tutorials (https://gamedev.amazon.com/forums/tutorials) -- Get started
// fast with walkthroughs and sample projects.
//
// * GameDev Blog (http://aws.amazon.com/blogs/gamedev/) -- Stay up to date
// with new features and techniques.
//
// * GameDev Forums (https://gamedev.amazon.com/forums/spaces/123/gamelift-discussion.html)
// -- Connect with the GameDev community.
//
// * Release notes (http://aws.amazon.com/releasenotes/Amazon-GameLift/)
// and document history (http://docs.aws.amazon.com/gamelift/latest/developerguide/doc-history.html)
// -- Stay current with updates to the Amazon GameLift service, SDKs, and
// documentation.
//
// API SUMMARY
//
// This list offers a functional overview of the Amazon GameLift service API.
//
// Managing Games and Players
//
// Use these actions to start new game sessions, find existing game sessions,
// track game session status and other information, and enable player access
// to game sessions.
//
// * Discover existing game sessions
//
// SearchGameSessions -- Retrieve all available game sessions or search for
// game sessions that match a set of criteria.
//
// * Start new game sessions
//
// Start new games with Queues to find the best available hosting resources
// across multiple regions, minimize player latency, and balance game session
// activity for efficiency and cost effectiveness.
//
// StartGameSessionPlacement -- Request a new game session placement and add
// one or more players to it.
//
// DescribeGameSessionPlacement -- Get details on a placement request, including
// status.
//
// StopGameSessionPlacement -- Cancel a placement request.
//
// CreateGameSession -- Start a new game session on a specific fleet. Available
// in Amazon GameLift Local.
//
// * Match players to game sessions with FlexMatch matchmaking
//
// StartMatchmaking -- Request matchmaking for one players or a group who want
// to play together.
//
// StartMatchBackfill - Request additional player matches to fill empty slots
// in an existing game session.
//
// DescribeMatchmaking -- Get details on a matchmaking request, including status.
//
// AcceptMatch -- Register that a player accepts a proposed match, for matches
// that require player acceptance.
//
// StopMatchmaking -- Cancel a matchmaking request.
//
// * Manage game session data
//
// DescribeGameSessions -- Retrieve metadata for one or more game sessions,
// including length of time active and current player count. Available in
// Amazon GameLift Local.
//
// DescribeGameSessionDetails -- Retrieve metadata and the game session protection
// setting for one or more game sessions.
//
// UpdateGameSession -- Change game session settings, such as maximum player
// count and join policy.
//
// GetGameSessionLogUrl -- Get the location of saved logs for a game session.
//
// * Manage player sessions
//
// CreatePlayerSession -- Send a request for a player to join a game session.
// Available in Amazon GameLift Local.
//
// CreatePlayerSessions -- Send a request for multiple players to join a game
// session. Available in Amazon GameLift Local.
//
// DescribePlayerSessions -- Get details on player activity, including status,
// playing time, and player data. Available in Amazon GameLift Local.
//
// Setting Up and Managing Game Servers
//
// When setting up Amazon GameLift resources for your game, you first create
// a game build (http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html)
// and upload it to Amazon GameLift. You can then use these actions to configure
// and manage a fleet of resources to run your game servers, scale capacity
// to meet player demand, access performance and utilization metrics, and more.
//
// * Manage game builds
//
// CreateBuild -- Create a new build using files stored in an Amazon S3 bucket.
// To create a build and upload files from a local path, use the AWS CLI
// command upload-build.
//
// ListBuilds -- Get a list of all builds uploaded to a Amazon GameLift region.
//
// DescribeBuild -- Retrieve information associated with a build.
//
// UpdateBuild -- Change build metadata, including build name and version.
//
// DeleteBuild -- Remove a build from Amazon GameLift.
//
// * Manage fleets
//
// CreateFleet -- Configure and activate a new fleet to run a build's game servers.
//
// ListFleets -- Get a list of all fleet IDs in a Amazon GameLift region (all
// statuses).
//
// DeleteFleet -- Terminate a fleet that is no longer running game servers or
// hosting players.
//
// View / update fleet configurations.
//
// DescribeFleetAttributes / UpdateFleetAttributes -- View or change a fleet's
// metadata and settings for game session protection and resource creation
// limits.
//
// DescribeFleetPortSettings / UpdateFleetPortSettings -- View or change the
// inbound permissions (IP address and port setting ranges) allowed for a
// fleet.
//
// DescribeRuntimeConfiguration / UpdateRuntimeConfiguration -- View or change
// what server processes (and how many) to run on each instance in a fleet.
//
// * Control fleet capacity
//
// DescribeEC2InstanceLimits -- Retrieve maximum number of instances allowed
// for the current AWS account and the current usage level.
//
// DescribeFleetCapacity / UpdateFleetCapacity -- Retrieve the capacity settings
// and the current number of instances in a fleet; adjust fleet capacity
// settings to scale up or down.
//
// Autoscale -- Manage autoscaling rules and apply them to a fleet.
//
// PutScalingPolicy -- Create a new autoscaling policy, or update an existing
// one.
//
// DescribeScalingPolicies -- Retrieve an existing autoscaling policy.
//
// DeleteScalingPolicy -- Delete an autoscaling policy and stop it from affecting
// a fleet's capacity.
//
// * Manage VPC peering connections for fleets
//
// CreateVpcPeeringAuthorization -- Authorize a peering connection to one of
// your VPCs.
//
// DescribeVpcPeeringAuthorizations -- Retrieve valid peering connection authorizations.
//
//
// DeleteVpcPeeringAuthorization -- Delete a peering connection authorization.
//
// CreateVpcPeeringConnection -- Establish a peering connection between the
// VPC for a Amazon GameLift fleet and one of your VPCs.
//
// DescribeVpcPeeringConnections -- Retrieve information on active or pending
// VPC peering connections with a Amazon GameLift fleet.
//
// DeleteVpcPeeringConnection -- Delete a VPC peering connection with a Amazon
// GameLift fleet.
//
// * Access fleet activity statistics
//
// DescribeFleetUtilization -- Get current data on the number of server processes,
// game sessions, and players currently active on a fleet.
//
// DescribeFleetEvents -- Get a fleet's logged events for a specified time span.
//
// DescribeGameSessions -- Retrieve metadata associated with one or more game
// sessions, including length of time active and current player count.
//
// * Remotely access an instance
//
// DescribeInstances -- Get information on each instance in a fleet, including
// instance ID, IP address, and status.
//
// GetInstanceAccess -- Request access credentials needed to remotely connect
// to a specified instance in a fleet.
//
// * Manage fleet aliases
//
// CreateAlias -- Define a new alias and optionally assign it to a fleet.
//
// ListAliases -- Get all fleet aliases defined in a Amazon GameLift region.
//
// DescribeAlias -- Retrieve information on an existing alias.
//
// UpdateAlias -- Change settings for a alias, such as redirecting it from one
// fleet to another.
//
// DeleteAlias -- Remove an alias from the region.
//
// ResolveAlias -- Get the fleet ID that a specified alias points to.
//
// * Manage game session queues
//
// CreateGameSessionQueue -- Create a queue for processing requests for new
// game sessions.
//
// DescribeGameSessionQueues -- Retrieve game session queues defined in a Amazon
// GameLift region.
//
// UpdateGameSessionQueue -- Change the configuration of a game session queue.
//
// DeleteGameSessionQueue -- Remove a game session queue from the region.
//
// * Manage FlexMatch resources
//
// CreateMatchmakingConfiguration -- Create a matchmaking configuration with
// instructions for building a player group and placing in a new game session.
//
//
// DescribeMatchmakingConfigurations -- Retrieve matchmaking configurations
// defined a Amazon GameLift region.
//
// UpdateMatchmakingConfiguration -- Change settings for matchmaking configuration.
// queue.
//
// DeleteMatchmakingConfiguration -- Remove a matchmaking configuration from
// the region.
//
// CreateMatchmakingRuleSet -- Create a set of rules to use when searching for
// player matches.
//
// DescribeMatchmakingRuleSets -- Retrieve matchmaking rule sets defined in
// a Amazon GameLift region.
//
// ValidateMatchmakingRuleSet -- Verify syntax for a set of matchmaking rules.
// Task-based list of API actions (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html)
//
// See https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01 for more information on this service.
//
@@ -100,6 +100,10 @@ type GameLiftAPI interface {
CreatePlayerSessionsWithContext(aws.Context, *gamelift.CreatePlayerSessionsInput, ...request.Option) (*gamelift.CreatePlayerSessionsOutput, error)
CreatePlayerSessionsRequest(*gamelift.CreatePlayerSessionsInput) (*request.Request, *gamelift.CreatePlayerSessionsOutput)
CreateScript(*gamelift.CreateScriptInput) (*gamelift.CreateScriptOutput, error)
CreateScriptWithContext(aws.Context, *gamelift.CreateScriptInput, ...request.Option) (*gamelift.CreateScriptOutput, error)
CreateScriptRequest(*gamelift.CreateScriptInput) (*request.Request, *gamelift.CreateScriptOutput)
CreateVpcPeeringAuthorization(*gamelift.CreateVpcPeeringAuthorizationInput) (*gamelift.CreateVpcPeeringAuthorizationOutput, error)
CreateVpcPeeringAuthorizationWithContext(aws.Context, *gamelift.CreateVpcPeeringAuthorizationInput, ...request.Option) (*gamelift.CreateVpcPeeringAuthorizationOutput, error)
CreateVpcPeeringAuthorizationRequest(*gamelift.CreateVpcPeeringAuthorizationInput) (*request.Request, *gamelift.CreateVpcPeeringAuthorizationOutput)
@@ -128,10 +132,18 @@ type GameLiftAPI interface {
DeleteMatchmakingConfigurationWithContext(aws.Context, *gamelift.DeleteMatchmakingConfigurationInput, ...request.Option) (*gamelift.DeleteMatchmakingConfigurationOutput, error)
DeleteMatchmakingConfigurationRequest(*gamelift.DeleteMatchmakingConfigurationInput) (*request.Request, *gamelift.DeleteMatchmakingConfigurationOutput)
DeleteMatchmakingRuleSet(*gamelift.DeleteMatchmakingRuleSetInput) (*gamelift.DeleteMatchmakingRuleSetOutput, error)
DeleteMatchmakingRuleSetWithContext(aws.Context, *gamelift.DeleteMatchmakingRuleSetInput, ...request.Option) (*gamelift.DeleteMatchmakingRuleSetOutput, error)
DeleteMatchmakingRuleSetRequest(*gamelift.DeleteMatchmakingRuleSetInput) (*request.Request, *gamelift.DeleteMatchmakingRuleSetOutput)
DeleteScalingPolicy(*gamelift.DeleteScalingPolicyInput) (*gamelift.DeleteScalingPolicyOutput, error)
DeleteScalingPolicyWithContext(aws.Context, *gamelift.DeleteScalingPolicyInput, ...request.Option) (*gamelift.DeleteScalingPolicyOutput, error)
DeleteScalingPolicyRequest(*gamelift.DeleteScalingPolicyInput) (*request.Request, *gamelift.DeleteScalingPolicyOutput)
DeleteScript(*gamelift.DeleteScriptInput) (*gamelift.DeleteScriptOutput, error)
DeleteScriptWithContext(aws.Context, *gamelift.DeleteScriptInput, ...request.Option) (*gamelift.DeleteScriptOutput, error)
DeleteScriptRequest(*gamelift.DeleteScriptInput) (*request.Request, *gamelift.DeleteScriptOutput)
DeleteVpcPeeringAuthorization(*gamelift.DeleteVpcPeeringAuthorizationInput) (*gamelift.DeleteVpcPeeringAuthorizationOutput, error)
DeleteVpcPeeringAuthorizationWithContext(aws.Context, *gamelift.DeleteVpcPeeringAuthorizationInput, ...request.Option) (*gamelift.DeleteVpcPeeringAuthorizationOutput, error)
DeleteVpcPeeringAuthorizationRequest(*gamelift.DeleteVpcPeeringAuthorizationInput) (*request.Request, *gamelift.DeleteVpcPeeringAuthorizationOutput)
@@ -216,6 +228,10 @@ type GameLiftAPI interface {
DescribeScalingPoliciesWithContext(aws.Context, *gamelift.DescribeScalingPoliciesInput, ...request.Option) (*gamelift.DescribeScalingPoliciesOutput, error)
DescribeScalingPoliciesRequest(*gamelift.DescribeScalingPoliciesInput) (*request.Request, *gamelift.DescribeScalingPoliciesOutput)
DescribeScript(*gamelift.DescribeScriptInput) (*gamelift.DescribeScriptOutput, error)
DescribeScriptWithContext(aws.Context, *gamelift.DescribeScriptInput, ...request.Option) (*gamelift.DescribeScriptOutput, error)
DescribeScriptRequest(*gamelift.DescribeScriptInput) (*request.Request, *gamelift.DescribeScriptOutput)
DescribeVpcPeeringAuthorizations(*gamelift.DescribeVpcPeeringAuthorizationsInput) (*gamelift.DescribeVpcPeeringAuthorizationsOutput, error)
DescribeVpcPeeringAuthorizationsWithContext(aws.Context, *gamelift.DescribeVpcPeeringAuthorizationsInput, ...request.Option) (*gamelift.DescribeVpcPeeringAuthorizationsOutput, error)
DescribeVpcPeeringAuthorizationsRequest(*gamelift.DescribeVpcPeeringAuthorizationsInput) (*request.Request, *gamelift.DescribeVpcPeeringAuthorizationsOutput)
@@ -244,6 +260,10 @@ type GameLiftAPI interface {
ListFleetsWithContext(aws.Context, *gamelift.ListFleetsInput, ...request.Option) (*gamelift.ListFleetsOutput, error)
ListFleetsRequest(*gamelift.ListFleetsInput) (*request.Request, *gamelift.ListFleetsOutput)
ListScripts(*gamelift.ListScriptsInput) (*gamelift.ListScriptsOutput, error)
ListScriptsWithContext(aws.Context, *gamelift.ListScriptsInput, ...request.Option) (*gamelift.ListScriptsOutput, error)
ListScriptsRequest(*gamelift.ListScriptsInput) (*request.Request, *gamelift.ListScriptsOutput)
PutScalingPolicy(*gamelift.PutScalingPolicyInput) (*gamelift.PutScalingPolicyOutput, error)
PutScalingPolicyWithContext(aws.Context, *gamelift.PutScalingPolicyInput, ...request.Option) (*gamelift.PutScalingPolicyOutput, error)
PutScalingPolicyRequest(*gamelift.PutScalingPolicyInput) (*request.Request, *gamelift.PutScalingPolicyOutput)
@@ -260,6 +280,10 @@ type GameLiftAPI interface {
SearchGameSessionsWithContext(aws.Context, *gamelift.SearchGameSessionsInput, ...request.Option) (*gamelift.SearchGameSessionsOutput, error)
SearchGameSessionsRequest(*gamelift.SearchGameSessionsInput) (*request.Request, *gamelift.SearchGameSessionsOutput)
StartFleetActions(*gamelift.StartFleetActionsInput) (*gamelift.StartFleetActionsOutput, error)
StartFleetActionsWithContext(aws.Context, *gamelift.StartFleetActionsInput, ...request.Option) (*gamelift.StartFleetActionsOutput, error)
StartFleetActionsRequest(*gamelift.StartFleetActionsInput) (*request.Request, *gamelift.StartFleetActionsOutput)
StartGameSessionPlacement(*gamelift.StartGameSessionPlacementInput) (*gamelift.StartGameSessionPlacementOutput, error)
StartGameSessionPlacementWithContext(aws.Context, *gamelift.StartGameSessionPlacementInput, ...request.Option) (*gamelift.StartGameSessionPlacementOutput, error)
StartGameSessionPlacementRequest(*gamelift.StartGameSessionPlacementInput) (*request.Request, *gamelift.StartGameSessionPlacementOutput)
@@ -272,6 +296,10 @@ type GameLiftAPI interface {
StartMatchmakingWithContext(aws.Context, *gamelift.StartMatchmakingInput, ...request.Option) (*gamelift.StartMatchmakingOutput, error)
StartMatchmakingRequest(*gamelift.StartMatchmakingInput) (*request.Request, *gamelift.StartMatchmakingOutput)
StopFleetActions(*gamelift.StopFleetActionsInput) (*gamelift.StopFleetActionsOutput, error)
StopFleetActionsWithContext(aws.Context, *gamelift.StopFleetActionsInput, ...request.Option) (*gamelift.StopFleetActionsOutput, error)
StopFleetActionsRequest(*gamelift.StopFleetActionsInput) (*request.Request, *gamelift.StopFleetActionsOutput)
StopGameSessionPlacement(*gamelift.StopGameSessionPlacementInput) (*gamelift.StopGameSessionPlacementOutput, error)
StopGameSessionPlacementWithContext(aws.Context, *gamelift.StopGameSessionPlacementInput, ...request.Option) (*gamelift.StopGameSessionPlacementOutput, error)
StopGameSessionPlacementRequest(*gamelift.StopGameSessionPlacementInput) (*request.Request, *gamelift.StopGameSessionPlacementOutput)
@@ -316,6 +344,10 @@ type GameLiftAPI interface {
UpdateRuntimeConfigurationWithContext(aws.Context, *gamelift.UpdateRuntimeConfigurationInput, ...request.Option) (*gamelift.UpdateRuntimeConfigurationOutput, error)
UpdateRuntimeConfigurationRequest(*gamelift.UpdateRuntimeConfigurationInput) (*request.Request, *gamelift.UpdateRuntimeConfigurationOutput)
UpdateScript(*gamelift.UpdateScriptInput) (*gamelift.UpdateScriptOutput, error)
UpdateScriptWithContext(aws.Context, *gamelift.UpdateScriptInput, ...request.Option) (*gamelift.UpdateScriptOutput, error)
UpdateScriptRequest(*gamelift.UpdateScriptInput) (*request.Request, *gamelift.UpdateScriptOutput)
ValidateMatchmakingRuleSet(*gamelift.ValidateMatchmakingRuleSetInput) (*gamelift.ValidateMatchmakingRuleSetOutput, error)
ValidateMatchmakingRuleSetWithContext(aws.Context, *gamelift.ValidateMatchmakingRuleSetInput, ...request.Option) (*gamelift.ValidateMatchmakingRuleSetOutput, error)
ValidateMatchmakingRuleSetRequest(*gamelift.ValidateMatchmakingRuleSetInput) (*request.Request, *gamelift.ValidateMatchmakingRuleSetOutput)
+58
View File
@@ -0,0 +1,58 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// +build go1.10,integration
package gamelift_test
import (
"context"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting/integration"
"github.com/aws/aws-sdk-go/service/gamelift"
)
var _ aws.Config
var _ awserr.Error
var _ request.Request
func TestInteg_00_ListBuilds(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := gamelift.New(sess)
params := &gamelift.ListBuildsInput{}
_, err := svc.ListBuildsWithContext(ctx, params)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestInteg_01_DescribePlayerSessions(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := gamelift.New(sess)
params := &gamelift.DescribePlayerSessionsInput{
PlayerSessionId: aws.String("psess-fakeSessionId"),
}
_, err := svc.DescribePlayerSessionsWithContext(ctx, params)
if err == nil {
t.Fatalf("expect request to fail")
}
aerr, ok := err.(awserr.RequestFailure)
if !ok {
t.Fatalf("expect awserr, was %T", err)
}
if len(aerr.Code()) == 0 {
t.Errorf("expect non-empty error code")
}
if v := aerr.Code(); v == request.ErrCodeSerialization {
t.Errorf("expect API error code got serialization failure")
}
}
+4 -2
View File
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "gamelift" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "gamelift" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "GameLift" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the GameLift client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,