packer-cn/vendor/github.com/hyperonecom/h1-client-go/api_vault.go

3904 lines
130 KiB
Go
Raw Normal View History

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 (
_context "context"
2019-02-08 05:15:45 -05:00
"fmt"
"github.com/antihax/optional"
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"strings"
2019-02-08 05:15:45 -05:00
)
// Linger please
var (
_ _context.Context
2019-02-08 05:15:45 -05:00
)
// VaultApiService VaultApi service
2019-02-08 05:15:45 -05:00
type VaultApiService service
/*
VaultActionResize /actions/resize
2019-02-08 05:15:45 -05:00
Action resize
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultActionResize
@return Vault
*/
func (a *VaultApiService) VaultActionResize(ctx _context.Context, vaultId string, vaultActionResize VaultActionResize) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/actions/resize"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultActionResize
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultActionSnapshot /actions/snapshot
2019-02-08 05:15:45 -05:00
Action snapshot
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultActionSnapshot
@return Vault
*/
func (a *VaultApiService) VaultActionSnapshot(ctx _context.Context, vaultId string, vaultActionSnapshot VaultActionSnapshot) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/actions/snapshot"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultActionSnapshot
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultActionStart /actions/start
2019-02-08 05:15:45 -05:00
Action start
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return Vault
*/
func (a *VaultApiService) VaultActionStart(ctx _context.Context, vaultId string) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/actions/start"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultActionStop /actions/stop
2019-02-08 05:15:45 -05:00
Action stop
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return Vault
*/
func (a *VaultApiService) VaultActionStop(ctx _context.Context, vaultId string) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/actions/stop"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultCreate Create
2019-02-08 05:15:45 -05:00
Create vault
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultCreate
@return Vault
*/
func (a *VaultApiService) VaultCreate(ctx _context.Context, vaultCreate VaultCreate) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultCreate
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultDelete Delete
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultDelete
*/
func (a *VaultApiService) VaultDelete(ctx _context.Context, vaultId string, vaultDelete VaultDelete) (*_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultDelete
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.model = v
return localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultDeleteAccessrightsIdentity /accessrights/:identity
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param identity identity
@return Vault
*/
func (a *VaultApiService) VaultDeleteAccessrightsIdentity(ctx _context.Context, vaultId string, identity string) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/accessrights/{identity}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"identity"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", identity)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultDeleteCredentialId /credential/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param id id
@return Vault
*/
func (a *VaultApiService) VaultDeleteCredentialId(ctx _context.Context, vaultId string, id string) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 202 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
VaultDeleteCredentialcertificateId /credential/certificate/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vaultId ID of vault
* @param id id
@return InlineResponse2003
*/
func (a *VaultApiService) VaultDeleteCredentialcertificateId(ctx _context.Context, vaultId string, id string) (InlineResponse2003, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue InlineResponse2003
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/certificate/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v InlineResponse2003
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultDeleteCredentialpasswordId /credential/password/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param id id
@return Vault
*/
func (a *VaultApiService) VaultDeleteCredentialpasswordId(ctx _context.Context, vaultId string, id string) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/password/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultDeleteTagKey /tag/:key
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param key key
@return map[string]string
2019-02-08 05:15:45 -05:00
*/
func (a *VaultApiService) VaultDeleteTagKey(ctx _context.Context, vaultId string, key string) (map[string]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/tag/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", key)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
VaultGetCredentialId /credential/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vaultId ID of vault
* @param id id
@return CredentialPassword
*/
func (a *VaultApiService) VaultGetCredentialId(ctx _context.Context, vaultId string, id string) (CredentialPassword, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultGetCredentialcertificateId /credential/certificate/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param id id
@return CredentialCertificate
*/
func (a *VaultApiService) VaultGetCredentialcertificateId(ctx _context.Context, vaultId string, id string) (CredentialCertificate, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialCertificate
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/certificate/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v CredentialCertificate
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultGetCredentialpasswordId /credential/password/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param id id
@return CredentialPassword
*/
func (a *VaultApiService) VaultGetCredentialpasswordId(ctx _context.Context, vaultId string, id string) (CredentialPassword, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/password/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultGetServicesServiceId /services/:serviceId
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param serviceId serviceId
@return VaultServices
*/
func (a *VaultApiService) VaultGetServicesServiceId(ctx _context.Context, vaultId string, serviceId string) (VaultServices, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue VaultServices
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/services/{serviceId}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", serviceId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v VaultServices
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultGetTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return map[string]string
2019-02-08 05:15:45 -05:00
*/
func (a *VaultApiService) VaultGetTag(ctx _context.Context, vaultId string) (map[string]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// VaultListOpts Optional parameters for the method 'VaultList'
type VaultListOpts struct {
Name optional.String
Tag optional.Interface
2019-02-08 05:15:45 -05:00
}
/*
VaultList List
2019-02-08 05:15:45 -05:00
List vault
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param optional nil or *VaultListOpts - Optional Parameters:
* @param "Name" (optional.String) - Filter by name
* @param "Tag" (optional.Interface of map[string]string) - Filter by tag
2019-02-08 05:15:45 -05:00
@return []Vault
*/
func (a *VaultApiService) VaultList(ctx _context.Context, localVarOptionals *VaultListOpts) ([]Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
if localVarOptionals != nil && localVarOptionals.Name.IsSet() {
localVarQueryParams.Add("name", parameterToString(localVarOptionals.Name.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Tag.IsSet() {
localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), ""))
}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultListAccessrights /accessrights
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return []string
*/
func (a *VaultApiService) VaultListAccessrights(ctx _context.Context, vaultId string) ([]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []string
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v []string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
VaultListCredential /credential
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vaultId ID of vault
@return []CredentialPassword
*/
func (a *VaultApiService) VaultListCredential(ctx _context.Context, vaultId string) ([]CredentialPassword, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v []CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultListCredentialcertificate /credential/certificate
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return []CredentialCertificate
*/
func (a *VaultApiService) VaultListCredentialcertificate(ctx _context.Context, vaultId string) ([]CredentialCertificate, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []CredentialCertificate
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/certificate"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []CredentialCertificate
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultListCredentialpassword /credential/password
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return []CredentialPassword
*/
func (a *VaultApiService) VaultListCredentialpassword(ctx _context.Context, vaultId string) ([]CredentialPassword, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/password"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// VaultListQueueOpts Optional parameters for the method 'VaultListQueue'
type VaultListQueueOpts struct {
Limit optional.Float32
Skip optional.Float32
2019-02-08 05:15:45 -05:00
}
/*
VaultListQueue /queue
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param optional nil or *VaultListQueueOpts - Optional Parameters:
* @param "Limit" (optional.Float32) - $limit
* @param "Skip" (optional.Float32) - $skip
2019-02-08 05:15:45 -05:00
@return []Event
*/
func (a *VaultApiService) VaultListQueue(ctx _context.Context, vaultId string, localVarOptionals *VaultListQueueOpts) ([]Event, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Event
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/queue"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("$limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Skip.IsSet() {
localVarQueryParams.Add("$skip", parameterToString(localVarOptionals.Skip.Value(), ""))
}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []Event
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultListServices /services
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return []VaultServices
*/
func (a *VaultApiService) VaultListServices(ctx _context.Context, vaultId string) ([]VaultServices, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []VaultServices
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/services"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v []VaultServices
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
VaultPatchCredentialId /credential/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vaultId ID of vault
* @param id id
* @param vaultPatchCredentialId
@return CredentialPassword
*/
func (a *VaultApiService) VaultPatchCredentialId(ctx _context.Context, vaultId string, id string, vaultPatchCredentialId VaultPatchCredentialId) (CredentialPassword, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &vaultPatchCredentialId
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultPatchCredentialcertificateId /credential/certificate/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param id id
* @param vaultPatchCredentialcertificateId
@return CredentialCertificate
*/
func (a *VaultApiService) VaultPatchCredentialcertificateId(ctx _context.Context, vaultId string, id string, vaultPatchCredentialcertificateId VaultPatchCredentialcertificateId) (CredentialCertificate, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPatch
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialCertificate
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/certificate/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultPatchCredentialcertificateId
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v CredentialCertificate
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultPatchCredentialpasswordId /credential/password/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param id id
* @param vaultPatchCredentialpasswordId
@return CredentialPassword
*/
func (a *VaultApiService) VaultPatchCredentialpasswordId(ctx _context.Context, vaultId string, id string, vaultPatchCredentialpasswordId VaultPatchCredentialpasswordId) (CredentialPassword, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPatch
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/password/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultPatchCredentialpasswordId
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
VaultPatchTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vaultId ID of vault
* @param requestBody
@return map[string]string
*/
func (a *VaultApiService) VaultPatchTag(ctx _context.Context, vaultId string, requestBody map[string]string) (map[string]string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &requestBody
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultPostAccessrights /accessrights
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultPostAccessrights
@return Vault
2019-02-08 05:15:45 -05:00
*/
func (a *VaultApiService) VaultPostAccessrights(ctx _context.Context, vaultId string, vaultPostAccessrights VaultPostAccessrights) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultPostAccessrights
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 202 {
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultPostCredential /credential
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultPostCredential
@return CredentialPassword
2019-02-08 05:15:45 -05:00
*/
func (a *VaultApiService) VaultPostCredential(ctx _context.Context, vaultId string, vaultPostCredential VaultPostCredential) (CredentialPassword, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialPassword
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultPostCredential
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultPostCredentialcertificate /credential/certificate
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultPostCredentialcertificate
@return CredentialCertificate
*/
func (a *VaultApiService) VaultPostCredentialcertificate(ctx _context.Context, vaultId string, vaultPostCredentialcertificate VaultPostCredentialcertificate) (CredentialCertificate, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialCertificate
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/certificate"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultPostCredentialcertificate
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v CredentialCertificate
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultPostCredentialpassword /credential/password
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultPostCredentialpassword
@return CredentialPassword
*/
func (a *VaultApiService) VaultPostCredentialpassword(ctx _context.Context, vaultId string, vaultPostCredentialpassword VaultPostCredentialpassword) (CredentialPassword, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CredentialPassword
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/credential/password"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultPostCredentialpassword
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v CredentialPassword
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
VaultPutTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vaultId ID of vault
* @param requestBody
@return map[string]string
*/
func (a *VaultApiService) VaultPutTag(ctx _context.Context, vaultId string, requestBody map[string]string) (map[string]string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPut
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &requestBody
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultShow Get
2019-02-08 05:15:45 -05:00
Returns a single vault
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
@return Vault
*/
func (a *VaultApiService) VaultShow(ctx _context.Context, vaultId string) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
VaultUpdate Update
2019-02-08 05:15:45 -05:00
Returns modified vault
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param vaultId ID of vault
* @param vaultUpdate
@return Vault
*/
func (a *VaultApiService) VaultUpdate(ctx _context.Context, vaultId string, vaultUpdate VaultUpdate) (Vault, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPatch
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Vault
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/vault/{vaultId}"
localVarPath = strings.Replace(localVarPath, "{"+"vaultId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", vaultId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &vaultUpdate
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Vault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}