storehouse / sdk-php
Storehouse API SDK for PHP
dev-master
2020-05-02 03:18 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2025-03-29 00:48:09 UTC
README
Storehouse (sthse.co) API
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 0.1
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: apiAuthentication
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
// Configure HTTP basic authorization: basicAuthentication
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new OpenAPI\Client\Api\ProjectApi(
// 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
);
$name = 'name_example'; // string | Name of the project. The user's name is prefixed to the provided value.
$type = 'type_example'; // string | Type of the project (git, svn, or hg)
$public = True; // bool | If the project should be marked as public.
try {
$apiInstance->createProject($name, $type, $public);
} catch (Exception $e) {
echo 'Exception when calling ProjectApi->createProject: ', $e->getMessage(), PHP_EOL;
}
?>
Documentation for API Endpoints
All URIs are relative to https://api.sthse.co
Class | Method | HTTP request | Description |
---|---|---|---|
ProjectApi | createProject | POST /v1/projects | Create a project |
ProjectApi | deleteProject | DELETE /v1/projects/{name} | Delete a project |
ProjectApi | disableModule | POST /v1/projects/{name}/modules/{module}/disable | Disable a module for a project |
ProjectApi | enableModule | POST /v1/projects/{name}/modules/{module}/enable | Enable a module for a project |
ProjectApi | getMyProjects | GET /v1/users/me/projects | Get projects that are visible to a user. |
ProjectApi | getProject | GET /v1/projects/{name} | Get a project |
ProjectApi | patchProject | PATCH /v1/projects/{name} | Update a project |
ProjectApi | updateModule | PATCH /v1/projects/{name}/modules/{module}/settings | Update a module for a project |
UserApi | getMe | GET /v1/users/me | List current user |
UserApi | getMyProjects | GET /v1/users/me/projects | Get projects that are visible to a user. |
UserApi | patchMe | PATCH /v1/users/me | Update current user |
Documentation For Models
Documentation For Authorization
apiAuthentication
- Type: HTTP basic authentication
basicAuthentication
- Type: HTTP basic authentication