service.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package gamelift
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/client"
  6. "github.com/aws/aws-sdk-go/aws/client/metadata"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/aws/signer/v4"
  9. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  10. )
  11. // Welcome to the Amazon GameLift API Reference. Amazon GameLift is a managed
  12. // Amazon Web Services (AWS) service for developers who need a scalable, server-based
  13. // solution for multiplayer games. Amazon GameLift provides setup and deployment
  14. // of game servers, and handles infrastructure scaling and session management.
  15. //
  16. // This reference describes the low-level service API for GameLift. You can
  17. // call this API directly or use the AWS SDK (https://aws.amazon.com/tools/)
  18. // for your preferred language. The AWS SDK includes a set of high-level GameLift
  19. // actions multiplayer game sessions. Alternatively, you can use the AWS command-line
  20. // interface (https://aws.amazon.com/cli/) (CLI) tool, which includes commands
  21. // for GameLift. For administrative actions, you can also use the Amazon GameLift
  22. // console.
  23. //
  24. // More Resources
  25. //
  26. // Amazon GameLift Developer Guide (http://docs.aws.amazon.com/gamelift/latest/developerguide/):
  27. // Learn more about GameLift features and how to use them Lumberyard and GameLift
  28. // Tutorials (https://gamedev.amazon.com/forums/tutorials): Get started fast
  29. // with walkthroughs and sample projects GameDev Blog (https://aws.amazon.com/blogs/gamedev/):
  30. // Stay up to date with new features and techniques GameDev Forums (https://gamedev.amazon.com/forums/spaces/123/gamelift-discussion.html):
  31. // Connect with the GameDev community Manage Games and Players Through GameLift
  32. //
  33. // Call these actions from your game clients and/or services to create and
  34. // manage multiplayer game sessions and player sessions.
  35. //
  36. // Game sessions CreateGameSession DescribeGameSessions DescribeGameSessionDetails
  37. // UpdateGameSession SearchGameSessions Player sessions CreatePlayerSession
  38. // CreatePlayerSessions DescribePlayerSessions Other actions: GetGameSessionLogUrl
  39. // Set Up and Manage Game Servers
  40. //
  41. // Use these administrative actions to configure GameLift to host your game
  42. // servers. When setting up GameLift, you'll need to (1) configure a build for
  43. // your game and upload build files, and (2) set up one or more fleets to host
  44. // game sessions. Once you've created and activated a fleet, you can assign
  45. // aliases to it, scale capacity, track performance and utilization, etc.
  46. //
  47. // Manage your builds: ListBuilds CreateBuild DescribeBuild UpdateBuild
  48. // DeleteBuild RequestUploadCredentials Manage your fleets: ListFleets CreateFleet
  49. // Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings
  50. // DescribeFleetUtilization DescribeEC2InstanceLimits DescribeFleetEvents DescribeRuntimeConfiguration
  51. // Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings
  52. // UpdateRuntimeConfiguration DeleteFleet Manage fleet aliases: ListAliases
  53. // CreateAlias DescribeAlias UpdateAlias DeleteAlias ResolveAlias Manage
  54. // autoscaling: PutScalingPolicy DescribeScalingPolicies DeleteScalingPolicy
  55. // To view changes to the API, see the GameLift Document History (http://docs.aws.amazon.com/gamelift/latest/developerguide/doc-history.html)
  56. // page.
  57. //The service client's operations are safe to be used concurrently.
  58. // It is not safe to mutate any of the client's properties though.
  59. type GameLift struct {
  60. *client.Client
  61. }
  62. // Used for custom client initialization logic
  63. var initClient func(*client.Client)
  64. // Used for custom request initialization logic
  65. var initRequest func(*request.Request)
  66. // A ServiceName is the name of the service the client will make API calls to.
  67. const ServiceName = "gamelift"
  68. // New creates a new instance of the GameLift client with a session.
  69. // If additional configuration is needed for the client instance use the optional
  70. // aws.Config parameter to add your extra config.
  71. //
  72. // Example:
  73. // // Create a GameLift client from just a session.
  74. // svc := gamelift.New(mySession)
  75. //
  76. // // Create a GameLift client with additional configuration
  77. // svc := gamelift.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  78. func New(p client.ConfigProvider, cfgs ...*aws.Config) *GameLift {
  79. c := p.ClientConfig(ServiceName, cfgs...)
  80. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
  81. }
  82. // newClient creates, initializes and returns a new service client instance.
  83. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *GameLift {
  84. svc := &GameLift{
  85. Client: client.New(
  86. cfg,
  87. metadata.ClientInfo{
  88. ServiceName: ServiceName,
  89. SigningRegion: signingRegion,
  90. Endpoint: endpoint,
  91. APIVersion: "2015-10-01",
  92. JSONVersion: "1.1",
  93. TargetPrefix: "GameLift",
  94. },
  95. handlers,
  96. ),
  97. }
  98. // Handlers
  99. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  100. svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
  101. svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
  102. svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
  103. svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
  104. // Run custom client initialization if present
  105. if initClient != nil {
  106. initClient(svc.Client)
  107. }
  108. return svc
  109. }
  110. // newRequest creates a new request for a GameLift operation and runs any
  111. // custom request initialization.
  112. func (c *GameLift) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  113. req := c.NewRequest(op, params, data)
  114. // Run custom request initialization if present
  115. if initRequest != nil {
  116. initRequest(req)
  117. }
  118. return req
  119. }