/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the forecastquery-2018-06-26.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.ForecastQueryService.Model; using Amazon.ForecastQueryService.Model.Internal.MarshallTransformations; using Amazon.ForecastQueryService.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.ForecastQueryService { /// /// Implementation for accessing ForecastQueryService /// /// Provides APIs for creating and managing Amazon Forecast resources. /// public partial class AmazonForecastQueryServiceClient : AmazonServiceClient, IAmazonForecastQueryService { private static IServiceMetadata serviceMetadata = new AmazonForecastQueryServiceMetadata(); #region Constructors /// /// Constructs AmazonForecastQueryServiceClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// public AmazonForecastQueryServiceClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonForecastQueryServiceConfig()) { } /// /// Constructs AmazonForecastQueryServiceClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The region to connect. public AmazonForecastQueryServiceClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonForecastQueryServiceConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonForecastQueryServiceClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The AmazonForecastQueryServiceClient Configuration Object public AmazonForecastQueryServiceClient(AmazonForecastQueryServiceConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonForecastQueryServiceClient with AWS Credentials /// /// AWS Credentials public AmazonForecastQueryServiceClient(AWSCredentials credentials) : this(credentials, new AmazonForecastQueryServiceConfig()) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonForecastQueryServiceClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonForecastQueryServiceConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Credentials and an /// AmazonForecastQueryServiceClient Configuration object. /// /// AWS Credentials /// The AmazonForecastQueryServiceClient Configuration Object public AmazonForecastQueryServiceClient(AWSCredentials credentials, AmazonForecastQueryServiceConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonForecastQueryServiceClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonForecastQueryServiceConfig()) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonForecastQueryServiceClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonForecastQueryServiceConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Access Key ID, AWS Secret Key and an /// AmazonForecastQueryServiceClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonForecastQueryServiceClient Configuration Object public AmazonForecastQueryServiceClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonForecastQueryServiceConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonForecastQueryServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonForecastQueryServiceConfig()) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The region to connect. public AmazonForecastQueryServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonForecastQueryServiceConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonForecastQueryServiceClient with AWS Access Key ID, AWS Secret Key and an /// AmazonForecastQueryServiceClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonForecastQueryServiceClient Configuration Object public AmazonForecastQueryServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonForecastQueryServiceConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// Customizes the runtime pipeline. /// /// Runtime pipeline for the current client. protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.RemoveHandler(); pipeline.AddHandlerAfter(new AmazonForecastQueryServiceEndpointResolver()); } /// /// Capture metadata for the service. /// protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// /// Disposes the service client. /// protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region QueryForecast internal virtual QueryForecastResponse QueryForecast(QueryForecastRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = QueryForecastRequestMarshaller.Instance; options.ResponseUnmarshaller = QueryForecastResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieves a forecast for a single item, filtered by the supplied criteria. /// /// /// /// The criteria is a key-value pair. The key is either item_id (or the equivalent /// non-timestamp, non-target field) from the TARGET_TIME_SERIES dataset, /// or one of the forecast dimensions specified as part of the FeaturizationConfig /// object. /// /// /// /// By default, QueryForecast returns the complete date range for the filtered /// forecast. You can request a specific date range. /// /// /// /// To get the full forecast, use the CreateForecastExportJob /// operation. /// /// /// /// The forecasts generated by Amazon Forecast are in the same timezone as the dataset /// that was used to create the predictor. /// /// /// /// Container for the necessary parameters to execute the QueryForecast service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the QueryForecast service method, as returned by ForecastQueryService. /// /// The value is invalid or is too long. /// /// /// The token is not valid. Tokens expire after 24 hours. /// /// /// The limit on the number of requests per second has been exceeded. /// /// /// The specified resource is in use. /// /// /// We can't find that resource. Check the information that you've provided and try again. /// /// REST API Reference for QueryForecast Operation public virtual Task QueryForecastAsync(QueryForecastRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = QueryForecastRequestMarshaller.Instance; options.ResponseUnmarshaller = QueryForecastResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region QueryWhatIfForecast internal virtual QueryWhatIfForecastResponse QueryWhatIfForecast(QueryWhatIfForecastRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = QueryWhatIfForecastRequestMarshaller.Instance; options.ResponseUnmarshaller = QueryWhatIfForecastResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieves a what-if forecast. /// /// Container for the necessary parameters to execute the QueryWhatIfForecast service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the QueryWhatIfForecast service method, as returned by ForecastQueryService. /// /// The value is invalid or is too long. /// /// /// The token is not valid. Tokens expire after 24 hours. /// /// /// The limit on the number of requests per second has been exceeded. /// /// /// The specified resource is in use. /// /// /// We can't find that resource. Check the information that you've provided and try again. /// /// REST API Reference for QueryWhatIfForecast Operation public virtual Task QueryWhatIfForecastAsync(QueryWhatIfForecastRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = QueryWhatIfForecastRequestMarshaller.Instance; options.ResponseUnmarshaller = QueryWhatIfForecastResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }