本文整理汇总了C#中Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext.TestExpression方法的典型用法代码示例。如果您正苦于以下问题:C# JsonUnmarshallerContext.TestExpression方法的具体用法?C# JsonUnmarshallerContext.TestExpression怎么用?C# JsonUnmarshallerContext.TestExpression使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext
的用法示例。
在下文中一共展示了JsonUnmarshallerContext.TestExpression方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Unmarshall
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DescribeCommunicationsResponse response = new DescribeCommunicationsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("communications", targetDepth))
{
var unmarshaller = new ListUnmarshaller<Communication,CommunicationUnmarshaller>(
CommunicationUnmarshaller.GetInstance());
response.Communications = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("nextToken", targetDepth))
{
response.NextToken = StringUnmarshaller.GetInstance().Unmarshall(context);
continue;
}
}
return response;
}
示例2: Unmarshall
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListInstancesResponse response = new ListInstancesResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("Instances", targetDepth))
{
var unmarshaller = new ListUnmarshaller<Instance, InstanceUnmarshaller>(InstanceUnmarshaller.Instance);
response.Instances = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Marker", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.Marker = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例3: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GenerateDataKeyResponse response = new GenerateDataKeyResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("CiphertextBlob", targetDepth))
{
var unmarshaller = MemoryStreamUnmarshaller.Instance;
response.CiphertextBlob = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("KeyId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.KeyId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Plaintext", targetDepth))
{
var unmarshaller = MemoryStreamUnmarshaller.Instance;
response.Plaintext = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例4: Unmarshall
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
TestRoleResponse response = new TestRoleResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("Success", targetDepth))
{
response.Success = StringUnmarshaller.GetInstance().Unmarshall(context);
continue;
}
if (context.TestExpression("Messages", targetDepth))
{
var unmarshaller = new ListUnmarshaller<String,StringUnmarshaller>(
StringUnmarshaller.GetInstance());
response.Messages = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例5: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateMethodResponseResponse response = new UpdateMethodResponseResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("responseModels", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance);
response.ResponseModels = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("responseParameters", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, bool, StringUnmarshaller, BoolUnmarshaller>(StringUnmarshaller.Instance, BoolUnmarshaller.Instance);
response.ResponseParameters = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("statusCode", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.StatusCode = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例6: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateItemResponse response = new UpdateItemResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("Attributes", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.Instance, AttributeValueUnmarshaller.Instance);
response.Attributes = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ConsumedCapacity", targetDepth))
{
var unmarshaller = ConsumedCapacityUnmarshaller.Instance;
response.ConsumedCapacity = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ItemCollectionMetrics", targetDepth))
{
var unmarshaller = ItemCollectionMetricsUnmarshaller.Instance;
response.ItemCollectionMetrics = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例7: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
BatchWriteItemResponse response = new BatchWriteItemResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("ConsumedCapacity", targetDepth))
{
var unmarshaller = new ListUnmarshaller<ConsumedCapacity, ConsumedCapacityUnmarshaller>(ConsumedCapacityUnmarshaller.Instance);
response.ConsumedCapacity = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ItemCollectionMetrics", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, List<ItemCollectionMetrics>, StringUnmarshaller, ListUnmarshaller<ItemCollectionMetrics, ItemCollectionMetricsUnmarshaller>>(StringUnmarshaller.Instance, new ListUnmarshaller<ItemCollectionMetrics, ItemCollectionMetricsUnmarshaller>(ItemCollectionMetricsUnmarshaller.Instance));
response.ItemCollectionMetrics = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("UnprocessedItems", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, List<WriteRequest>, StringUnmarshaller, ListUnmarshaller<WriteRequest, WriteRequestUnmarshaller>>(StringUnmarshaller.Instance, new ListUnmarshaller<WriteRequest, WriteRequestUnmarshaller>(WriteRequestUnmarshaller.Instance));
response.UnprocessedItems = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例8: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UpdateBasePathMappingResponse response = new UpdateBasePathMappingResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("basePath", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.BasePath = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("restApiId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.RestApiId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("stage", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.Stage = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例9: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
DiscoverInputSchemaResponse response = new DiscoverInputSchemaResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("InputSchema", targetDepth))
{
var unmarshaller = SourceSchemaUnmarshaller.Instance;
response.InputSchema = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ParsedInputRecords", targetDepth))
{
var unmarshaller = new ListUnmarshaller<List<string>, ListUnmarshaller<string, StringUnmarshaller>>(new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance));
response.ParsedInputRecords = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("RawInputRecords", targetDepth))
{
var unmarshaller = new ListUnmarshaller<string, StringUnmarshaller>(StringUnmarshaller.Instance);
response.RawInputRecords = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例10: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
BatchGetItemResponse response = new BatchGetItemResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("ConsumedCapacity", targetDepth))
{
var unmarshaller = new ListUnmarshaller<ConsumedCapacity, ConsumedCapacityUnmarshaller>(ConsumedCapacityUnmarshaller.Instance);
response.ConsumedCapacity = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Responses", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, List<Dictionary<string, AttributeValue>>, StringUnmarshaller, ListUnmarshaller<Dictionary<string, AttributeValue>, DictionaryUnmarshaller<string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>>>(StringUnmarshaller.Instance, new ListUnmarshaller<Dictionary<string, AttributeValue>, DictionaryUnmarshaller<string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>>(new DictionaryUnmarshaller<string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.Instance, AttributeValueUnmarshaller.Instance)));
response.Responses = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("UnprocessedKeys", targetDepth))
{
var unmarshaller = new DictionaryUnmarshaller<string, KeysAndAttributes, StringUnmarshaller, KeysAndAttributesUnmarshaller>(StringUnmarshaller.Instance, KeysAndAttributesUnmarshaller.Instance);
response.UnprocessedKeys = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例11: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
SearchFacesByImageResponse response = new SearchFacesByImageResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("FaceMatches", targetDepth))
{
var unmarshaller = new ListUnmarshaller<FaceMatch, FaceMatchUnmarshaller>(FaceMatchUnmarshaller.Instance);
response.FaceMatches = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SearchedFaceBoundingBox", targetDepth))
{
var unmarshaller = BoundingBoxUnmarshaller.Instance;
response.SearchedFaceBoundingBox = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SearchedFaceConfidence", targetDepth))
{
var unmarshaller = FloatUnmarshaller.Instance;
response.SearchedFaceConfidence = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例12: Unmarshall
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListVolumesResponse response = new ListVolumesResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("GatewayARN", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.GatewayARN = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Marker", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.Marker = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("VolumeInfos", targetDepth))
{
var unmarshaller = new ListUnmarshaller<VolumeInfo, VolumeInfoUnmarshaller>(VolumeInfoUnmarshaller.Instance);
response.VolumeInfos = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例13: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
GetSampledRequestsResponse response = new GetSampledRequestsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("PopulationSize", targetDepth))
{
var unmarshaller = LongUnmarshaller.Instance;
response.PopulationSize = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("SampledRequests", targetDepth))
{
var unmarshaller = new ListUnmarshaller<SampledHTTPRequest, SampledHTTPRequestUnmarshaller>(SampledHTTPRequestUnmarshaller.Instance);
response.SampledRequests = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("TimeWindow", targetDepth))
{
var unmarshaller = TimeWindowUnmarshaller.Instance;
response.TimeWindow = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例14: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
PutAutoScalingPolicyResponse response = new PutAutoScalingPolicyResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("AutoScalingPolicy", targetDepth))
{
var unmarshaller = AutoScalingPolicyDescriptionUnmarshaller.Instance;
response.AutoScalingPolicy = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ClusterId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.ClusterId = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("InstanceGroupId", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.InstanceGroupId = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}
示例15: Unmarshall
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
ListGrantsResponse response = new ListGrantsResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.TestExpression("Grants", targetDepth))
{
var unmarshaller = new ListUnmarshaller<GrantListEntry, GrantListEntryUnmarshaller>(GrantListEntryUnmarshaller.Instance);
response.Grants = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("NextMarker", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
response.NextMarker = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("Truncated", targetDepth))
{
var unmarshaller = BoolUnmarshaller.Instance;
response.Truncated = unmarshaller.Unmarshall(context);
continue;
}
}
return response;
}