Module: Oktakit::Client::Users

Included in:
Oktakit::Client
Defined in:
lib/oktakit/client/users.rb

Instance Method Summary collapse

Instance Method Details

#activate_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Activate User

Examples:

Oktakit.activate_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns empty object by default. If sendEmail is false, a user activation link.

See Also:



130
131
132
# File 'lib/oktakit/client/users.rb', line 130

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

#change_password(id, options = {}) ⇒ Hash<Sawyer::Resource>

Change Password

Examples:

Oktakit.change_password('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Credentials of the user

See Also:



310
311
312
# File 'lib/oktakit/client/users.rb', line 310

def change_password(id, options = {})
  post("/users/#{id}/credentials/change_password", options)
end

#change_recovery_question(id, options = {}) ⇒ Hash<Sawyer::Resource>

Change Recovery Question

Examples:

Oktakit.change_recovery_question('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Credentials of the user

See Also:



326
327
328
# File 'lib/oktakit/client/users.rb', line 326

def change_recovery_question(id, options = {})
  post("/users/#{id}/credentials/change_recovery_question", options)
end

#clear_user_sessions(id, options = {}) ⇒ Object

Clear user sessions

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for the request.

See Also:



341
342
343
# File 'lib/oktakit/client/users.rb', line 341

def clear_user_sessions(id, options = {})
  delete("/users/#{id}/sessions", options)
end

#create_user(options = {}) ⇒ Hash<Sawyer::Resource>

Create User

Examples:

Oktakit.create_user

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns the created User.

See Also:



15
16
17
# File 'lib/oktakit/client/users.rb', line 15

def create_user(options = {})
  post('/users', options)
end

#deactivate_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Deactivate User

Examples:

Oktakit.deactivate_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object.

See Also:



164
165
166
# File 'lib/oktakit/client/users.rb', line 164

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

#delete_user(id, options = {}) ⇒ Object

Note:

Deletes a user permanently. This operation can only be performed on users that have a DEPROVISIONED status. This action cannot be recovered!

Delete User

This operation on a user that hasn’t been deactivated causes that user to be deactivated. A second delete operation is required to delete the user.

Examples:

Oktakit.delete_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for the request.

See Also:



182
183
184
# File 'lib/oktakit/client/users.rb', line 182

def delete_user(id, options = {})
  delete("/users/#{id}", options)
end

#expire_password(id, options = {}) ⇒ Hash<Sawyer::Resource>

Expire Password

Examples:

Oktakit.expire_password('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns the user by default. If tempPassword is true, a temporary password.

See Also:



262
263
264
# File 'lib/oktakit/client/users.rb', line 262

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

#forgot_password(id, options = {}) ⇒ Hash<Sawyer::Resource>

Forgot Password

Examples:

Oktakit.forgot_password('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object by default. If sendEmail is false a password reset link

See Also:



294
295
296
# File 'lib/oktakit/client/users.rb', line 294

def forgot_password(id, options = {})
  post("/users/#{id}/credentials/forgot_password", options)
end

Get Assigned App Links

Examples:

Oktakit.get_assigned_app_links('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Array<Sawyer::Resource>)

    Array of App Links

See Also:



98
99
100
# File 'lib/oktakit/client/users.rb', line 98

def get_assigned_app_links(id, options = {})
  get("/users/#{id}/appLinks", options)
end

#get_member_groups(id, options = {}) ⇒ Array<Sawyer::Resource>

Get Member Groups

Examples:

Oktakit.get_member_groups('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Array<Sawyer::Resource>)

    Array of Groups

See Also:



114
115
116
# File 'lib/oktakit/client/users.rb', line 114

def get_member_groups(id, options = {})
  get("/users/#{id}/groups", options)
end

#get_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Get User

Examples:

Oktakit.get_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Fetched User

See Also:



31
32
33
# File 'lib/oktakit/client/users.rb', line 31

def get_user(id, options = {})
  get("/users/#{id}", options)
end

#list_users(options = {}) ⇒ Array<Sawyer::Resource>

List Users

Examples:

Oktakit.list_users

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Array<Sawyer::Resource>)

    Array of User

See Also:



46
47
48
# File 'lib/oktakit/client/users.rb', line 46

def list_users(options = {})
  get('/users', options)
end

#reactivate_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Note:

The user must be in a PROVISIONED status

Reactivate User

Examples:

Oktakit.reactivate_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    .

See Also:



148
149
150
# File 'lib/oktakit/client/users.rb', line 148

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

#reset_factors(id, options = {}) ⇒ Hash<Sawyer::Resource>

Reset Factors

Examples:

Oktakit.reset_factors('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object by default.

See Also:



278
279
280
# File 'lib/oktakit/client/users.rb', line 278

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

#reset_password(id, options = {}) ⇒ Hash<Sawyer::Resource>

Reset Password

Examples:

Oktakit.reset_password('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object by default. If sendEmail is false a password reset link

See Also:



246
247
248
# File 'lib/oktakit/client/users.rb', line 246

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

#suspend_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Suspend User

Examples:

Oktakit.suspend_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object.

See Also:



198
199
200
# File 'lib/oktakit/client/users.rb', line 198

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

#unlock_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Unlock User

Examples:

Oktakit.unlock_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object

See Also:



230
231
232
# File 'lib/oktakit/client/users.rb', line 230

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

#unsuspend_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Unsuspend User

Examples:

Oktakit.unsuspend_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Returns an empty object. Returns an empty object.

See Also:



214
215
216
# File 'lib/oktakit/client/users.rb', line 214

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

#update_profile(id, options = {}) ⇒ Hash<Sawyer::Resource>

Update Profile

Examples:

Oktakit.update_profile('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Updated User

See Also:



83
84
85
# File 'lib/oktakit/client/users.rb', line 83

def update_profile(id, options = {})
  post("/users/#{id}", options)
end

#update_user(id, options = {}) ⇒ Hash<Sawyer::Resource>

Update User

Examples:

Oktakit.update_user('id')

Parameters:

  • options (:query) (defaults to: {})
    Hash

    Optional. Query params for request

  • options (:headers) (defaults to: {})
    Hash

    Optional. Header params for the request.

  • options (:accept) (defaults to: {})
    String

    Optional. The content type to accept. Default application/json

  • options (:content_type) (defaults to: {})
    String

    Optional. The content type for the request. Default application/json

  • options (:partial) (defaults to: {})
    Boolean

    Indicates a partial update, in which case POST will be used instead of PUT

  • options (Hash) (defaults to: {})

    Optional. Body params for request.

Returns:

  • (Hash<Sawyer::Resource>)

    Updated User

See Also:



63
64
65
66
67
68
69
# File 'lib/oktakit/client/users.rb', line 63

def update_user(id, options = {})
  if options.delete(:partial)
    post("/users/#{id}", options)
  else
    put("/users/#{id}", options)
  end
end