src/endpoints/Profile.php
<?php
namespace HnhDigital\LinodeApi;
/*
* This file is part of the PHP Linode API.
*
* (c) H&H|Digital <hello@hnh.digital>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use HnhDigital\LinodeApi\Foundation\Base;
/**
* This is the Profile class.
*
* This file is automatically generated.
*
* @link https://developers.linode.com/api/v4#tag/Profile
*
* @author Rocco Howard <rocco@hnh.digital>
*/
class Profile extends Base
{
/**
* Endpoint.
*
* @var string
*/
protected $endpoint = 'profile';
/**
* This model is fillable.
*
* @var bool
*/
protected $fillable = true;
/**
* This model's method that provides the data to fill it.
*
* @var string
*/
protected $fill_method = 'get';
/**
* Constructor.
*
* @return void
*/
public function __construct($fill = [])
{
parent::__construct($fill);
}
/**
* Returns information about the current User. This can be used to see who is acting in applications where more than one
* token is managed. For example, in third-party OAuth applications.
*
* This endpoint is always accessible, no matter what OAuth scopes the acting token has.
*
* @link https://developers.linode.com/api/v4#operation/getProfile
*
* @return array
*/
public function get()
{
return $this->apiCall('get', '', [], ['auto-fill' => true]);
}
/**
* Update information in your Profile. This option is _not_ available to all third-party clients.
*
* @link https://developers.linode.com/api/v4#operation/updateProfile
*
* @return void
*/
public function update($optional = [])
{
return $this->apiCall('put', '', ['json' => $this->getDirty($optional)]);
}
}