예제 #1
0
        internal IronMqRestClient(IronClientConfig config)
        {
            _config = LazyInitializer.EnsureInitialized(ref config);

            if (_config.Keystone != null)
            {
                if (_config.KeystoneKeysExist())
                {
                    TokenContainer = new KeystoneContainer(_config.Keystone);
                }
                else
                {
                    throw new IronSharpException("Keystone keys missing");
                }
            }
            else
            {
                TokenContainer = new IronTokenContainer(_config.Token);
            }

            _restClient = new MqRestClient(TokenContainer);

            if (string.IsNullOrEmpty(Config.Host))
            {
                Config.Host = IronMqCloudHosts.DEFAULT;
            }

            if (config.ApiVersion == default(int))
            {
                config.ApiVersion = 3;
            }
        }
        internal IronMqRestClient(IronClientConfig config)
        {
            _config = LazyInitializer.EnsureInitialized(ref config);

            if (string.IsNullOrEmpty(Config.Host))
            {
                Config.Host = IronMqCloudHosts.DEFAULT;
            }

            Config.ApiVersion = config.ApiVersion.GetValueOrDefault(1);
        }
예제 #3
0
        internal IronCacheRestClient(IronClientConfig config)
        {
            _config = LazyInitializer.EnsureInitialized(ref config);

            if (string.IsNullOrEmpty(Config.Host))
            {
                Config.Host = IronCacheCloudHosts.DEFAULT;
            }

            if (config.ApiVersion == default(int))
            {
                config.ApiVersion = 1;
            }
        }
예제 #4
0
        /// <summary>
        /// Creates a new client using the specified configuration and optional <param name="env"></param> paramter to specificy which enivonment to use when loading default values;
        /// </summary>
        /// <param name="config">The explicitly specified configuration values</param>
        /// <param name="env">The environment key as it appears in the iron.json file.  See http://dev.iron.io/worker/reference/cli/#upload_with_multiple_environments for an example layout</param>
        public static IronMqRestClient @New(IronClientConfig config, string env = null)
        {
            IronClientConfig hierarchyConfig = IronDotConfigManager.Load(IronProduct.IronMQ, config, env);

            return(new IronMqRestClient(hierarchyConfig));
        }
예제 #5
0
 public HttpRequestMessageBuilder(IronClientConfig config, IRequestHelpersContainer requestHelpersContainer, IRestClientRequest request)
 {
     Config = config;
     RequestHelpersContainer = requestHelpersContainer;
     Request = request;
 }