private static void UnmarshallResult(XmlUnmarshallerContext context, CreateDBInstanceResponse 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("DBInstance", targetDepth))
                    {
                        var unmarshaller = DBInstanceUnmarshaller.Instance;
                        response.DBInstance = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return;
        }
        /// <summary>
        /// <para> Creates a new DB instance. </para>
        /// </summary>
        ///
        /// <param name="createDBInstanceRequest">Container for the necessary parameters to execute the CreateDBInstance service method on
        ///           AmazonRDS.</param>
        ///
        /// <returns>The response from the CreateDBInstance service method, as returned by AmazonRDS.</returns>
        ///
        /// <exception cref="DBParameterGroupNotFoundException"/>
        /// <exception cref="InstanceQuotaExceededException"/>
        /// <exception cref="DBInstanceAlreadyExistsException"/>
        /// <exception cref="StorageQuotaExceededException"/>
        /// <exception cref="DBSecurityGroupNotFoundException"/>
        /// <exception cref="InsufficientDBInstanceCapacityException"/>
        public CreateDBInstanceResponse CreateDBInstance(CreateDBInstanceRequest createDBInstanceRequest)
        {
            IRequest <CreateDBInstanceRequest> request  = new CreateDBInstanceRequestMarshaller().Marshall(createDBInstanceRequest);
            CreateDBInstanceResponse           response = Invoke <CreateDBInstanceRequest, CreateDBInstanceResponse> (request, this.signer, CreateDBInstanceResponseUnmarshaller.GetInstance());

            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)
        {
            CreateDBInstanceResponse response = new CreateDBInstanceResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateDBInstanceResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
示例#4
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateDBInstanceResponse 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("DBInstance", targetDepth))
                    {
                        response.DBInstance = DBInstanceUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }
        }
        public DBInstance CreateDatabase(CreateDBInstanceRequest request)
        {
            CreateDBInstanceResponse response = Client.CreateDBInstance(request);

            if (response.CreateDBInstanceResult != null)
            {
                return(response.CreateDBInstanceResult.DBInstance);
            }
            throw new Exception("Failed to get CreateDBInstanceResult response");
        }
        public static CreateDBInstanceResponse Unmarshall(UnmarshallerContext context)
        {
            CreateDBInstanceResponse createDBInstanceResponse = new CreateDBInstanceResponse();

            createDBInstanceResponse.HttpResponse = context.HttpResponse;
            createDBInstanceResponse.RequestId    = context.StringValue("CreateDBInstance.RequestId");
            createDBInstanceResponse.OrderId      = context.StringValue("CreateDBInstance.OrderId");
            createDBInstanceResponse.DBInstanceId = context.StringValue("CreateDBInstance.DBInstanceId");

            return(createDBInstanceResponse);
        }
示例#7
0
        public static CreateDBInstanceResponse Unmarshall(UnmarshallerContext _ctx)
        {
            CreateDBInstanceResponse createDBInstanceResponse = new CreateDBInstanceResponse();

            createDBInstanceResponse.HttpResponse     = _ctx.HttpResponse;
            createDBInstanceResponse.RequestId        = _ctx.StringValue("CreateDBInstance.RequestId");
            createDBInstanceResponse.DBInstanceId     = _ctx.StringValue("CreateDBInstance.DBInstanceId");
            createDBInstanceResponse.OrderId          = _ctx.StringValue("CreateDBInstance.OrderId");
            createDBInstanceResponse.ConnectionString = _ctx.StringValue("CreateDBInstance.ConnectionString");
            createDBInstanceResponse.Port             = _ctx.StringValue("CreateDBInstance.Port");

            return(createDBInstanceResponse);
        }
        public static CreateDBInstanceResponse Unmarshall(UnmarshallerContext context)
        {
            CreateDBInstanceResponse createDBInstanceResponse = new CreateDBInstanceResponse()
            {
                HttpResponse     = context.HttpResponse,
                RequestId        = context.StringValue("CreateDBInstance.RequestId"),
                DBInstanceId     = context.StringValue("CreateDBInstance.DBInstanceId"),
                OrderId          = context.StringValue("CreateDBInstance.OrderId"),
                ConnectionString = context.StringValue("CreateDBInstance.ConnectionString"),
                Port             = context.StringValue("CreateDBInstance.Port")
            };

            return(createDBInstanceResponse);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateDBInstanceResponse response = new CreateDBInstanceResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateDBInstanceResult", 2))
                    {
                        response.CreateDBInstanceResult = CreateDBInstanceResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }