Пример #1
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            AuthorizeDBSecurityGroupIngressResponse response = new AuthorizeDBSecurityGroupIngressResponse();

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

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

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

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

            return;
        }
        /// <summary>
        /// <para> Enables ingress to a DBSecurityGroup using one of two forms of authorization. First, EC2 Security Groups can be added to the
        /// DBSecurityGroup if the application using the database is running on EC2 instances. Second, IP ranges are available if the application
        /// accessing your database is running on the Internet. Required parameters for this API are one of CIDR range or (EC2SecurityGroupName AND
        /// EC2SecurityGroupOwnerId). </para> <para><b>NOTE:</b> You cannot authorize ingress from an EC2 security group in one Region to an Amazon RDS
        /// DB Instance in another. </para> <para>For an overview of CIDR ranges, go to the Wikipedia Tutorial. </para>
        /// </summary>
        ///
        /// <param name="authorizeDBSecurityGroupIngressRequest">Container for the necessary parameters to execute the AuthorizeDBSecurityGroupIngress
        ///           service method on AmazonRDS.</param>
        ///
        /// <returns>The response from the AuthorizeDBSecurityGroupIngress service method, as returned by AmazonRDS.</returns>
        ///
        /// <exception cref="DBSecurityGroupNotFoundException"/>
        /// <exception cref="InvalidDBSecurityGroupStateException"/>
        /// <exception cref="AuthorizationAlreadyExistsException"/>
        /// <exception cref="AuthorizationQuotaExceededException"/>
        public AuthorizeDBSecurityGroupIngressResponse AuthorizeDBSecurityGroupIngress(AuthorizeDBSecurityGroupIngressRequest authorizeDBSecurityGroupIngressRequest)
        {
            IRequest <AuthorizeDBSecurityGroupIngressRequest> request  = new AuthorizeDBSecurityGroupIngressRequestMarshaller().Marshall(authorizeDBSecurityGroupIngressRequest);
            AuthorizeDBSecurityGroupIngressResponse           response = Invoke <AuthorizeDBSecurityGroupIngressRequest, AuthorizeDBSecurityGroupIngressResponse> (request, this.signer, AuthorizeDBSecurityGroupIngressResponseUnmarshaller.GetInstance());

            return(response);
        }
Пример #4
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            AuthorizeDBSecurityGroupIngressResponse response = new AuthorizeDBSecurityGroupIngressResponse();

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

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


            return(response);
        }