Skip to content

Commit

Permalink
reactivate user
Browse files Browse the repository at this point in the history
added reactivate post
added reactivate test
  • Loading branch information
r4cc00n committed Nov 19, 2021
1 parent 197230d commit 73efe19
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/oktakit/client/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ def activate_user(id, options = {})
post("/users/#{id}/lifecycle/activate", options)
end

# Reactivate User
#
# @params id [string] User ID
# @param options[:query] [Hash] Optional. Query params for request
# @param options[:headers] [Hash] Optional. Header params for the request.
# @param options[:accept] [String] Optional. The content type to accept. Default application/json
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json
# @param options [Hash] Optional. Body params for request.
# @return [Hash<Sawyer::Resource>] Returns empty object by default. If sendEmail is false, a user reactivation link.
# @note The user must be in a PROVISIONED status
# @see https://developer.okta.com/docs/reference/api/users/#reactivate-user
# @example
# Oktakit.reactivate_user('id')

def reactivate_user(id, options = {})
post("/users/#{id}/lifecycle/reactivate", options)
end

# Deactivate User
#
# @params id [string] User ID
Expand Down
9 changes: 9 additions & 0 deletions spec/client/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@
end
end

describe '#reactivate_user' do
it 'returns empty object by default.' do
VCR.use_cassette('reactivate_user') do
resp, = client.reactivate_user(USERS_USER_ID)
expect(resp.to_h).to(be == {})
end
end
end

describe '#deactivate_user' do
it 'returns an empty object.' do
VCR.use_cassette('deactivate_user') do
Expand Down

0 comments on commit 73efe19

Please sign in to comment.