An open API service indexing awesome lists of open source software.

https://github.com/bmlt-enabled/bmlt-server-go-client

Go Client for BMLT Admin API
https://github.com/bmlt-enabled/bmlt-server-go-client

Last synced: 4 days ago
JSON representation

Go Client for BMLT Admin API

Awesome Lists containing this project

README

          

# Go API client for bmlt

BMLT Admin API Documentation

## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: 1.0.0
- Package version: 1.4.1
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation

Install the following dependencies:

```sh
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
```

Put the package under your project folder and add the following in import:

```go
import bmlt "github.com/bmlt-enabled/bmlt-server-go-client"
```

To use a proxy, set the environment variable `HTTP_PROXY`:

```go
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```

## Configuration of Server URL

Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.

### Select Server Configuration

For using other server than the one defined on index 0 set context value `bmlt.ContextServerIndex` of type `int`.

```go
ctx := context.WithValue(context.Background(), bmlt.ContextServerIndex, 1)
```

### Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value `bmlt.ContextServerVariables` of type `map[string]string`.

```go
ctx := context.WithValue(context.Background(), bmlt.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```

Note, enum values are always validated and all unused variables are silently ignored.

### URLs Configuration per Operation

Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `bmlt.ContextOperationServerIndices` and `bmlt.ContextOperationServerVariables` context maps.

```go
ctx := context.WithValue(context.Background(), bmlt.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), bmlt.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```

## Documentation for API Endpoints

All URIs are relative to *http://localhost:8000/main_server*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*RootServerAPI* | [**AuthLogout**](docs/RootServerAPI.md#authlogout) | **Post** /api/v1/auth/logout | Revokes a token
*RootServerAPI* | [**AuthRefresh**](docs/RootServerAPI.md#authrefresh) | **Post** /api/v1/auth/refresh | Revokes and issues a new token
*RootServerAPI* | [**AuthToken**](docs/RootServerAPI.md#authtoken) | **Post** /api/v1/auth/token | Creates a token
*RootServerAPI* | [**CreateErrorTest**](docs/RootServerAPI.md#createerrortest) | **Post** /api/v1/errortest | Tests some errors
*RootServerAPI* | [**CreateFormat**](docs/RootServerAPI.md#createformat) | **Post** /api/v1/formats | Creates a format
*RootServerAPI* | [**CreateMeeting**](docs/RootServerAPI.md#createmeeting) | **Post** /api/v1/meetings | Creates a meeting
*RootServerAPI* | [**CreateServiceBody**](docs/RootServerAPI.md#createservicebody) | **Post** /api/v1/servicebodies | Creates a service body
*RootServerAPI* | [**CreateUser**](docs/RootServerAPI.md#createuser) | **Post** /api/v1/users | Creates a user
*RootServerAPI* | [**DeleteFormat**](docs/RootServerAPI.md#deleteformat) | **Delete** /api/v1/formats/{formatId} | Deletes a format
*RootServerAPI* | [**DeleteMeeting**](docs/RootServerAPI.md#deletemeeting) | **Delete** /api/v1/meetings/{meetingId} | Deletes a meeting
*RootServerAPI* | [**DeleteServiceBody**](docs/RootServerAPI.md#deleteservicebody) | **Delete** /api/v1/servicebodies/{serviceBodyId} | Deletes a service body
*RootServerAPI* | [**DeleteUser**](docs/RootServerAPI.md#deleteuser) | **Delete** /api/v1/users/{userId} | Deletes a user
*RootServerAPI* | [**GetFormat**](docs/RootServerAPI.md#getformat) | **Get** /api/v1/formats/{formatId} | Retrieves a format
*RootServerAPI* | [**GetFormats**](docs/RootServerAPI.md#getformats) | **Get** /api/v1/formats | Retrieves formats
*RootServerAPI* | [**GetLaravelLog**](docs/RootServerAPI.md#getlaravellog) | **Get** /api/v1/logs/laravel | Retrieves laravel log
*RootServerAPI* | [**GetMeeting**](docs/RootServerAPI.md#getmeeting) | **Get** /api/v1/meetings/{meetingId} | Retrieves a meeting
*RootServerAPI* | [**GetMeetingChanges**](docs/RootServerAPI.md#getmeetingchanges) | **Get** /api/v1/meetings/{meetingId}/changes | Retrieve changes for a meeting
*RootServerAPI* | [**GetMeetings**](docs/RootServerAPI.md#getmeetings) | **Get** /api/v1/meetings | Retrieves meetings
*RootServerAPI* | [**GetRootServer**](docs/RootServerAPI.md#getrootserver) | **Get** /api/v1/rootservers/{rootServerId} | Retrieves a root server
*RootServerAPI* | [**GetRootServers**](docs/RootServerAPI.md#getrootservers) | **Get** /api/v1/rootservers | Retrieves root servers
*RootServerAPI* | [**GetServiceBodies**](docs/RootServerAPI.md#getservicebodies) | **Get** /api/v1/servicebodies | Retrieves service bodies
*RootServerAPI* | [**GetServiceBody**](docs/RootServerAPI.md#getservicebody) | **Get** /api/v1/servicebodies/{serviceBodyId} | Retrieves a service body
*RootServerAPI* | [**GetSettings**](docs/RootServerAPI.md#getsettings) | **Get** /api/v1/settings | Retrieves all settings
*RootServerAPI* | [**GetUser**](docs/RootServerAPI.md#getuser) | **Get** /api/v1/users/{userId} | Retrieves a single user
*RootServerAPI* | [**GetUsers**](docs/RootServerAPI.md#getusers) | **Get** /api/v1/users | Retrieves users
*RootServerAPI* | [**PartialUpdateUser**](docs/RootServerAPI.md#partialupdateuser) | **Patch** /api/v1/users/{userId} | Patches a user
*RootServerAPI* | [**PatchFormat**](docs/RootServerAPI.md#patchformat) | **Patch** /api/v1/formats/{formatId} | Patches a format
*RootServerAPI* | [**PatchMeeting**](docs/RootServerAPI.md#patchmeeting) | **Patch** /api/v1/meetings/{meetingId} | Patches a meeting
*RootServerAPI* | [**PatchServiceBody**](docs/RootServerAPI.md#patchservicebody) | **Patch** /api/v1/servicebodies/{serviceBodyId} | Patches a service body
*RootServerAPI* | [**UpdateFormat**](docs/RootServerAPI.md#updateformat) | **Put** /api/v1/formats/{formatId} | Updates a format
*RootServerAPI* | [**UpdateMeeting**](docs/RootServerAPI.md#updatemeeting) | **Put** /api/v1/meetings/{meetingId} | Updates a meeting
*RootServerAPI* | [**UpdateServiceBody**](docs/RootServerAPI.md#updateservicebody) | **Put** /api/v1/servicebodies/{serviceBodyId} | Updates a Service Body
*RootServerAPI* | [**UpdateSettings**](docs/RootServerAPI.md#updatesettings) | **Patch** /api/v1/settings | Update settings
*RootServerAPI* | [**UpdateUser**](docs/RootServerAPI.md#updateuser) | **Put** /api/v1/users/{userId} | Update single user

## Documentation For Models

- [AuthenticationError](docs/AuthenticationError.md)
- [AuthorizationError](docs/AuthorizationError.md)
- [ConflictError](docs/ConflictError.md)
- [ErrorTest](docs/ErrorTest.md)
- [Format](docs/Format.md)
- [FormatBase](docs/FormatBase.md)
- [FormatCreate](docs/FormatCreate.md)
- [FormatPartialUpdate](docs/FormatPartialUpdate.md)
- [FormatTranslation](docs/FormatTranslation.md)
- [FormatUpdate](docs/FormatUpdate.md)
- [Meeting](docs/Meeting.md)
- [MeetingBase](docs/MeetingBase.md)
- [MeetingChangeResource](docs/MeetingChangeResource.md)
- [MeetingCreate](docs/MeetingCreate.md)
- [MeetingPartialUpdate](docs/MeetingPartialUpdate.md)
- [MeetingUpdate](docs/MeetingUpdate.md)
- [NotFoundError](docs/NotFoundError.md)
- [RootServer](docs/RootServer.md)
- [RootServerBase](docs/RootServerBase.md)
- [RootServerBaseStatistics](docs/RootServerBaseStatistics.md)
- [RootServerBaseStatisticsMeetings](docs/RootServerBaseStatisticsMeetings.md)
- [RootServerBaseStatisticsServiceBodies](docs/RootServerBaseStatisticsServiceBodies.md)
- [ServerError](docs/ServerError.md)
- [ServiceBody](docs/ServiceBody.md)
- [ServiceBodyBase](docs/ServiceBodyBase.md)
- [ServiceBodyCreate](docs/ServiceBodyCreate.md)
- [ServiceBodyPartialUpdate](docs/ServiceBodyPartialUpdate.md)
- [ServiceBodyUpdate](docs/ServiceBodyUpdate.md)
- [SettingsBase](docs/SettingsBase.md)
- [SettingsObject](docs/SettingsObject.md)
- [SettingsUpdate](docs/SettingsUpdate.md)
- [Token](docs/Token.md)
- [TokenCredentials](docs/TokenCredentials.md)
- [User](docs/User.md)
- [UserBase](docs/UserBase.md)
- [UserCreate](docs/UserCreate.md)
- [UserPartialUpdate](docs/UserPartialUpdate.md)
- [UserUpdate](docs/UserUpdate.md)
- [ValidationError](docs/ValidationError.md)

## Documentation For Authorization

Authentication schemes defined for the API:
### bmltToken

- **Type**: OAuth
- **Flow**: password
- **Authorization URL**:
- **Scopes**: N/A

Example

```go
auth := context.WithValue(context.Background(), bmlt.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)
```

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

```go
import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, bmlt.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)
```

## Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:

* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`

## Author