Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Mechanical Turk sandbox mode #64

Open
4knahs opened this issue Apr 4, 2018 · 2 comments
Open

Support Mechanical Turk sandbox mode #64

4knahs opened this issue Apr 4, 2018 · 2 comments

Comments

@4knahs
Copy link

4knahs commented Apr 4, 2018

Currently the endpoint prefix is hardcoded for mturk:

host = get_host("mturk-requester", client)
...
defp get_host(endpoint_prefix, client) do
    if client.region == "local" do
      "localhost"
    else
      "#{endpoint_prefix}.#{client.region}.#{client.endpoint}"
    end
end

Since there is a sandbox development endpoint, it would be nice to support the "mturk-requester-sandbox" prefix as well.

@4knahs
Copy link
Author

4knahs commented Apr 4, 2018

The following lines allow passing the prefix through the options:

defp request(client, action, input, options) do
    prefix = Keyword.get(options, :endpoint_prefix, "mturk-requester")
    options = Keyword.delete(options, :endpoint_prefix)
    client = %{client | service: "mturk-requester"}
    host = get_host(prefix, client)
   ...
end

Then, one can pass the prefix like:

AWS.MechanicalTurk.list_h_i_ts(client, %{}, endpoint_prefix: "mturk-requester-sandbox")

Code in: https://github.com/4knahs/aws-elixir/blob/mturk-sandbox/lib/aws/mechanical_turk.ex#L577

@jkakar
Copy link
Owner

jkakar commented Apr 4, 2018

@4knahs Thanks for the report. This project has moved to https://github.com/aws-beam/aws-elixir. Can you please report the issue there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants