private Amazon.XRay.Model.UpdateSamplingRuleResponse CallAWSServiceOperation(IAmazonXRay client, Amazon.XRay.Model.UpdateSamplingRuleRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS X-Ray", "UpdateSamplingRule"); try { #if DESKTOP return(client.UpdateSamplingRule(request)); #elif CORECLR return(client.UpdateSamplingRuleAsync(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.XRay.Model.UpdateSamplingRuleRequest(); // populate SamplingRuleUpdate var requestSamplingRuleUpdateIsNull = true; request.SamplingRuleUpdate = new Amazon.XRay.Model.SamplingRuleUpdate(); Dictionary <System.String, System.String> requestSamplingRuleUpdate_samplingRuleUpdate_Attribute = null; if (cmdletContext.SamplingRuleUpdate_Attribute != null) { requestSamplingRuleUpdate_samplingRuleUpdate_Attribute = cmdletContext.SamplingRuleUpdate_Attribute; } if (requestSamplingRuleUpdate_samplingRuleUpdate_Attribute != null) { request.SamplingRuleUpdate.Attributes = requestSamplingRuleUpdate_samplingRuleUpdate_Attribute; requestSamplingRuleUpdateIsNull = false; } System.Double?requestSamplingRuleUpdate_samplingRuleUpdate_FixedRate = null; if (cmdletContext.SamplingRuleUpdate_FixedRate != null) { requestSamplingRuleUpdate_samplingRuleUpdate_FixedRate = cmdletContext.SamplingRuleUpdate_FixedRate.Value; } if (requestSamplingRuleUpdate_samplingRuleUpdate_FixedRate != null) { request.SamplingRuleUpdate.FixedRate = requestSamplingRuleUpdate_samplingRuleUpdate_FixedRate.Value; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_Host = null; if (cmdletContext.SamplingRuleUpdate_Host != null) { requestSamplingRuleUpdate_samplingRuleUpdate_Host = cmdletContext.SamplingRuleUpdate_Host; } if (requestSamplingRuleUpdate_samplingRuleUpdate_Host != null) { request.SamplingRuleUpdate.Host = requestSamplingRuleUpdate_samplingRuleUpdate_Host; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_HTTPMethod = null; if (cmdletContext.SamplingRuleUpdate_HTTPMethod != null) { requestSamplingRuleUpdate_samplingRuleUpdate_HTTPMethod = cmdletContext.SamplingRuleUpdate_HTTPMethod; } if (requestSamplingRuleUpdate_samplingRuleUpdate_HTTPMethod != null) { request.SamplingRuleUpdate.HTTPMethod = requestSamplingRuleUpdate_samplingRuleUpdate_HTTPMethod; requestSamplingRuleUpdateIsNull = false; } System.Int32?requestSamplingRuleUpdate_samplingRuleUpdate_Priority = null; if (cmdletContext.SamplingRuleUpdate_Priority != null) { requestSamplingRuleUpdate_samplingRuleUpdate_Priority = cmdletContext.SamplingRuleUpdate_Priority.Value; } if (requestSamplingRuleUpdate_samplingRuleUpdate_Priority != null) { request.SamplingRuleUpdate.Priority = requestSamplingRuleUpdate_samplingRuleUpdate_Priority.Value; requestSamplingRuleUpdateIsNull = false; } System.Int32?requestSamplingRuleUpdate_samplingRuleUpdate_ReservoirSize = null; if (cmdletContext.SamplingRuleUpdate_ReservoirSize != null) { requestSamplingRuleUpdate_samplingRuleUpdate_ReservoirSize = cmdletContext.SamplingRuleUpdate_ReservoirSize.Value; } if (requestSamplingRuleUpdate_samplingRuleUpdate_ReservoirSize != null) { request.SamplingRuleUpdate.ReservoirSize = requestSamplingRuleUpdate_samplingRuleUpdate_ReservoirSize.Value; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_ResourceARN = null; if (cmdletContext.SamplingRuleUpdate_ResourceARN != null) { requestSamplingRuleUpdate_samplingRuleUpdate_ResourceARN = cmdletContext.SamplingRuleUpdate_ResourceARN; } if (requestSamplingRuleUpdate_samplingRuleUpdate_ResourceARN != null) { request.SamplingRuleUpdate.ResourceARN = requestSamplingRuleUpdate_samplingRuleUpdate_ResourceARN; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_RuleARN = null; if (cmdletContext.SamplingRuleUpdate_RuleARN != null) { requestSamplingRuleUpdate_samplingRuleUpdate_RuleARN = cmdletContext.SamplingRuleUpdate_RuleARN; } if (requestSamplingRuleUpdate_samplingRuleUpdate_RuleARN != null) { request.SamplingRuleUpdate.RuleARN = requestSamplingRuleUpdate_samplingRuleUpdate_RuleARN; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_RuleName = null; if (cmdletContext.SamplingRuleUpdate_RuleName != null) { requestSamplingRuleUpdate_samplingRuleUpdate_RuleName = cmdletContext.SamplingRuleUpdate_RuleName; } if (requestSamplingRuleUpdate_samplingRuleUpdate_RuleName != null) { request.SamplingRuleUpdate.RuleName = requestSamplingRuleUpdate_samplingRuleUpdate_RuleName; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_ServiceName = null; if (cmdletContext.SamplingRuleUpdate_ServiceName != null) { requestSamplingRuleUpdate_samplingRuleUpdate_ServiceName = cmdletContext.SamplingRuleUpdate_ServiceName; } if (requestSamplingRuleUpdate_samplingRuleUpdate_ServiceName != null) { request.SamplingRuleUpdate.ServiceName = requestSamplingRuleUpdate_samplingRuleUpdate_ServiceName; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_ServiceType = null; if (cmdletContext.SamplingRuleUpdate_ServiceType != null) { requestSamplingRuleUpdate_samplingRuleUpdate_ServiceType = cmdletContext.SamplingRuleUpdate_ServiceType; } if (requestSamplingRuleUpdate_samplingRuleUpdate_ServiceType != null) { request.SamplingRuleUpdate.ServiceType = requestSamplingRuleUpdate_samplingRuleUpdate_ServiceType; requestSamplingRuleUpdateIsNull = false; } System.String requestSamplingRuleUpdate_samplingRuleUpdate_URLPath = null; if (cmdletContext.SamplingRuleUpdate_URLPath != null) { requestSamplingRuleUpdate_samplingRuleUpdate_URLPath = cmdletContext.SamplingRuleUpdate_URLPath; } if (requestSamplingRuleUpdate_samplingRuleUpdate_URLPath != null) { request.SamplingRuleUpdate.URLPath = requestSamplingRuleUpdate_samplingRuleUpdate_URLPath; requestSamplingRuleUpdateIsNull = false; } // determine if request.SamplingRuleUpdate should be set to null if (requestSamplingRuleUpdateIsNull) { request.SamplingRuleUpdate = 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); }