3223 lines
108 KiB
Go
3223 lines
108 KiB
Go
|
/*
|
||
|
* 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"
|
||
|
"fmt"
|
||
|
"github.com/antihax/optional"
|
||
|
_ioutil "io/ioutil"
|
||
|
_nethttp "net/http"
|
||
|
_neturl "net/url"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// Linger please
|
||
|
var (
|
||
|
_ _context.Context
|
||
|
)
|
||
|
|
||
|
// JournalApiService JournalApi service
|
||
|
type JournalApiService service
|
||
|
|
||
|
/*
|
||
|
JournalActionTransfer /actions/transfer
|
||
|
Action transfer
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param journalActionTransfer
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalActionTransfer(ctx _context.Context, journalId string, journalActionTransfer JournalActionTransfer) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/actions/transfer"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalActionTransfer
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalActionUpdateRetention /actions/update_retention
|
||
|
Action update_retention
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param journalActionUpdateRetention
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalActionUpdateRetention(ctx _context.Context, journalId string, journalActionUpdateRetention JournalActionUpdateRetention) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/actions/update_retention"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalActionUpdateRetention
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalCreate Create
|
||
|
Create journal
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalCreate
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalCreate(ctx _context.Context, journalCreate JournalCreate) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal"
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalCreate
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalDelete Delete
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalDelete(ctx _context.Context, journalId string) (*_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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 nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
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
|
||
|
}
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalDeleteAccessrightsIdentity /accessrights/:identity
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param identity identity
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalDeleteAccessrightsIdentity(ctx _context.Context, journalId string, identity string) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/accessrights/{identity}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"identity"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", identity)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalDeleteCredentialId /credential/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param id id
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalDeleteCredentialId(ctx _context.Context, journalId string, id string) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/credential/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalDeleteCredentialpasswordId /credential/password/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param id id
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalDeleteCredentialpasswordId(ctx _context.Context, journalId string, id string) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/credential/password/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalDeleteTagKey /tag/:key
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param key key
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalDeleteTagKey(ctx _context.Context, journalId string, key string) (map[string]string, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue map[string]string
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/tag/{key}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", key)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalGetCredentialId /credential/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param id id
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalGetCredentialId(ctx _context.Context, journalId 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 + "/journal/{journalId}/credential/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalGetCredentialpasswordId /credential/password/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param id id
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalGetCredentialpasswordId(ctx _context.Context, journalId 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 + "/journal/{journalId}/credential/password/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// JournalGetLogOpts Optional parameters for the method 'JournalGetLog'
|
||
|
type JournalGetLogOpts struct {
|
||
|
Since optional.Time
|
||
|
Until optional.Time
|
||
|
Follow optional.Bool
|
||
|
Tail optional.Float32
|
||
|
Tag optional.Interface
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalGetLog /log
|
||
|
websocket is also supported
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param optional nil or *JournalGetLogOpts - Optional Parameters:
|
||
|
* @param "Since" (optional.Time) - since
|
||
|
* @param "Until" (optional.Time) - until
|
||
|
* @param "Follow" (optional.Bool) - follow
|
||
|
* @param "Tail" (optional.Float32) - tail
|
||
|
* @param "Tag" (optional.Interface of map[string]string) - tag
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalGetLog(ctx _context.Context, journalId string, localVarOptionals *JournalGetLogOpts) (*_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/log"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
if localVarOptionals != nil && localVarOptionals.Since.IsSet() {
|
||
|
localVarQueryParams.Add("since", parameterToString(localVarOptionals.Since.Value(), ""))
|
||
|
}
|
||
|
if localVarOptionals != nil && localVarOptionals.Until.IsSet() {
|
||
|
localVarQueryParams.Add("until", parameterToString(localVarOptionals.Until.Value(), ""))
|
||
|
}
|
||
|
if localVarOptionals != nil && localVarOptionals.Follow.IsSet() {
|
||
|
localVarQueryParams.Add("follow", parameterToString(localVarOptionals.Follow.Value(), ""))
|
||
|
}
|
||
|
if localVarOptionals != nil && localVarOptionals.Tail.IsSet() {
|
||
|
localVarQueryParams.Add("tail", parameterToString(localVarOptionals.Tail.Value(), ""))
|
||
|
}
|
||
|
if localVarOptionals != nil && localVarOptionals.Tag.IsSet() {
|
||
|
localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), ""))
|
||
|
}
|
||
|
// 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
|
||
|
}
|
||
|
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 nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
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
|
||
|
}
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalGetServicesServiceId /services/:serviceId
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param serviceId serviceId
|
||
|
@return JournalServices
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalGetServicesServiceId(ctx _context.Context, journalId string, serviceId string) (JournalServices, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue JournalServices
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/services/{serviceId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", serviceId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 JournalServices
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalGetTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalGetTag(ctx _context.Context, journalId string) (map[string]string, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue map[string]string
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// JournalListOpts Optional parameters for the method 'JournalList'
|
||
|
type JournalListOpts struct {
|
||
|
Name optional.String
|
||
|
Tag optional.Interface
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalList List
|
||
|
List journal
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param optional nil or *JournalListOpts - Optional Parameters:
|
||
|
* @param "Name" (optional.String) - Filter by name
|
||
|
* @param "Tag" (optional.Interface of map[string]string) - Filter by tag
|
||
|
@return []Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalList(ctx _context.Context, localVarOptionals *JournalListOpts) ([]Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal"
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
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(), ""))
|
||
|
}
|
||
|
// 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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 []Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalListAccessrights /accessrights
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
@return []string
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalListAccessrights(ctx _context.Context, journalId string) ([]string, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []string
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/accessrights"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalListCredential /credential
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
@return []CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalListCredential(ctx _context.Context, journalId 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 + "/journal/{journalId}/credential"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalListCredentialpassword /credential/password
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
@return []CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalListCredentialpassword(ctx _context.Context, journalId 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 + "/journal/{journalId}/credential/password"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
// JournalListQueueOpts Optional parameters for the method 'JournalListQueue'
|
||
|
type JournalListQueueOpts struct {
|
||
|
Limit optional.Float32
|
||
|
Skip optional.Float32
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalListQueue /queue
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param optional nil or *JournalListQueueOpts - Optional Parameters:
|
||
|
* @param "Limit" (optional.Float32) - $limit
|
||
|
* @param "Skip" (optional.Float32) - $skip
|
||
|
@return []Event
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalListQueue(ctx _context.Context, journalId string, localVarOptionals *JournalListQueueOpts) ([]Event, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []Event
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/queue"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
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(), ""))
|
||
|
}
|
||
|
// 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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 []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"))
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalListServices /services
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
@return []JournalServices
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalListServices(ctx _context.Context, journalId string) ([]JournalServices, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []JournalServices
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/services"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 []JournalServices
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPatchCredentialId /credential/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param id id
|
||
|
* @param journalPatchCredentialId
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPatchCredentialId(ctx _context.Context, journalId string, id string, journalPatchCredentialId JournalPatchCredentialId) (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 + "/journal/{journalId}/credential/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalPatchCredentialId
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPatchCredentialpasswordId /credential/password/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param id id
|
||
|
* @param journalPatchCredentialpasswordId
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPatchCredentialpasswordId(ctx _context.Context, journalId string, id string, journalPatchCredentialpasswordId JournalPatchCredentialpasswordId) (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 + "/journal/{journalId}/credential/password/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalPatchCredentialpasswordId
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPatchTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param requestBody
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPatchTag(ctx _context.Context, journalId 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 + "/journal/{journalId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &requestBody
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPostAccessrights /accessrights
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param journalPostAccessrights
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPostAccessrights(ctx _context.Context, journalId string, journalPostAccessrights JournalPostAccessrights) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/accessrights"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalPostAccessrights
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPostCredential /credential
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param journalPostCredential
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPostCredential(ctx _context.Context, journalId string, journalPostCredential JournalPostCredential) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/credential"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalPostCredential
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPostCredentialpassword /credential/password
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param journalPostCredentialpassword
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPostCredentialpassword(ctx _context.Context, journalId string, journalPostCredentialpassword JournalPostCredentialpassword) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}/credential/password"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalPostCredentialpassword
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalPutTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param requestBody
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalPutTag(ctx _context.Context, journalId 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 + "/journal/{journalId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &requestBody
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalShow Get
|
||
|
Returns a single journal
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalShow(ctx _context.Context, journalId string) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
JournalUpdate Update
|
||
|
Returns modified journal
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param journalId ID of journal
|
||
|
* @param journalUpdate
|
||
|
@return Journal
|
||
|
*/
|
||
|
func (a *JournalApiService) JournalUpdate(ctx _context.Context, journalId string, journalUpdate JournalUpdate) (Journal, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Journal
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/journal/{journalId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"journalId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", journalId)), -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
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &journalUpdate
|
||
|
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
|
||
|
}
|
||
|
|
||
|
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 Journal
|
||
|
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
|
||
|
}
|