/// <summary>
 /// Class disposer (to implement IDisposable)
 /// </summary>
 public void Dispose()
 {
     try
     {
         if (CloudSearchClient != null)
         {
             CloudSearchClient.Dispose();
         }
     }
     catch
     {
     }
     CloudSearchClient = null;
 }
        public AWSCloudSearchHelper(RegionEndpoint regionEndpoint, string AWSAcessKey, string AWSSecretKey, string AWSCloudSearchDomainEndpoint)
        {
            // Set configuration info
            AmazonCloudSearchDomainConfig config = new AmazonCloudSearchDomainConfig();

            config.Timeout          = new TimeSpan(1, 0, 0);
            config.ReadWriteTimeout = new TimeSpan(1, 0, 0);
            config.RegionEndpoint   = regionEndpoint;
            config.ServiceURL       = AWSCloudSearchDomainEndpoint;

            // Create CloudSearch client
            CloudSearchClient = new AmazonCloudSearchDomainClient(
                AWSAcessKey,
                AWSSecretKey,
                config);
        }
        public AWSCloudSearchHelper(RegionEndpoint regionEndpoint)
        {
            // Set configuration info
            AmazonCloudSearchDomainConfig config = new AmazonCloudSearchDomainConfig();

            config.Timeout          = new TimeSpan(1, 0, 0);
            config.ReadWriteTimeout = new TimeSpan(1, 0, 0);
            config.RegionEndpoint   = regionEndpoint;
            config.ServiceURL       = Gadgets.LoadConfigurationSetting("AWS_CloudSearch_DomainEndpoint", "");

            // Create CloudSearch client
            CloudSearchClient = new AmazonCloudSearchDomainClient(
                Gadgets.LoadConfigurationSetting("AWSAccessKey", ""),
                Gadgets.LoadConfigurationSetting("AWSSecretKey", ""),
                config);
        }
        private Amazon.CloudSearchDomain.Model.SearchResponse CallAWSServiceOperation(IAmazonCloudSearchDomain client, Amazon.CloudSearchDomain.Model.SearchRequest request)
        {
            Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudSearchDomain", "Search");

            try
            {
#if DESKTOP
                return(client.Search(request));
#elif CORECLR
                return(client.SearchAsync(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;
            }
        }