GithubHelp home page GithubHelp logo

pierre-emmanuelj / open-alldebrid Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 3.21 MB

Alldebrid OpenAPI based Golang client wrapper

Home Page: https://pierre-emmanuelj.github.io/open-alldebrid/

License: GNU General Public License v3.0

Shell 14.39% HTML 85.61%
golang openapi openapi3 openapi-specification openapi-spec client api-client api golang-bindings alldebrid

open-alldebrid's Introduction

Open Alldebrid

Alldebrid OpenAPI Golang wrapper

The Golang wrapper is generated from an OpenAPI3 spec based on the official Alldebrid.com Documentation

Open Alldebrid Swagger-ui Visit here

This OpenAPI spec can be used to generate client library in other languages!

Overview

This API client was generated by the OpenAPI Generator project.

  • API version: 4.0.0
  • Package version: 1.0.0

Installation

Install the following dependencies:

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

Add the following import:

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

Examples

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

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

Swagger UI here

You can execute HTTP request from the UI with your Alldebrid ApiKey

Documentation For Authorization

bearerAuth

  • Type: HTTP Bearer token authentication

Example

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

open-alldebrid's People

Contributors

pierre-emmanuelj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

alldebrid pix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.