private Amazon.CloudWatchRUM.Model.GetAppMonitorDataResponse CallAWSServiceOperation(IAmazonCloudWatchRUM client, Amazon.CloudWatchRUM.Model.GetAppMonitorDataRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "CloudWatch RUM", "GetAppMonitorData");
     try
     {
         #if DESKTOP
         return(client.GetAppMonitorData(request));
         #elif CORECLR
         return(client.GetAppMonitorDataAsync(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
 /// <summary>
 /// Paginator for GetAppMonitorData operation
 ///</summary>
 public IGetAppMonitorDataPaginator GetAppMonitorData(GetAppMonitorDataRequest request)
 {
     return(new GetAppMonitorDataPaginator(this.client, request));
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudWatchRUM.Model.GetAppMonitorDataRequest();

            if (cmdletContext.Filter != null)
            {
                request.Filters = cmdletContext.Filter;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.NextToken != null)
            {
                request.NextToken = cmdletContext.NextToken;
            }

            // populate TimeRange
            var requestTimeRangeIsNull = true;

            request.TimeRange = new Amazon.CloudWatchRUM.Model.TimeRange();
            System.Int64?requestTimeRange_timeRange_After = null;
            if (cmdletContext.TimeRange_After != null)
            {
                requestTimeRange_timeRange_After = cmdletContext.TimeRange_After.Value;
            }
            if (requestTimeRange_timeRange_After != null)
            {
                request.TimeRange.After = requestTimeRange_timeRange_After.Value;
                requestTimeRangeIsNull  = false;
            }
            System.Int64?requestTimeRange_timeRange_Before = null;
            if (cmdletContext.TimeRange_Before != null)
            {
                requestTimeRange_timeRange_Before = cmdletContext.TimeRange_Before.Value;
            }
            if (requestTimeRange_timeRange_Before != null)
            {
                request.TimeRange.Before = requestTimeRange_timeRange_Before.Value;
                requestTimeRangeIsNull   = false;
            }
            // determine if request.TimeRange should be set to null
            if (requestTimeRangeIsNull)
            {
                request.TimeRange = 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);
        }
Beispiel #4
0
 internal GetAppMonitorDataPaginator(IAmazonCloudWatchRUM client, GetAppMonitorDataRequest request)
 {
     this._client  = client;
     this._request = request;
 }