ec/cns-client

欧洲委员会 / 企业通知系统 (CNS) REST API 客户端

0.0.1 2022-12-26 16:14 UTC

This package is auto-updated.

Last update: 2024-09-26 20:10:51 UTC


README

企业通知系统 (CNS) REST API 的版本 v1.2.0。

安装 & 使用

需求

PHP 7.4 及以上版本。也应适用于 PHP 8.0。

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门指南

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

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




$apiInstance = new EC\CNS\Client\Api\ClientSystemsApi(
    // 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()
);
$client_system_key = 'client_system_key_example'; // string | The unique client system key identifier.
$client_system_password = 'client_system_password_example'; // string | Client System Password.
$white_list_request = new \EC\CNS\Client\Model\WhiteListRequest(); // \EC\CNS\Client\Model\WhiteListRequest | Smtp addresses list for a Client System.

try {
    $result = $apiInstance->addWhiteList($client_system_key, $client_system_password, $white_list_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ClientSystemsApi->addWhiteList: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都是相对于 /cns/services/rest

模型

授权

所有端点都不需要授权。

测试

要运行测试,使用

composer install
vendor/bin/phpunit

作者

DIGIT-CNS-SUPPORT@ec.europa.eu

关于此包

此 PHP 包由 OpenAPI Generator 项目自动生成

  • API 版本:v1.2.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen