/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateSchemaResponse response = new UpdateSchemaResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("RegistryName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RegistryName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SchemaArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SchemaArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SchemaName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SchemaName = unmarshaller.Unmarshall(context); continue; } } return(response); }
public static UpdateSchemaResponse Unmarshall(UnmarshallerContext context) { UpdateSchemaResponse updateSchemaResponse = new UpdateSchemaResponse(); updateSchemaResponse.HttpResponse = context.HttpResponse; updateSchemaResponse.RequestId = context.StringValue("UpdateSchema.RequestId"); UpdateSchemaResponse.UpdateSchema_Result result = new UpdateSchemaResponse.UpdateSchema_Result(); UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_Schema schema = new UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_Schema(); schema.Id = context.LongValue("UpdateSchema.Result.Schema.Id"); schema.Name = context.StringValue("UpdateSchema.Result.Schema.Name"); schema.Description = context.StringValue("UpdateSchema.Result.Schema.Description"); schema.Version = context.LongValue("UpdateSchema.Result.Schema.Version"); schema.CreateTime = context.LongValue("UpdateSchema.Result.Schema.CreateTime"); schema.UpdateTime = context.LongValue("UpdateSchema.Result.Schema.UpdateTime"); schema.IsTemplate = context.BooleanValue("UpdateSchema.Result.Schema.IsTemplate"); result.Schema = schema; List <UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem> result_responses = new List <UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem>(); for (int i = 0; i < context.Length("UpdateSchema.Result.Responses.Length"); i++) { UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem responsesItem = new UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem(); responsesItem.CategoryName = context.StringValue("UpdateSchema.Result.Responses[" + i + "].CategoryName"); responsesItem.Description = context.StringValue("UpdateSchema.Result.Responses[" + i + "].Description"); responsesItem.Category = context.StringValue("UpdateSchema.Result.Responses[" + i + "].Category"); UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem.UpdateSchema_Properties properties = new UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem.UpdateSchema_Properties(); properties.Count = context.IntegerValue("UpdateSchema.Result.Responses[" + i + "].Properties.Count"); List <UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem.UpdateSchema_Properties.UpdateSchema_DataSourceItem> properties_dataSource = new List <UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem.UpdateSchema_Properties.UpdateSchema_DataSourceItem>(); for (int j = 0; j < context.Length("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource.Length"); j++) { UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem.UpdateSchema_Properties.UpdateSchema_DataSourceItem dataSourceItem = new UpdateSchemaResponse.UpdateSchema_Result.UpdateSchema_ResponsesItem.UpdateSchema_Properties.UpdateSchema_DataSourceItem(); dataSourceItem.Key = context.IntegerValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Key"); dataSourceItem.Field = context.StringValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Field"); dataSourceItem.Type = context.StringValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Type"); dataSourceItem.Length = context.IntegerValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Length"); dataSourceItem.AllowNull = context.IntegerValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].AllowNull"); dataSourceItem.Reg = context.StringValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Reg"); dataSourceItem.Indexes = context.IntegerValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Indexes"); dataSourceItem.Annotation = context.StringValue("UpdateSchema.Result.Responses[" + i + "].Properties.DataSource[" + j + "].Annotation"); properties_dataSource.Add(dataSourceItem); } properties.DataSource = properties_dataSource; responsesItem.Properties = properties; result_responses.Add(responsesItem); } result.Responses = result_responses; updateSchemaResponse.Result = result; return(updateSchemaResponse); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { UpdateSchemaResponse response = new UpdateSchemaResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("LastModified", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.LastModified = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SchemaArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SchemaArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SchemaName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SchemaName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("SchemaVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SchemaVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller <string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Type", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Type = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("VersionCreatedDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.VersionCreatedDate = unmarshaller.Unmarshall(context); continue; } } return(response); }