/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            CreateAliasResponse response = new CreateAliasResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Alias", targetDepth))
                {
                    var unmarshaller = AliasUnmarshaller.Instance;
                    response.Alias = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }
예제 #2
0
        static async Task <string> CreateAlias(string name, string fleetId)
        {
            var config = new AmazonGameLiftConfig();

            config.RegionEndpoint = region;
            using (AmazonGameLiftClient aglc = new AmazonGameLiftClient(config))
            {
                // create fleet
                var careq = new Amazon.GameLift.Model.CreateAliasRequest();
                careq.Name            = name;
                careq.Description     = "Alias to direct traffic to " + fleetId;
                careq.RoutingStrategy = new RoutingStrategy
                {
                    Type    = RoutingStrategyType.SIMPLE,
                    FleetId = fleetId,
                    Message = ""
                };
                Amazon.GameLift.Model.CreateAliasResponse cares = await aglc.CreateAliasAsync(careq);

                return(cares.Alias.AliasId);
            }
        }