/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DeleteAttachmentResponse response = new DeleteAttachmentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Attachment", targetDepth)) { var unmarshaller = AttachmentUnmarshaller.Instance; response.Attachment = unmarshaller.Unmarshall(context); continue; } } return(response); }
// Token: 0x0600012E RID: 302 RVA: 0x0000514C File Offset: 0x0000334C public static bool DeleteAttachment(AttachmentIdType attachmentId) { bool result = false; if (attachmentId != null) { DeleteAttachmentJsonRequest deleteAttachmentJsonRequest = new DeleteAttachmentJsonRequest(); DeleteAttachmentRequest deleteAttachmentRequest = new DeleteAttachmentRequest(); deleteAttachmentRequest.AttachmentIds = new AttachmentIdType[1]; deleteAttachmentRequest.AttachmentIds[0] = attachmentId; deleteAttachmentJsonRequest.Body = deleteAttachmentRequest; OWAService owaservice = new OWAService(); IAsyncResult asyncResult = owaservice.BeginDeleteAttachment(deleteAttachmentJsonRequest, null, null); asyncResult.AsyncWaitHandle.WaitOne(); DeleteAttachmentResponse body = owaservice.EndDeleteAttachment(asyncResult).Body; if (body != null && body.ResponseMessages != null && body.ResponseMessages.Items != null && body.ResponseMessages.Items[0] != null) { result = (body.ResponseMessages.Items[0].ResponseCode == ResponseCodeType.NoError); } } return(result); }