hnhdigital-os/php-linode-api

View on GitHub
src/endpoints/Profile/Grants.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace HnhDigital\LinodeApi\Profile;

/*
 * 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 Grants class.
 *
 * This file is automatically generated.
 *
 * @link https://developers.linode.com/api/v4#tag/Profile-Grants
 *
 * @author Rocco Howard <rocco@hnh.digital>
 */
class Grants extends Base
{
    /**
     * Endpoint.
     *
     * @var string
     */
    protected $endpoint = 'profile/grants';

    /**
     * Constructor.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * This returns a GrantsResponse describing what the acting User has been granted access to.  For unrestricted users, this
     * will return a  204 and no body because unrestricted users have access to everything without grants.  This will not
     * return information about entities you do not have access to.  This endpoint is useful when writing third-party OAuth
     * applications to see what options you should present to the acting User.
     *
     * For example, if they do not have `global.add_linodes`, you might not display a button to deploy a new Linode.
     *
     * Any client may access this endpoint; no OAuth scopes are required.
     *
     * @link https://developers.linode.com/api/v4#operation/getProfileGrants
     *
     * @return array
     */
    public function get()
    {
        return $this->apiCall('get', '', [], ['auto-fill' => true]);
    }
}