private Amazon.FraudDetector.Model.UpdateRuleMetadataResponse CallAWSServiceOperation(IAmazonFraudDetector client, Amazon.FraudDetector.Model.UpdateRuleMetadataRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Fraud Detector", "UpdateRuleMetadata"); try { #if DESKTOP return(client.UpdateRuleMetadata(request)); #elif CORECLR return(client.UpdateRuleMetadataAsync(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.FraudDetector.Model.UpdateRuleMetadataRequest(); if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } // populate Rule var requestRuleIsNull = true; request.Rule = new Amazon.FraudDetector.Model.Rule(); System.String requestRule_rule_DetectorId = null; if (cmdletContext.Rule_DetectorId != null) { requestRule_rule_DetectorId = cmdletContext.Rule_DetectorId; } if (requestRule_rule_DetectorId != null) { request.Rule.DetectorId = requestRule_rule_DetectorId; requestRuleIsNull = false; } System.String requestRule_rule_RuleId = null; if (cmdletContext.Rule_RuleId != null) { requestRule_rule_RuleId = cmdletContext.Rule_RuleId; } if (requestRule_rule_RuleId != null) { request.Rule.RuleId = requestRule_rule_RuleId; requestRuleIsNull = false; } System.String requestRule_rule_RuleVersion = null; if (cmdletContext.Rule_RuleVersion != null) { requestRule_rule_RuleVersion = cmdletContext.Rule_RuleVersion; } if (requestRule_rule_RuleVersion != null) { request.Rule.RuleVersion = requestRule_rule_RuleVersion; requestRuleIsNull = false; } // determine if request.Rule should be set to null if (requestRuleIsNull) { request.Rule = 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); }