asmprotocol/php-client

ASMP 的 PHP 客户端库

v0.5.0 2019-03-25 12:56 UTC

This package is auto-updated.

Last update: 2024-08-26 01:43:03 UTC


README

应用服务器管理协议服务器

此 PHP 包由 Swagger Codegen 项目自动生成

  • API 版本:1.0.0
  • 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen

要求

PHP 5.5 及以上

安装与使用

Composer

要使用 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请遵循 安装过程,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: asmp_auth
$config = ASMP\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ASMP\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');

$apiInstance = new ASMP\Client\Api\ChangeApi(
    // 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
);
$body = new \ASMP\Client\Model\ChangeRequest(); // \ASMP\Client\Model\ChangeRequest | Request a specific change

try {
    $result = $apiInstance->change($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ChangeApi->change: ', $e->getMessage(), PHP_EOL;
}
?>

API 端点文档

所有 URI 都相对于 https://swagger.asmprotocol.org/v1

模型文档

授权文档

asmp_auth

  • 类型:API 密钥
  • API 密钥参数名:X-API-KEY
  • 位置:HTTP 头部

作者

info@asmprotocol.org