Exemplo n.º 1
0
        public IRequest Marshall(ReplaceNetworkAclEntryRequest replaceNetworkAclEntryRequest)
        {
            IRequest request = new DefaultRequest(replaceNetworkAclEntryRequest, "AmazonEC2");

            request.Parameters.Add("Action", "ReplaceNetworkAclEntry");
            request.Parameters.Add("Version", "2014-02-01");
            if (replaceNetworkAclEntryRequest != null && replaceNetworkAclEntryRequest.IsSetNetworkAclId())
            {
                request.Parameters.Add("NetworkAclId", StringUtils.FromString(replaceNetworkAclEntryRequest.NetworkAclId));
            }
            if (replaceNetworkAclEntryRequest != null && replaceNetworkAclEntryRequest.IsSetRuleNumber())
            {
                request.Parameters.Add("RuleNumber", StringUtils.FromInt(replaceNetworkAclEntryRequest.RuleNumber));
            }
            if (replaceNetworkAclEntryRequest != null && replaceNetworkAclEntryRequest.IsSetProtocol())
            {
                request.Parameters.Add("Protocol", StringUtils.FromString(replaceNetworkAclEntryRequest.Protocol));
            }
            if (replaceNetworkAclEntryRequest != null && replaceNetworkAclEntryRequest.IsSetRuleAction())
            {
                request.Parameters.Add("RuleAction", StringUtils.FromString(replaceNetworkAclEntryRequest.RuleAction));
            }
            if (replaceNetworkAclEntryRequest != null && replaceNetworkAclEntryRequest.IsSetEgress())
            {
                request.Parameters.Add("Egress", StringUtils.FromBool(replaceNetworkAclEntryRequest.Egress));
            }
            if (replaceNetworkAclEntryRequest != null && replaceNetworkAclEntryRequest.IsSetCidrBlock())
            {
                request.Parameters.Add("CidrBlock", StringUtils.FromString(replaceNetworkAclEntryRequest.CidrBlock));
            }
            if (replaceNetworkAclEntryRequest != null)
            {
                IcmpTypeCode icmpTypeCode = replaceNetworkAclEntryRequest.IcmpTypeCode;
                if (icmpTypeCode != null && icmpTypeCode.IsSetType())
                {
                    request.Parameters.Add("Icmp.Type", StringUtils.FromInt(icmpTypeCode.Type));
                }
                if (icmpTypeCode != null && icmpTypeCode.IsSetCode())
                {
                    request.Parameters.Add("Icmp.Code", StringUtils.FromInt(icmpTypeCode.Code));
                }
            }
            if (replaceNetworkAclEntryRequest != null)
            {
                PortRange portRange = replaceNetworkAclEntryRequest.PortRange;
                if (portRange != null && portRange.IsSetFrom())
                {
                    request.Parameters.Add("PortRange.From", StringUtils.FromInt(portRange.From));
                }
                if (portRange != null && portRange.IsSetTo())
                {
                    request.Parameters.Add("PortRange.To", StringUtils.FromInt(portRange.To));
                }
            }

            return(request);
        }