Skip to content

Latest commit

 

History

History
294 lines (211 loc) · 10 KB

UserApi.md

File metadata and controls

294 lines (211 loc) · 10 KB

Fastly\Api\UserApi

$apiInstance = new Fastly\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

Methods

Note

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

Method HTTP request Description
createUser() POST /user Create a user
deleteUser() DELETE /user/{user_id} Delete a user
getCurrentUser() GET /current_user Get the current user
getUser() GET /user/{user_id} Get a user
requestPasswordReset() POST /user/{user_login}/password/request_reset Request a password reset
updateUser() PUT /user/{user_id} Update a user
updateUserPassword() POST /current_user/password Update the user's password

createUser()

createUser($options): \Fastly\Model\UserResponse // Create a user

Create a user.

Example

    $options['login'] = 'login_example'; // string
$options['name'] = 'name_example'; // string | The real life name of the user.
$options['limit_services'] = True; // bool | Indicates that the user has limited access to the customer's services.
$options['locked'] = True; // bool | Indicates whether the is account is locked for editing or not.
$options['require_new_password'] = True; // bool | Indicates if a new password is required at next login.
$options['role'] = new \Fastly\Model\RoleUser(); // \Fastly\Model\RoleUser
$options['two_factor_auth_enabled'] = True; // bool | Indicates if 2FA is enabled on the user.
$options['two_factor_setup_required'] = True; // bool | Indicates if 2FA is required by the user's customer account.

try {
    $result = $apiInstance->createUser($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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

Return type

\Fastly\Model\UserResponse

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

deleteUser()

deleteUser($options): \Fastly\Model\InlineResponse200 // Delete a user

Delete a user.

Example

    $options['user_id'] = 'user_id_example'; // string | Alphanumeric string identifying the user.

try {
    $result = $apiInstance->deleteUser($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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

Return type

\Fastly\Model\InlineResponse200

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

getCurrentUser()

getCurrentUser($options): \Fastly\Model\UserResponse // Get the current user

Get the logged in user.

Example

    
try {
    $result = $apiInstance->getCurrentUser($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->getCurrentUser: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

This endpoint does not need any parameters.

Return type

\Fastly\Model\UserResponse

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

getUser()

getUser($options): \Fastly\Model\UserResponse // Get a user

Get a specific user.

Example

    $options['user_id'] = 'user_id_example'; // string | Alphanumeric string identifying the user.

try {
    $result = $apiInstance->getUser($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->getUser: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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

Return type

\Fastly\Model\UserResponse

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

requestPasswordReset()

requestPasswordReset($options): \Fastly\Model\InlineResponse200 // Request a password reset

Requests a password reset for the specified user.

Example

    $options['user_login'] = 'user_login_example'; // string | The login associated with the user (typically, an email address).

try {
    $result = $apiInstance->requestPasswordReset($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->requestPasswordReset: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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

Return type

\Fastly\Model\InlineResponse200

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

updateUser()

updateUser($options): \Fastly\Model\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.

Example

    $options['user_id'] = 'user_id_example'; // string | Alphanumeric string identifying the user.
$options['login'] = 'login_example'; // string
$options['name'] = 'name_example'; // string | The real life name of the user.
$options['limit_services'] = True; // bool | Indicates that the user has limited access to the customer's services.
$options['locked'] = True; // bool | Indicates whether the is account is locked for editing or not.
$options['require_new_password'] = True; // bool | Indicates if a new password is required at next login.
$options['role'] = new \Fastly\Model\RoleUser(); // \Fastly\Model\RoleUser
$options['two_factor_auth_enabled'] = True; // bool | Indicates if 2FA is enabled on the user.
$options['two_factor_setup_required'] = True; // bool | Indicates if 2FA is required by the user's customer account.

try {
    $result = $apiInstance->updateUser($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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 bool Indicates that the user has limited access to the customer's services. [optional]
locked bool Indicates whether the is account is locked for editing or not. [optional]
require_new_password bool Indicates if a new password is required at next login. [optional]
role \Fastly\Model\RoleUser [optional]
two_factor_auth_enabled bool Indicates if 2FA is enabled on the user. [optional]
two_factor_setup_required bool Indicates if 2FA is required by the user's customer account. [optional]

Return type

\Fastly\Model\UserResponse

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

updateUserPassword()

updateUserPassword($options): \Fastly\Model\UserResponse // Update the user's password

Update the user's password to a new one.

Example

    $options['old_password'] = 'old_password_example'; // string | The user's current password.
$options['new_password'] = 'new_password_example'; // string | The user's new password.

try {
    $result = $apiInstance->updateUserPassword($options);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->updateUserPassword: ', $e->getMessage(), PHP_EOL;
}

Options

Note: the input parameter is an associative array with the keys listed below.

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

Return type

\Fastly\Model\UserResponse

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