예제 #1
0
        protected override void DoDeleteObject()
        {
            //Check if associated
            if (Associated)
            {
                throw new Exception("Cannot delete IP when associated. Disassociate first.");
            }

            foreach (ZAwsHostedZone zone in myController.CurrentHostedZones)
            {
                foreach (var r in zone.currentRecordSet)
                {
                    foreach (var t in r.ResourceRecords)
                    {
                        if (t.Value.Contains(this.Name))
                        {
                            throw new Exception("This IP features in a record of the hosted zone " + zone.Name + ". Remove that record first. ");
                        }
                    }
                }
            }


            Amazon.EC2.Model.ReleaseAddressResponse resp = myController.ec2.ReleaseAddress(new Amazon.EC2.Model.ReleaseAddressRequest()
                                                                                           .WithPublicIp(this.ResponseData.PublicIp));
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) 
        {
            ReleaseAddressResponse response = new ReleaseAddressResponse();
            
            while (context.Read())
            {
                
            }
                

            return response;
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>  
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            ReleaseAddressResponse response = new ReleaseAddressResponse();

            int originalDepth = context.CurrentDepth;
            int targetDepth = originalDepth + 1;
            if (context.IsStartOfDocument) 
               targetDepth = 2;

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {

                } 
            }

            return response;
        }