2019-02-08 05:15:45 -05:00
|
|
|
/*
|
|
|
|
* HyperOne API
|
|
|
|
*
|
|
|
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
|
|
*
|
|
|
|
* API version: 0.0.2
|
|
|
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
*/
|
|
|
|
|
|
|
|
package openapi
|
|
|
|
|
|
|
|
import (
|
2019-12-03 08:18:49 -05:00
|
|
|
_context "context"
|
2019-02-08 05:15:45 -05:00
|
|
|
"fmt"
|
|
|
|
"github.com/antihax/optional"
|
2019-12-03 08:18:49 -05:00
|
|
|
_ioutil "io/ioutil"
|
|
|
|
_nethttp "net/http"
|
|
|
|
_neturl "net/url"
|
|
|
|
"strings"
|
2019-02-08 05:15:45 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// Linger please
|
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
_ _context.Context
|
2019-02-08 05:15:45 -05:00
|
|
|
)
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
// ReservationApiService ReservationApi service
|
2019-02-08 05:15:45 -05:00
|
|
|
type ReservationApiService service
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationActionAssign /actions/assign
|
2019-02-08 05:15:45 -05:00
|
|
|
Action assign
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param reservationActionAssign
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationActionAssign(ctx _context.Context, reservationId string, reservationActionAssign ReservationActionAssign) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/actions/assign"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &reservationActionAssign
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
|
|
|
var v Reservation
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 202 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationActionExtend /actions/extend
|
2019-02-08 05:15:45 -05:00
|
|
|
Action extend
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationActionExtend(ctx _context.Context, reservationId string) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/actions/extend"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 202 {
|
|
|
|
var v Reservation
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationCreate Create
|
2019-02-08 05:15:45 -05:00
|
|
|
Create reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationCreate
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationCreate(ctx _context.Context, reservationCreate ReservationCreate) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation"
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &reservationCreate
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 202 {
|
|
|
|
var v Reservation
|
|
|
|
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
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationDelete Delete
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationDelete(ctx _context.Context, reservationId string) (*_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodDelete
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
return localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationDeleteAccessrightsIdentity /accessrights/:identity
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param identity identity
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationDeleteAccessrightsIdentity(ctx _context.Context, reservationId string, identity string) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodDelete
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/accessrights/{identity}"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"identity"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", identity)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 202 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationDeleteTagKey /tag/:key
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param key key
|
2019-12-03 08:18:49 -05:00
|
|
|
@return map[string]string
|
2019-02-08 05:15:45 -05:00
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationDeleteTagKey(ctx _context.Context, reservationId string, key string) (map[string]string, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodDelete
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarReturnValue map[string]string
|
2019-02-08 05:15:45 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/tag/{key}"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", key)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
|
|
|
var v map[string]string
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationGetServicesServiceId /services/:serviceId
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param serviceId serviceId
|
|
|
|
@return ReservationServices
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationGetServicesServiceId(ctx _context.Context, reservationId string, serviceId string) (ReservationServices, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue ReservationServices
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/services/{serviceId}"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", serviceId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v ReservationServices
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationGetTag /tag
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
@return map[string]string
|
2019-02-08 05:15:45 -05:00
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationGetTag(ctx _context.Context, reservationId string) (map[string]string, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarReturnValue map[string]string
|
2019-02-08 05:15:45 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/tag"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
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
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReservationListOpts Optional parameters for the method 'ReservationList'
|
|
|
|
type ReservationListOpts struct {
|
|
|
|
Name optional.String
|
|
|
|
Tag optional.Interface
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationList List
|
2019-02-08 05:15:45 -05:00
|
|
|
List reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param optional nil or *ReservationListOpts - Optional Parameters:
|
|
|
|
* @param "Name" (optional.String) - Filter by name
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param "Tag" (optional.Interface of map[string]string) - Filter by tag
|
2019-02-08 05:15:45 -05:00
|
|
|
@return []Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationList(ctx _context.Context, localVarOptionals *ReservationListOpts) ([]Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue []Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation"
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Name.IsSet() {
|
|
|
|
localVarQueryParams.Add("name", parameterToString(localVarOptionals.Name.Value(), ""))
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarOptionals != nil && localVarOptionals.Tag.IsSet() {
|
|
|
|
localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), ""))
|
|
|
|
}
|
2019-02-08 05:15:45 -05:00
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v []Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationListAccessrights /accessrights
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
@return []string
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationListAccessrights(ctx _context.Context, reservationId string) ([]string, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue []string
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/accessrights"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v []string
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReservationListQueueOpts Optional parameters for the method 'ReservationListQueue'
|
|
|
|
type ReservationListQueueOpts struct {
|
|
|
|
Limit optional.Float32
|
|
|
|
Skip optional.Float32
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationListQueue /queue
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param optional nil or *ReservationListQueueOpts - Optional Parameters:
|
|
|
|
* @param "Limit" (optional.Float32) - $limit
|
|
|
|
* @param "Skip" (optional.Float32) - $skip
|
2019-02-08 05:15:45 -05:00
|
|
|
@return []Event
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationListQueue(ctx _context.Context, reservationId string, localVarOptionals *ReservationListQueueOpts) ([]Event, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue []Event
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/queue"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
|
|
|
localVarQueryParams.Add("$limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
|
|
|
}
|
|
|
|
if localVarOptionals != nil && localVarOptionals.Skip.IsSet() {
|
|
|
|
localVarQueryParams.Add("$skip", parameterToString(localVarOptionals.Skip.Value(), ""))
|
|
|
|
}
|
2019-02-08 05:15:45 -05:00
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v []Event
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationListServices /services
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
@return []ReservationServices
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationListServices(ctx _context.Context, reservationId string) ([]ReservationServices, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue []ReservationServices
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/services"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v []ReservationServices
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationPatchTag /tag
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param requestBody
|
|
|
|
@return map[string]string
|
2019-02-08 05:15:45 -05:00
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationPatchTag(ctx _context.Context, reservationId string, requestBody map[string]string) (map[string]string, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodPatch
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarReturnValue map[string]string
|
2019-02-08 05:15:45 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/tag"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
// body params
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPostBody = &requestBody
|
2019-02-08 05:15:45 -05:00
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
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
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationPostAccessrights /accessrights
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param reservationPostAccessrights
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationPostAccessrights(ctx _context.Context, reservationId string, reservationPostAccessrights ReservationPostAccessrights) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodPost
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}/accessrights"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &reservationPostAccessrights
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
|
|
}
|
|
|
|
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: localVarHTTPResponse.Status,
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
|
|
|
var v Reservation
|
|
|
|
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 Reservation
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
ReservationPutTag /tag
|
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param requestBody
|
|
|
|
@return map[string]string
|
|
|
|
*/
|
|
|
|
func (a *ReservationApiService) ReservationPutTag(ctx _context.Context, reservationId 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 + "/reservation/{reservationId}/tag"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
|
|
|
|
|
|
|
// to determine the Content-Type header
|
|
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
|
|
|
|
|
|
|
// set Content-Type header
|
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
// to determine the Accept header
|
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
|
|
|
|
|
|
// set Accept header
|
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &requestBody
|
2019-02-08 05:15:45 -05:00
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHeaderParams["x-project"] = key
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
|
|
|
var v map[string]string
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationShow Get
|
2019-02-08 05:15:45 -05:00
|
|
|
Returns a single reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationShow(ctx _context.Context, reservationId string) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodGet
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-12-03 08:18:49 -05:00
|
|
|
ReservationUpdate Update
|
2019-02-08 05:15:45 -05:00
|
|
|
Returns modified reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
2019-02-08 05:15:45 -05:00
|
|
|
* @param reservationId ID of reservation
|
|
|
|
* @param reservationUpdate
|
|
|
|
@return Reservation
|
|
|
|
*/
|
2019-12-03 08:18:49 -05:00
|
|
|
func (a *ReservationApiService) ReservationUpdate(ctx _context.Context, reservationId string, reservationUpdate ReservationUpdate) (Reservation, *_nethttp.Response, error) {
|
2019-02-08 05:15:45 -05:00
|
|
|
var (
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPMethod = _nethttp.MethodPatch
|
2019-02-08 05:15:45 -05:00
|
|
|
localVarPostBody interface{}
|
|
|
|
localVarFormFileName string
|
|
|
|
localVarFileName string
|
|
|
|
localVarFileBytes []byte
|
|
|
|
localVarReturnValue Reservation
|
|
|
|
)
|
|
|
|
|
|
|
|
// create path and map variables
|
|
|
|
localVarPath := a.client.cfg.BasePath + "/reservation/{reservationId}"
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"reservationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", reservationId)), -1)
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarQueryParams := _neturl.Values{}
|
|
|
|
localVarFormParams := _neturl.Values{}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// to determine the Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentTypes := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Content-Type header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
2019-02-08 05:15:45 -05:00
|
|
|
|
|
|
|
// set Accept header
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
// body params
|
|
|
|
localVarPostBody = &reservationUpdate
|
|
|
|
if ctx != nil {
|
|
|
|
// API Key Authentication
|
|
|
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
|
|
|
var key string
|
|
|
|
if auth.Prefix != "" {
|
|
|
|
key = auth.Prefix + " " + auth.Key
|
|
|
|
} else {
|
|
|
|
key = auth.Key
|
|
|
|
}
|
|
|
|
localVarHeaderParams["x-project"] = key
|
|
|
|
}
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
return localVarReturnValue, nil, err
|
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
2019-02-08 05:15:45 -05:00
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
2019-12-03 08:18:49 -05:00
|
|
|
error: localVarHTTPResponse.Status,
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
if localVarHTTPResponse.StatusCode == 200 {
|
2019-02-08 05:15:45 -05:00
|
|
|
var v Reservation
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
newErr.model = v
|
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode == 400 {
|
|
|
|
var v InlineResponse400
|
|
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr.error = err.Error()
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
newErr.model = v
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
2019-02-08 05:15:45 -05:00
|
|
|
if err != nil {
|
|
|
|
newErr := GenericOpenAPIError{
|
|
|
|
body: localVarBody,
|
|
|
|
error: err.Error(),
|
|
|
|
}
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|
|
|
|
|
2019-12-03 08:18:49 -05:00
|
|
|
return localVarReturnValue, localVarHTTPResponse, nil
|
2019-02-08 05:15:45 -05:00
|
|
|
}
|