Constants used for properties of type TlsPolicy.
상속: ConstantClass
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SimpleEmail.Model.PutConfigurationSetDeliveryOptionsRequest();

            if (cmdletContext.ConfigurationSetName != null)
            {
                request.ConfigurationSetName = cmdletContext.ConfigurationSetName;
            }

            // populate DeliveryOptions
            var requestDeliveryOptionsIsNull = true;

            request.DeliveryOptions = new Amazon.SimpleEmail.Model.DeliveryOptions();
            Amazon.SimpleEmail.TlsPolicy requestDeliveryOptions_deliveryOptions_TlsPolicy = null;
            if (cmdletContext.DeliveryOptions_TlsPolicy != null)
            {
                requestDeliveryOptions_deliveryOptions_TlsPolicy = cmdletContext.DeliveryOptions_TlsPolicy;
            }
            if (requestDeliveryOptions_deliveryOptions_TlsPolicy != null)
            {
                request.DeliveryOptions.TlsPolicy = requestDeliveryOptions_deliveryOptions_TlsPolicy;
                requestDeliveryOptionsIsNull      = false;
            }
            // determine if request.DeliveryOptions should be set to null
            if (requestDeliveryOptionsIsNull)
            {
                request.DeliveryOptions = null;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
예제 #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SimpleEmail.Model.UpdateReceiptRuleRequest();


            // populate Rule
            var requestRuleIsNull = true;

            request.Rule = new Amazon.SimpleEmail.Model.ReceiptRule();
            List <Amazon.SimpleEmail.Model.ReceiptAction> requestRule_rule_Action = null;

            if (cmdletContext.Rule_Action != null)
            {
                requestRule_rule_Action = cmdletContext.Rule_Action;
            }
            if (requestRule_rule_Action != null)
            {
                request.Rule.Actions = requestRule_rule_Action;
                requestRuleIsNull    = false;
            }
            System.Boolean?requestRule_rule_Enabled = null;
            if (cmdletContext.Rule_Enabled != null)
            {
                requestRule_rule_Enabled = cmdletContext.Rule_Enabled.Value;
            }
            if (requestRule_rule_Enabled != null)
            {
                request.Rule.Enabled = requestRule_rule_Enabled.Value;
                requestRuleIsNull    = false;
            }
            System.String requestRule_rule_Name = null;
            if (cmdletContext.Rule_Name != null)
            {
                requestRule_rule_Name = cmdletContext.Rule_Name;
            }
            if (requestRule_rule_Name != null)
            {
                request.Rule.Name = requestRule_rule_Name;
                requestRuleIsNull = false;
            }
            List <System.String> requestRule_rule_Recipient = null;

            if (cmdletContext.Rule_Recipient != null)
            {
                requestRule_rule_Recipient = cmdletContext.Rule_Recipient;
            }
            if (requestRule_rule_Recipient != null)
            {
                request.Rule.Recipients = requestRule_rule_Recipient;
                requestRuleIsNull       = false;
            }
            System.Boolean?requestRule_rule_ScanEnabled = null;
            if (cmdletContext.Rule_ScanEnabled != null)
            {
                requestRule_rule_ScanEnabled = cmdletContext.Rule_ScanEnabled.Value;
            }
            if (requestRule_rule_ScanEnabled != null)
            {
                request.Rule.ScanEnabled = requestRule_rule_ScanEnabled.Value;
                requestRuleIsNull        = false;
            }
            Amazon.SimpleEmail.TlsPolicy requestRule_rule_TlsPolicy = null;
            if (cmdletContext.Rule_TlsPolicy != null)
            {
                requestRule_rule_TlsPolicy = cmdletContext.Rule_TlsPolicy;
            }
            if (requestRule_rule_TlsPolicy != null)
            {
                request.Rule.TlsPolicy = requestRule_rule_TlsPolicy;
                requestRuleIsNull      = false;
            }
            // determine if request.Rule should be set to null
            if (requestRuleIsNull)
            {
                request.Rule = null;
            }
            if (cmdletContext.RuleSetName != null)
            {
                request.RuleSetName = cmdletContext.RuleSetName;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }