Beispiel #1
0
 private Amazon.Pinpoint.Model.UpdateRecommenderConfigurationResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.UpdateRecommenderConfigurationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "UpdateRecommenderConfiguration");
     try
     {
         #if DESKTOP
         return(client.UpdateRecommenderConfiguration(request));
         #elif CORECLR
         return(client.UpdateRecommenderConfigurationAsync(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;
     }
 }
Beispiel #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Pinpoint.Model.UpdateRecommenderConfigurationRequest();

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

            // populate UpdateRecommenderConfiguration
            var requestUpdateRecommenderConfigurationIsNull = true;

            request.UpdateRecommenderConfiguration = new Amazon.Pinpoint.Model.UpdateRecommenderConfiguration();
            Dictionary <System.String, System.String> requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Attribute = null;

            if (cmdletContext.UpdateRecommenderConfiguration_Attribute != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Attribute = cmdletContext.UpdateRecommenderConfiguration_Attribute;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Attribute != null)
            {
                request.UpdateRecommenderConfiguration.Attributes = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Attribute;
                requestUpdateRecommenderConfigurationIsNull       = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Description = null;
            if (cmdletContext.UpdateRecommenderConfiguration_Description != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Description = cmdletContext.UpdateRecommenderConfiguration_Description;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Description != null)
            {
                request.UpdateRecommenderConfiguration.Description = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Description;
                requestUpdateRecommenderConfigurationIsNull        = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Name = null;
            if (cmdletContext.UpdateRecommenderConfiguration_Name != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Name = cmdletContext.UpdateRecommenderConfiguration_Name;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Name != null)
            {
                request.UpdateRecommenderConfiguration.Name = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_Name;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderIdType = null;
            if (cmdletContext.UpdateRecommenderConfiguration_RecommendationProviderIdType != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderIdType = cmdletContext.UpdateRecommenderConfiguration_RecommendationProviderIdType;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderIdType != null)
            {
                request.UpdateRecommenderConfiguration.RecommendationProviderIdType = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderIdType;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderRoleArn = null;
            if (cmdletContext.UpdateRecommenderConfiguration_RecommendationProviderRoleArn != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderRoleArn = cmdletContext.UpdateRecommenderConfiguration_RecommendationProviderRoleArn;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderRoleArn != null)
            {
                request.UpdateRecommenderConfiguration.RecommendationProviderRoleArn = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderRoleArn;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderUri = null;
            if (cmdletContext.UpdateRecommenderConfiguration_RecommendationProviderUri != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderUri = cmdletContext.UpdateRecommenderConfiguration_RecommendationProviderUri;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderUri != null)
            {
                request.UpdateRecommenderConfiguration.RecommendationProviderUri = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationProviderUri;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsDisplayName = null;
            if (cmdletContext.UpdateRecommenderConfiguration_RecommendationsDisplayName != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsDisplayName = cmdletContext.UpdateRecommenderConfiguration_RecommendationsDisplayName;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsDisplayName != null)
            {
                request.UpdateRecommenderConfiguration.RecommendationsDisplayName = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsDisplayName;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            System.Int32?requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsPerMessage = null;
            if (cmdletContext.UpdateRecommenderConfiguration_RecommendationsPerMessage != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsPerMessage = cmdletContext.UpdateRecommenderConfiguration_RecommendationsPerMessage.Value;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsPerMessage != null)
            {
                request.UpdateRecommenderConfiguration.RecommendationsPerMessage = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationsPerMessage.Value;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            System.String requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationTransformerUri = null;
            if (cmdletContext.UpdateRecommenderConfiguration_RecommendationTransformerUri != null)
            {
                requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationTransformerUri = cmdletContext.UpdateRecommenderConfiguration_RecommendationTransformerUri;
            }
            if (requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationTransformerUri != null)
            {
                request.UpdateRecommenderConfiguration.RecommendationTransformerUri = requestUpdateRecommenderConfiguration_updateRecommenderConfiguration_RecommendationTransformerUri;
                requestUpdateRecommenderConfigurationIsNull = false;
            }
            // determine if request.UpdateRecommenderConfiguration should be set to null
            if (requestUpdateRecommenderConfigurationIsNull)
            {
                request.UpdateRecommenderConfiguration = 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);
        }