Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pierre-emmanuelJ/open-alldebrid

Alldebrid OpenAPI based Golang client wrapper
https://github.com/pierre-emmanuelJ/open-alldebrid

alldebrid alldebrid-api alldebrid-wrapper api api-client client golang golang-bindings golang-wrapper openapi openapi-spec openapi-specification openapi3

Last synced: 11 days ago
JSON representation

Alldebrid OpenAPI based Golang client wrapper

Awesome Lists containing this project

README

        

# Open Alldebrid

Alldebrid OpenAPI Golang wrapper

The Golang wrapper is generated from an [OpenAPI3 spec](./alldebrid.yaml) based on the official Alldebrid.com [Documentation](https://docs.alldebrid.com/#general-informations)

Open Alldebrid Swagger-ui [Visit here](https://pierre-emmanuelj.github.io/open-alldebrid/)

This [OpenAPI spec](./alldebrid.yaml) can be used to generate client library in other languages!

## Overview

This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.

- API version: 4.0.0
- Package version: 1.0.0

## Installation

Install the following dependencies:

```shell
go get "github.com/pierre-emmanuelJ/open-alldebrid"
```

Add the following import:

```golang
import "github.com/pierre-emmanuelJ/open-alldebrid/client"
```

## Examples

```Golang
package main

import (
"context"
"fmt"
"os"

"github.com/pierre-emmanuelJ/open-alldebrid/client"
)

func main() {
agent := "agent_example" // Your software user-agent. (default to "open-alldebrid")

configuration := client.NewConfiguration()
configuration.AddDefaultHeader("Authorization", "Bearer ApiKeyFromAlldebrid")
api_client := client.NewAPIClient(configuration)

resp, r, err := api_client.DefaultApi.UserGet(context.Background()).Agent(agent).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UserGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

fmt.Printf("%#v\n", resp)
}
```

Possible to add Bearer Token from context
```Golang
package main

import (
"context"
"fmt"
"os"

"github.com/pierre-emmanuelJ/open-alldebrid/client"
)

func main() {
agent := "agent_example" // Your software user-agent. (default to "open-alldebrid")
auth := context.WithValue(
context.Background(),
openapiclient.ContextAccessToken, "ApiKeyFromAlldebrid",
)

configuration := client.NewConfiguration()
api_client := client.NewAPIClient(configuration)

resp, r, err := api_client.DefaultApi.UserGet(auth).Agent(agent).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UserGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}

fmt.Printf("%#v\n", resp)
}
```

## Documentation for API Endpoints

Find all the API Documentation [here](./docs/DefaultApi.md)

Swagger UI [here](https://pierre-emmanuelj.github.io/open-alldebrid/)

You can execute HTTP request from the UI with your [Alldebrid ApiKey](https://alldebrid.com/apikeys/)

## Documentation For Authorization

### bearerAuth

- **Type**: HTTP Bearer token authentication

Example

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ApiKeyFromAlldebrid")

configuration := client.NewConfiguration()
api_client := client.NewAPIClient(configuration)

resp, r, err := api_client.DefaultApi.UserGet(auth).Agent(agent).Execute()
```

## Powered by

* [openapi-generator](https://github.com/OpenAPITools/openapi-generator)