private static void UnmarshallResult(XmlUnmarshallerContext context, ListIdentitiesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Identities/member", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; var item = unmarshaller.Unmarshall(context); response.Identities.Add(item); continue; } if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } } return; }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListIdentitiesResponse response = new ListIdentitiesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Identities", targetDepth)) { var unmarshaller = new ListUnmarshaller <IdentityDescription, IdentityDescriptionUnmarshaller>(IdentityDescriptionUnmarshaller.Instance); response.Identities = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("IdentityPoolId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IdentityPoolId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } } return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListIdentitiesResponse response = new ListIdentitiesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("ListIdentitiesResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListIdentitiesResponse listIdentitiesResponse = new ListIdentitiesResponse(); context.Read(); int currentDepth = context.CurrentDepth; while (context.ReadAtDepth(currentDepth)) { if (context.TestExpression("Identities", currentDepth)) { ListUnmarshaller <IdentityDescription, IdentityDescriptionUnmarshaller> listUnmarshaller = new ListUnmarshaller <IdentityDescription, IdentityDescriptionUnmarshaller>(IdentityDescriptionUnmarshaller.Instance); listIdentitiesResponse.Identities = listUnmarshaller.Unmarshall(context); } else if (context.TestExpression("IdentityPoolId", currentDepth)) { StringUnmarshaller instance = StringUnmarshaller.Instance; listIdentitiesResponse.IdentityPoolId = instance.Unmarshall(context); } else if (context.TestExpression("NextToken", currentDepth)) { StringUnmarshaller instance2 = StringUnmarshaller.Instance; listIdentitiesResponse.NextToken = instance2.Unmarshall(context); } } return(listIdentitiesResponse); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonSimpleEmailServiceConfig config = new AmazonSimpleEmailServiceConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonSimpleEmailServiceClient client = new AmazonSimpleEmailServiceClient(creds, config); ListIdentitiesResponse resp = new ListIdentitiesResponse(); do { ListIdentitiesRequest req = new ListIdentitiesRequest { NextToken = resp.NextToken , MaxItems = maxItems }; resp = client.ListIdentities(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Identities) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { ListIdentitiesResponse response = new ListIdentitiesResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ListIdentitiesResult", 2)) { response.ListIdentitiesResult = ListIdentitiesResultUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, ListIdentitiesResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Identities/member", targetDepth)) { response.Identities.Add(StringUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("NextToken", targetDepth)) { response.NextToken = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
/// <summary> /// Get the service identities, one page at a time. /// </summary> /// <returns> ListIdentitiesResponse object</returns> /// <param name="request"> ListIdentitiesRequest object</param> /// <param name='jsonRpcCallId'> /// The json rpc call identifier. This is a string generated by the client, which can be used to correlate the response to the request. Max length is 256 characters. A JSON-RPC id must be generated on a per call invocation basis. The Rogerthat platform uses the id of the call to store the call result for a certain amount of time so that if something fails during the communication, the same call (having the same JSON-RPC id) can be resent to the Rogerthat service, allowing to fetch the result, without actually executing the call again. This avoids annoying problems such as duplicate delivery of messages. /// /// You should use a different JSON-RPC id for every call you make. /// /// In case of an intermittent failure such as a network connectivity problem, you can retry the same call using the same JSON-RPC id, without running the risk of duplicate execution of your call (e.g. duplicate message delivery). /// </param> public ListIdentitiesResponse ListIdentities(ListIdentitiesRequest request, string jsonRpcCallId) { ListIdentitiesResponse result = new ListIdentitiesResponse(); WireRequest(0, jsonRpcCallId, "system.list_identities", (writer) => { request.Write(writer, false); }, (reader) => { result.Read(reader); } ); return result; }