storehouse/sdk-php

Storehouse API SDK for PHP

dev-master 2020-05-02 03:18 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

ClassMethodHTTP requestDescription
ProjectApicreateProjectPOST /v1/projectsCreate a project
ProjectApideleteProjectDELETE /v1/projects/{name}Delete a project
ProjectApidisableModulePOST /v1/projects/{name}/modules/{module}/disableDisable a module for a project
ProjectApienableModulePOST /v1/projects/{name}/modules/{module}/enableEnable a module for a project
ProjectApigetMyProjectsGET /v1/users/me/projectsGet projects that are visible to a user.
ProjectApigetProjectGET /v1/projects/{name}Get a project
ProjectApipatchProjectPATCH /v1/projects/{name}Update a project
ProjectApiupdateModulePATCH /v1/projects/{name}/modules/{module}/settingsUpdate a module for a project
UserApigetMeGET /v1/users/meList current user
UserApigetMyProjectsGET /v1/users/me/projectsGet projects that are visible to a user.
UserApipatchMePATCH /v1/users/meUpdate current user

Documentation For Models

Documentation For Authorization

apiAuthentication

  • Type: HTTP basic authentication

basicAuthentication

  • Type: HTTP basic authentication

Author