private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteHostedZoneResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 1; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("ChangeInfo", targetDepth)) { var unmarshaller = ChangeInfoUnmarshaller.Instance; response.ChangeInfo = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return; } } return; }
/// <summary> /// Delete a hosted zone. /// </summary> /// <param name="hostedZoneId">The ID of the hosted zone that contains the resource record sets that you want to delete</param> /// <param name="settings">The <see cref="Route53Settings"/> required to connect to Route53.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> public async Task <bool> DeleteHostedZone(string hostedZoneId, Route53Settings settings, CancellationToken cancellationToken = default(CancellationToken)) { if (String.IsNullOrEmpty(hostedZoneId)) { throw new ArgumentNullException("hostedZoneId"); } DeleteHostedZoneRequest request = new DeleteHostedZoneRequest(hostedZoneId); AmazonRoute53Client client = this.GetClient(settings); DeleteHostedZoneResponse response = await client.DeleteHostedZoneAsync(request); if (response.HttpStatusCode == HttpStatusCode.OK) { await this.WaitForChange(client, response.ChangeInfo.Id, 10000, 60); _Log.Verbose("deleted hosted zone"); return(true); } else { _Log.Error("Could not delete hosted zone"); return(false); } }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteHostedZoneResponse response = new DeleteHostedZoneResponse(); UnmarshallResult(context, response); return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteHostedZoneResponse response = new DeleteHostedZoneResponse(); while (context.Read()) { if (context.IsStartElement) { response.DeleteHostedZoneResult = DeleteHostedZoneResultUnmarshaller.GetInstance().Unmarshall(context); break; } } return(response); }
protected override void DoDeleteObject() { DeleteHostedZoneResponse resp = myController.route53.DeleteHostedZone( new DeleteHostedZoneRequest() .WithId(this.ResponseData.Id)); }