lodgea/lodgea-php

LODGEA的PHP SDK

1.2.0 2023-02-07 12:22 UTC

This package is auto-updated.

Last update: 2024-09-07 15:53:40 UTC


README

LODGEA SDK for php。更多信息请访问 https://docs.lodgea.io

安装与使用

要求

PHP 7.3及更高版本。虽然可能与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/lodgea-php/vendor/autoload.php');

入门指南

请按照安装过程进行,然后运行以下命令:

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



// Configure API key authorization: ApiKeyAuth
$config = com.lodgea\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = com.lodgea\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');


$apiInstance = new com.lodgea\Api\DefaultApi(
    // 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
);
$inline_object1 = new \com.lodgea\com.lodgea.model\InlineObject1(); // \com.lodgea\com.lodgea.model\InlineObject1

try {
    $result = $apiInstance->availabilitySearchPost($inline_object1);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->availabilitySearchPost: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于 https://api.eu.lodgea.io/v1

模型

授权

ApiKeyAuth

  • 类型: API密钥
  • API密钥参数名: apiKey
  • 位置: HTTP头

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

support@lodgea.com

关于此包

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

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