コード例 #1
0
        protected IAmazonMTurk CreateClient(AWSCredentials credentials, RegionEndpoint region)
        {
            var config = new AmazonMTurkConfig {
                RegionEndpoint = region
            };

            Amazon.PowerShell.Utils.Common.PopulateConfig(this, config);
            this.CustomizeClientConfig(config);
            var client = new AmazonMTurkClient(credentials, config);

            client.BeforeRequestEvent += RequestEventHandler;
            client.AfterResponseEvent += ResponseEventHandler;
            return(client);
        }
コード例 #2
0
        public AmazonMTurkClient getMTurkClient()
        {
            try
            {
                AmazonMTurkConfig config = new AmazonMTurkConfig();
                config.ServiceURL = _appSettings.awsTurkEndpoint;
                AmazonMTurkClient client = new AmazonMTurkClient(_appSettings.awsAccessKey, _appSettings.awsSecret, config);
                return(client);
            }catch (Exception e)
            {
            }

            throw new Exception("Could not load Mturk Credentials");
        }