Skip to content

Latest commit

 

History

History
310 lines (233 loc) · 9.05 KB

UserApi.md

File metadata and controls

310 lines (233 loc) · 9.05 KB

Fastly::UserApi

require 'fastly'
api_instance = Fastly::UserApi.new

Methods

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
create_user POST /user Create a user
delete_user DELETE /user/{user_id} Delete a user
get_current_user GET /current_user Get the current user
get_user GET /user/{user_id} Get a user
request_password_reset POST /user/{user_login}/password/request_reset Request a password reset
update_user PUT /user/{user_id} Update a user
update_user_password POST /current_user/password Update the user's password

create_user()

create_user(opts): <UserResponse> # Create a user

Create a user.

Examples

api_instance = Fastly::UserApi.new
opts = {
    login: 'login_example', # String | 
    name: 'name_example', # String | The real life name of the user.
    limit_services: true, # Boolean | Indicates that the user has limited access to the customer's services.
    locked: true, # Boolean | Indicates whether the is account is locked for editing or not.
    require_new_password: true, # Boolean | Indicates if a new password is required at next login.
    role: Fastly::RoleUser::USER, # RoleUser | 
    two_factor_auth_enabled: true, # Boolean | Indicates if 2FA is enabled on the user.
    two_factor_setup_required: true, # Boolean | Indicates if 2FA is required by the user's customer account.
}

begin
  # Create a user
  result = api_instance.create_user(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->create_user: #{e}"
end

Options

Name Type Description Notes
login String [optional]
name String The real life name of the user. [optional]
limit_services Boolean Indicates that the user has limited access to the customer's services. [optional]
locked Boolean Indicates whether the is account is locked for editing or not. [optional]
require_new_password Boolean Indicates if a new password is required at next login. [optional]
role RoleUser [optional]
two_factor_auth_enabled Boolean Indicates if 2FA is enabled on the user. [optional]
two_factor_setup_required Boolean Indicates if 2FA is required by the user's customer account. [optional]

Return type

UserResponse

[Back to top] [Back to API list] [Back to README]

delete_user()

delete_user(opts): <InlineResponse200> # Delete a user

Delete a user.

Examples

api_instance = Fastly::UserApi.new
opts = {
    user_id: 'user_id_example', # String | Alphanumeric string identifying the user.
}

begin
  # Delete a user
  result = api_instance.delete_user(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->delete_user: #{e}"
end

Options

Name Type Description Notes
user_id String Alphanumeric string identifying the user.

Return type

InlineResponse200

[Back to top] [Back to API list] [Back to README]

get_current_user()

get_current_user: <UserResponse> # Get the current user

Get the logged in user.

Examples

api_instance = Fastly::UserApi.new

begin
  # Get the current user
  result = api_instance.get_current_user
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->get_current_user: #{e}"
end

Options

This endpoint does not need any parameter.

Return type

UserResponse

[Back to top] [Back to API list] [Back to README]

get_user()

get_user(opts): <UserResponse> # Get a user

Get a specific user.

Examples

api_instance = Fastly::UserApi.new
opts = {
    user_id: 'user_id_example', # String | Alphanumeric string identifying the user.
}

begin
  # Get a user
  result = api_instance.get_user(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->get_user: #{e}"
end

Options

Name Type Description Notes
user_id String Alphanumeric string identifying the user.

Return type

UserResponse

[Back to top] [Back to API list] [Back to README]

request_password_reset()

request_password_reset(opts): <InlineResponse200> # Request a password reset

Requests a password reset for the specified user.

Examples

api_instance = Fastly::UserApi.new
opts = {
    user_login: 'user_login_example', # String | The login associated with the user (typically, an email address).
}

begin
  # Request a password reset
  result = api_instance.request_password_reset(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->request_password_reset: #{e}"
end

Options

Name Type Description Notes
user_login String The login associated with the user (typically, an email address).

Return type

InlineResponse200

[Back to top] [Back to API list] [Back to README]

update_user()

update_user(opts): <UserResponse> # Update a user

Update a user. Only users with the role of superuser can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Two-factor attributes are not editable via this endpoint.

Examples

api_instance = Fastly::UserApi.new
opts = {
    user_id: 'user_id_example', # String | Alphanumeric string identifying the user.
    login: 'login_example', # String | 
    name: 'name_example', # String | The real life name of the user.
    limit_services: true, # Boolean | Indicates that the user has limited access to the customer's services.
    locked: true, # Boolean | Indicates whether the is account is locked for editing or not.
    require_new_password: true, # Boolean | Indicates if a new password is required at next login.
    role: Fastly::RoleUser::USER, # RoleUser | 
    two_factor_auth_enabled: true, # Boolean | Indicates if 2FA is enabled on the user.
    two_factor_setup_required: true, # Boolean | Indicates if 2FA is required by the user's customer account.
}

begin
  # Update a user
  result = api_instance.update_user(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->update_user: #{e}"
end

Options

Name Type Description Notes
user_id String Alphanumeric string identifying the user.
login String [optional]
name String The real life name of the user. [optional]
limit_services Boolean Indicates that the user has limited access to the customer's services. [optional]
locked Boolean Indicates whether the is account is locked for editing or not. [optional]
require_new_password Boolean Indicates if a new password is required at next login. [optional]
role RoleUser [optional]
two_factor_auth_enabled Boolean Indicates if 2FA is enabled on the user. [optional]
two_factor_setup_required Boolean Indicates if 2FA is required by the user's customer account. [optional]

Return type

UserResponse

[Back to top] [Back to API list] [Back to README]

update_user_password()

update_user_password(opts): <UserResponse> # Update the user's password

Update the user's password to a new one.

Examples

api_instance = Fastly::UserApi.new
opts = {
    old_password: 'old_password_example', # String | The user's current password.
    new_password: 'new_password_example', # String | The user's new password.
}

begin
  # Update the user's password
  result = api_instance.update_user_password(opts)
  p result
rescue Fastly::ApiError => e
  puts "Error when calling UserApi->update_user_password: #{e}"
end

Options

Name Type Description Notes
old_password String The user's current password. [optional]
new_password String The user's new password. [optional]

Return type

UserResponse

[Back to top] [Back to API list] [Back to README]