示例#1
0
 /// <summary>
 /// Paginator for GetInterpolatedAssetPropertyValues operation
 ///</summary>
 public IGetInterpolatedAssetPropertyValuesPaginator GetInterpolatedAssetPropertyValues(GetInterpolatedAssetPropertyValuesRequest request)
 {
     return(new GetInterpolatedAssetPropertyValuesPaginator(this.client, request));
 }
示例#2
0
 private Amazon.IoTSiteWise.Model.GetInterpolatedAssetPropertyValuesResponse CallAWSServiceOperation(IAmazonIoTSiteWise client, Amazon.IoTSiteWise.Model.GetInterpolatedAssetPropertyValuesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT SiteWise", "GetInterpolatedAssetPropertyValues");
     try
     {
         #if DESKTOP
         return(client.GetInterpolatedAssetPropertyValues(request));
         #elif CORECLR
         return(client.GetInterpolatedAssetPropertyValuesAsync(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;
     }
 }
示例#3
0
 internal GetInterpolatedAssetPropertyValuesPaginator(IAmazonIoTSiteWise client, GetInterpolatedAssetPropertyValuesRequest request)
 {
     this._client  = client;
     this._request = request;
 }
示例#4
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext      = context as CmdletContext;
            var useParameterSelect = this.Select.StartsWith("^");

            // create request and set iteration invariants
            var request = new Amazon.IoTSiteWise.Model.GetInterpolatedAssetPropertyValuesRequest();

            if (cmdletContext.AssetId != null)
            {
                request.AssetId = cmdletContext.AssetId;
            }
            if (cmdletContext.EndTimeInSecond != null)
            {
                request.EndTimeInSeconds = cmdletContext.EndTimeInSecond.Value;
            }
            if (cmdletContext.EndTimeOffsetInNano != null)
            {
                request.EndTimeOffsetInNanos = cmdletContext.EndTimeOffsetInNano.Value;
            }
            if (cmdletContext.IntervalInSecond != null)
            {
                request.IntervalInSeconds = cmdletContext.IntervalInSecond.Value;
            }
            if (cmdletContext.IntervalWindowInSecond != null)
            {
                request.IntervalWindowInSeconds = cmdletContext.IntervalWindowInSecond.Value;
            }
            if (cmdletContext.MaxResult != null)
            {
                request.MaxResults = cmdletContext.MaxResult.Value;
            }
            if (cmdletContext.PropertyAlias != null)
            {
                request.PropertyAlias = cmdletContext.PropertyAlias;
            }
            if (cmdletContext.PropertyId != null)
            {
                request.PropertyId = cmdletContext.PropertyId;
            }
            if (cmdletContext.Quality != null)
            {
                request.Quality = cmdletContext.Quality;
            }
            if (cmdletContext.StartTimeInSecond != null)
            {
                request.StartTimeInSeconds = cmdletContext.StartTimeInSecond.Value;
            }
            if (cmdletContext.StartTimeOffsetInNano != null)
            {
                request.StartTimeOffsetInNanos = cmdletContext.StartTimeOffsetInNano.Value;
            }
            if (cmdletContext.Type != null)
            {
                request.Type = cmdletContext.Type;
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.NextToken;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            do
            {
                request.NextToken = _nextToken;

                CmdletOutput output;

                try
                {
                    var response = CallAWSServiceOperation(client, request);

                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };

                    _nextToken = response.NextToken;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }