-
Notifications
You must be signed in to change notification settings - Fork 137
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
Add parameters for users imports #177
Add parameters for users imports #177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @makoto-matsumoto! A couple of small changes here. I'm also looking into why CI is not running on this PR.
We're working on a release for this week so great timing on this!
@@ -17,10 +17,34 @@ | |||
it { expect(@instance).to respond_to(:import_users) } | |||
it 'expect client to send post to /api/v2/jobs/users-imports' do | |||
expect(@instance).to receive(:post_file).with( | |||
'/api/v2/jobs/users-imports', users: 'file', connection_id: 'connnection_id' | |||
'/api/v2/jobs/users-imports', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for tests!
lib/auth0/api/v2/jobs.rb
Outdated
raise Auth0::InvalidParameter, 'Must specify a valid file' if users_file.to_s.empty? | ||
raise Auth0::InvalidParameter, 'Must specify a connection_id' if connection_id.to_s.empty? | ||
|
||
request_params = { | ||
users: users_file, | ||
connection_id: connection_id | ||
connection_id: connection_id, | ||
upsert: options[:upsert].nil? ? false : options[:upsert], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this library, we typically use hash.fetch
for values:
https://github.com/auth0/ruby-auth0/blob/master/lib/auth0/api/v2/users.rb#L30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review.
It was simpler to use hash.fetch
Closing and re-opening to trigger CI |
@makoto-matsumoto - Thank you once again. I'll merge in #178 when it's been reviewed, we can merge in the changes, and this (and your other one) will be good to go. |
@makoto-matsumoto - This one is ready as well! Just rebase |
483d729
to
c7ecd35
Compare
I rebased the master and did a push. |
Changes
Add request parameters for users imports endpoint.
(upsert / external_id / send_completion_email)
References
https://auth0.com/docs/api/management/v2/#!/Jobs/post_users_imports
Testing
Checklist