2019-02-08 05:15:45 -05:00
|
|
|
/*
|
|
|
|
* HyperOne API
|
|
|
|
*
|
|
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
|
|
*
|
|
|
|
* API version: 0.0.2
|
|
|
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
*/
|
|
|
|
|
|
|
|
package openapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
// contextKeys are used to identify the type of value in the context.
|
|
|
|
// Since these are string, it is possible to get a short description of the
|
|
|
|
// context key for logging and debugging using key.String().
|
|
|
|
|
|
|
|
type contextKey string
|
|
|
|
|
|
|
|
func (c contextKey) String() string {
|
|
|
|
return "auth " + string(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
|
|
|
|
ContextOAuth2 = contextKey("token")
|
|
|
|
|
|
|
|
// ContextBasicAuth takes BasicAuth as authentication for the request.
|
|
|
|
ContextBasicAuth = contextKey("basic")
|
|
|
|
|
|
|
|
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
|
|
|
|
ContextAccessToken = contextKey("accesstoken")
|
|
|
|
|
|
|
|
// ContextAPIKey takes an APIKey as authentication for the request
|
|
|
|
ContextAPIKey = contextKey("apikey")
|
|
|
|
)
|
|
|
|
|
|
|
|
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
|
|
|
type BasicAuth struct {
|
|
|
|
UserName string `json:"userName,omitempty"`
|
|
|
|
Password string `json:"password,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
|
|
|
|
type APIKey struct {
|
|
|
|
Key string
|
|
|
|
Prefix string
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
// Configuration stores the configuration of the API client
|
2019-02-08 05:15:45 -05:00
|
|
|
type Configuration struct {
|
|
|
|
BasePath string `json:"basePath,omitempty"`
|
|
|
|
Host string `json:"host,omitempty"`
|
|
|
|
Scheme string `json:"scheme,omitempty"`
|
|
|
|
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
|
|
|
UserAgent string `json:"userAgent,omitempty"`
|
2019-12-03 08:18:49 -05:00
|
|
|
Debug bool `json:"debug,omitempty"`
|
2019-02-08 05:15:45 -05:00
|
|
|
HTTPClient *http.Client
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
// NewConfiguration returns a new Configuration object
|
2019-02-08 05:15:45 -05:00
|
|
|
func NewConfiguration() *Configuration {
|
|
|
|
cfg := &Configuration{
|
|
|
|
BasePath: "https://api.hyperone.com/v1",
|
|
|
|
DefaultHeader: make(map[string]string),
|
|
|
|
UserAgent: "OpenAPI-Generator/1.0.0/go",
|
2019-12-03 08:18:49 -05:00
|
|
|
Debug: false,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
return cfg
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
// AddDefaultHeader adds a new HTTP header to the default header in the request
|
2019-02-08 05:15:45 -05:00
|
|
|
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
|
|
|
c.DefaultHeader[key] = value
|
|
|
|
}
|