/// <summary>
        /// Initiates the asynchronous execution of the CreateReceiptFilter operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateReceiptFilter operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<CreateReceiptFilterResponse> CreateReceiptFilterAsync(CreateReceiptFilterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateReceiptFilterRequestMarshaller();
            var unmarshaller = CreateReceiptFilterResponseUnmarshaller.Instance;

            return InvokeAsync<CreateReceiptFilterRequest,CreateReceiptFilterResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        /// <summary>
        /// Creates a new IP address filter.
        /// 
        ///  
        /// <para>
        /// For information about setting up IP address filters, see the <a href="http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-ip-filters.html">Amazon
        /// SES Developer Guide</a>.
        /// </para>
        ///  
        /// <para>
        /// This action is throttled at one request per second.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateReceiptFilter service method.</param>
        /// 
        /// <returns>The response from the CreateReceiptFilter service method, as returned by SimpleEmailService.</returns>
        /// <exception cref="Amazon.SimpleEmail.Model.AlreadyExistsException">
        /// Indicates that a resource could not be created because of a naming conflict.
        /// </exception>
        /// <exception cref="Amazon.SimpleEmail.Model.LimitExceededException">
        /// Indicates that a resource could not be created because of service limits. For a list
        /// of Amazon SES limits, see the <a href="http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html">Amazon
        /// SES Developer Guide</a>.
        /// </exception>
        public CreateReceiptFilterResponse CreateReceiptFilter(CreateReceiptFilterRequest request)
        {
            var marshaller = new CreateReceiptFilterRequestMarshaller();
            var unmarshaller = CreateReceiptFilterResponseUnmarshaller.Instance;

            return Invoke<CreateReceiptFilterRequest,CreateReceiptFilterResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateReceiptFilter operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateReceiptFilter operation on AmazonSimpleEmailServiceClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateReceiptFilter
        ///         operation.</returns>
        public IAsyncResult BeginCreateReceiptFilter(CreateReceiptFilterRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateReceiptFilterRequestMarshaller();
            var unmarshaller = CreateReceiptFilterResponseUnmarshaller.Instance;

            return BeginInvoke<CreateReceiptFilterRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 private Amazon.SimpleEmail.Model.CreateReceiptFilterResponse CallAWSServiceOperation(IAmazonSimpleEmailService client, Amazon.SimpleEmail.Model.CreateReceiptFilterRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Email Service (SES)", "CreateReceiptFilter");
     try
     {
         #if DESKTOP
         return(client.CreateReceiptFilter(request));
         #elif CORECLR
         return(client.CreateReceiptFilterAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.SimpleEmail.Model.CreateReceiptFilterRequest();


            // populate Filter
            var requestFilterIsNull = true;

            request.Filter = new Amazon.SimpleEmail.Model.ReceiptFilter();
            System.String requestFilter_filter_Name = null;
            if (cmdletContext.Filter_Name != null)
            {
                requestFilter_filter_Name = cmdletContext.Filter_Name;
            }
            if (requestFilter_filter_Name != null)
            {
                request.Filter.Name = requestFilter_filter_Name;
                requestFilterIsNull = false;
            }
            Amazon.SimpleEmail.Model.ReceiptIpFilter requestFilter_filter_IpFilter = null;

            // populate IpFilter
            var requestFilter_filter_IpFilterIsNull = true;

            requestFilter_filter_IpFilter = new Amazon.SimpleEmail.Model.ReceiptIpFilter();
            System.String requestFilter_filter_IpFilter_ipFilter_Cidr = null;
            if (cmdletContext.IpFilter_Cidr != null)
            {
                requestFilter_filter_IpFilter_ipFilter_Cidr = cmdletContext.IpFilter_Cidr;
            }
            if (requestFilter_filter_IpFilter_ipFilter_Cidr != null)
            {
                requestFilter_filter_IpFilter.Cidr  = requestFilter_filter_IpFilter_ipFilter_Cidr;
                requestFilter_filter_IpFilterIsNull = false;
            }
            Amazon.SimpleEmail.ReceiptFilterPolicy requestFilter_filter_IpFilter_ipFilter_Policy = null;
            if (cmdletContext.IpFilter_Policy != null)
            {
                requestFilter_filter_IpFilter_ipFilter_Policy = cmdletContext.IpFilter_Policy;
            }
            if (requestFilter_filter_IpFilter_ipFilter_Policy != null)
            {
                requestFilter_filter_IpFilter.Policy = requestFilter_filter_IpFilter_ipFilter_Policy;
                requestFilter_filter_IpFilterIsNull  = false;
            }
            // determine if requestFilter_filter_IpFilter should be set to null
            if (requestFilter_filter_IpFilterIsNull)
            {
                requestFilter_filter_IpFilter = null;
            }
            if (requestFilter_filter_IpFilter != null)
            {
                request.Filter.IpFilter = requestFilter_filter_IpFilter;
                requestFilterIsNull     = false;
            }
            // determine if request.Filter should be set to null
            if (requestFilterIsNull)
            {
                request.Filter = 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);
        }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateReceiptFilter operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the CreateReceiptFilter operation on AmazonSimpleEmailServiceClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 public void CreateReceiptFilterAsync(CreateReceiptFilterRequest request, AmazonServiceCallback<CreateReceiptFilterRequest, CreateReceiptFilterResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new CreateReceiptFilterRequestMarshaller();
     var unmarshaller = CreateReceiptFilterResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<CreateReceiptFilterRequest,CreateReceiptFilterResponse> responseObject 
                     = new AmazonServiceResult<CreateReceiptFilterRequest,CreateReceiptFilterResponse>((CreateReceiptFilterRequest)req, (CreateReceiptFilterResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<CreateReceiptFilterRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }