/// <summary>
        /// <para> Creates a new database security group. Database Security groups control access to a database instance. </para>
        /// </summary>
        ///
        /// <param name="createDBSecurityGroupRequest">Container for the necessary parameters to execute the CreateDBSecurityGroup service method on
        ///           AmazonRDS.</param>
        ///
        /// <returns>The response from the CreateDBSecurityGroup service method, as returned by AmazonRDS.</returns>
        ///
        /// <exception cref="DBSecurityGroupQuotaExceededException"/>
        /// <exception cref="DBSecurityGroupAlreadyExistsException"/>
        public CreateDBSecurityGroupResponse CreateDBSecurityGroup(CreateDBSecurityGroupRequest createDBSecurityGroupRequest)
        {
            IRequest <CreateDBSecurityGroupRequest> request  = new CreateDBSecurityGroupRequestMarshaller().Marshall(createDBSecurityGroupRequest);
            CreateDBSecurityGroupResponse           response = Invoke <CreateDBSecurityGroupRequest, CreateDBSecurityGroupResponse> (request, this.signer, CreateDBSecurityGroupResponseUnmarshaller.GetInstance());

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

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

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

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

            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateDBSecurityGroupResponse 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("DBSecurityGroup", targetDepth))
                    {
                        response.DBSecurityGroup = DBSecurityGroupUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }
        }
예제 #4
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateDBSecurityGroupResponse response = new CreateDBSecurityGroupResponse();

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

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


            return(response);
        }