public static DescribeCommandsResponse Unmarshall(UnmarshallerContext context) { DescribeCommandsResponse describeCommandsResponse = new DescribeCommandsResponse(); describeCommandsResponse.HttpResponse = context.HttpResponse; describeCommandsResponse.RequestId = context.StringValue("DescribeCommands.RequestId"); describeCommandsResponse.TotalCount = context.LongValue("DescribeCommands.TotalCount"); describeCommandsResponse.PageNumber = context.LongValue("DescribeCommands.PageNumber"); describeCommandsResponse.PageSize = context.LongValue("DescribeCommands.PageSize"); List <DescribeCommandsResponse.DescribeCommands_Command> describeCommandsResponse_commands = new List <DescribeCommandsResponse.DescribeCommands_Command>(); for (int i = 0; i < context.Length("DescribeCommands.Commands.Length"); i++) { DescribeCommandsResponse.DescribeCommands_Command command = new DescribeCommandsResponse.DescribeCommands_Command(); command.CommandId = context.StringValue("DescribeCommands.Commands[" + i + "].CommandId"); command.Name = context.StringValue("DescribeCommands.Commands[" + i + "].Name"); command.Type = context.StringValue("DescribeCommands.Commands[" + i + "].Type"); command.Description = context.StringValue("DescribeCommands.Commands[" + i + "].Description"); command.CommandContent = context.StringValue("DescribeCommands.Commands[" + i + "].CommandContent"); command.WorkingDir = context.StringValue("DescribeCommands.Commands[" + i + "].WorkingDir"); command.Timeout = context.LongValue("DescribeCommands.Commands[" + i + "].Timeout"); command.CreationTime = context.StringValue("DescribeCommands.Commands[" + i + "].CreationTime"); describeCommandsResponse_commands.Add(command); } describeCommandsResponse.Commands = describeCommandsResponse_commands; return(describeCommandsResponse); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeCommandsResponse response = new DescribeCommandsResponse(); context.Read(); UnmarshallResult(context, response); return(response); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeCommandsResponse response = new DescribeCommandsResponse(); context.Read(); response.DescribeCommandsResult = DescribeCommandsResultUnmarshaller.GetInstance().Unmarshall(context); return(response); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeCommandsResponse response = new DescribeCommandsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Commands", targetDepth)) { var unmarshaller = new ListUnmarshaller <Command, CommandUnmarshaller>(CommandUnmarshaller.Instance); response.Commands = unmarshaller.Unmarshall(context); continue; } } return(response); }
public static DescribeCommandsResponse Unmarshall(UnmarshallerContext _ctx) { DescribeCommandsResponse describeCommandsResponse = new DescribeCommandsResponse(); describeCommandsResponse.HttpResponse = _ctx.HttpResponse; describeCommandsResponse.RequestId = _ctx.StringValue("DescribeCommands.RequestId"); describeCommandsResponse.TotalCount = _ctx.LongValue("DescribeCommands.TotalCount"); describeCommandsResponse.PageNumber = _ctx.LongValue("DescribeCommands.PageNumber"); describeCommandsResponse.PageSize = _ctx.LongValue("DescribeCommands.PageSize"); List <DescribeCommandsResponse.DescribeCommands_Command> describeCommandsResponse_commands = new List <DescribeCommandsResponse.DescribeCommands_Command>(); for (int i = 0; i < _ctx.Length("DescribeCommands.Commands.Length"); i++) { DescribeCommandsResponse.DescribeCommands_Command command = new DescribeCommandsResponse.DescribeCommands_Command(); command.CommandId = _ctx.StringValue("DescribeCommands.Commands[" + i + "].CommandId"); command.Name = _ctx.StringValue("DescribeCommands.Commands[" + i + "].Name"); command.Type = _ctx.StringValue("DescribeCommands.Commands[" + i + "].Type"); command.Version = _ctx.IntegerValue("DescribeCommands.Commands[" + i + "].Version"); command.Latest = _ctx.BooleanValue("DescribeCommands.Commands[" + i + "].Latest"); command.Provider = _ctx.StringValue("DescribeCommands.Commands[" + i + "].Provider"); command.Category = _ctx.StringValue("DescribeCommands.Commands[" + i + "].Category"); command.Description = _ctx.StringValue("DescribeCommands.Commands[" + i + "].Description"); command.CommandContent = _ctx.StringValue("DescribeCommands.Commands[" + i + "].CommandContent"); command.WorkingDir = _ctx.StringValue("DescribeCommands.Commands[" + i + "].WorkingDir"); command.Timeout = _ctx.LongValue("DescribeCommands.Commands[" + i + "].Timeout"); command.InvokeTimes = _ctx.IntegerValue("DescribeCommands.Commands[" + i + "].InvokeTimes"); command.CreationTime = _ctx.StringValue("DescribeCommands.Commands[" + i + "].CreationTime"); command.EnableParameter = _ctx.BooleanValue("DescribeCommands.Commands[" + i + "].EnableParameter"); List <string> command_parameterNames = new List <string>(); for (int j = 0; j < _ctx.Length("DescribeCommands.Commands[" + i + "].ParameterNames.Length"); j++) { command_parameterNames.Add(_ctx.StringValue("DescribeCommands.Commands[" + i + "].ParameterNames[" + j + "]")); } command.ParameterNames = command_parameterNames; describeCommandsResponse_commands.Add(command); } describeCommandsResponse.Commands = describeCommandsResponse_commands; return(describeCommandsResponse); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonOpsWorksConfig config = new AmazonOpsWorksConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonOpsWorksClient client = new AmazonOpsWorksClient(creds, config); DescribeCommandsResponse resp = new DescribeCommandsResponse(); DescribeCommandsRequest req = new DescribeCommandsRequest { }; resp = client.DescribeCommands(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Commands) { AddObject(obj); } }
private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeCommandsResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if (context.TestExpression("Commands", targetDepth)) { context.Read(); response.Commands = new List <Command>(); CommandUnmarshaller unmarshaller = CommandUnmarshaller.GetInstance(); while (context.Read()) { JsonToken token = context.CurrentTokenType; if (token == JsonToken.ArrayStart) { continue; } if (token == JsonToken.ArrayEnd) { break; } response.Commands.Add(unmarshaller.Unmarshall(context)); } continue; } if (context.CurrentDepth <= originalDepth) { return; } } return; }