hnhdigital-os/php-linode-api

View on GitHub
src/endpoints/Managed/Credentials.php

Summary

Maintainability
A
1 hr
Test Coverage
<?php

namespace HnhDigital\LinodeApi\Managed;

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

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

    /**
     * Returns a paginated list of Managed Credentials on your Account.
     *
     * @link https://developers.linode.com/api/v4#operation/getManagedCredentials
     *
     * @return array
     */
    public function get()
    {
        return $this->apiSearch($this->endpoint, ['class' => 'Managed\Credential', 'parameters' => ['id']]);
    }

    /**
     * Creates a Managed Credential. A Managed Credential is stored securely to allow Linode special forces to access your
     * Managed Services and resolve issues.
     *
     * @param array $optional
     *                        - [id=null] (integer) This Credential's unique ID.
     *                        - [label=null] (string) The unique label for this Credential. This is for
     *                        display purposes only.
     *                        - [username=null] (string) The username to use when accessing the Managed Service.
     *                        - [password=null] (string) The password to use when accessing the Managed Service.
     *
     * @link https://developers.linode.com/api/v4#operation/createManagedCredential
     *
     * @return mixed
     */
    public function create($optional = [])
    {
        return $this->apiCall('post', '', ['json' => array_merge([
        ], $optional)]);
    }
}