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

1749 lines
59 KiB
Go
Raw Normal View History

2019-02-08 05:15:45 -05:00
/*
* HyperOne API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 0.0.2
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
_context "context"
2019-02-08 05:15:45 -05:00
"fmt"
"github.com/antihax/optional"
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"strings"
2019-02-08 05:15:45 -05:00
)
// Linger please
var (
_ _context.Context
2019-02-08 05:15:45 -05:00
)
// OrganisationApiService OrganisationApi service
2019-02-08 05:15:45 -05:00
type OrganisationApiService service
/*
OrganisationActionPaymentAssign /actions/payment_assign
Action payment_assign
* @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 organisationId ID of organisation
* @param organisationActionPaymentAssign
2019-02-08 05:15:45 -05:00
@return Organisation
*/
func (a *OrganisationApiService) OrganisationActionPaymentAssign(ctx _context.Context, organisationId string, organisationActionPaymentAssign OrganisationActionPaymentAssign) (Organisation, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Organisation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/actions/payment_assign"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &organisationActionPaymentAssign
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationActionTransferAccept /actions/transfer_accept
Action transfer_accept
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param organisationId ID of organisation
* @param organisationActionTransferAccept
2019-02-08 05:15:45 -05:00
@return Organisation
*/
func (a *OrganisationApiService) OrganisationActionTransferAccept(ctx _context.Context, organisationId string, organisationActionTransferAccept OrganisationActionTransferAccept) (Organisation, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Organisation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/actions/transfer_accept"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &organisationActionTransferAccept
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationCreate Create
Create organisation
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param organisationCreate
2019-02-08 05:15:45 -05:00
@return Organisation
*/
func (a *OrganisationApiService) OrganisationCreate(ctx _context.Context, organisationCreate OrganisationCreate) (Organisation, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Organisation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation"
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &organisationCreate
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationDeleteAccessrightsId /accessrights/:id
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param organisationId ID of organisation
* @param id id
2019-02-08 05:15:45 -05:00
*/
func (a *OrganisationApiService) OrganisationDeleteAccessrightsId(ctx _context.Context, organisationId string, id string) (*_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/accessrights/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
/*
OrganisationDeleteTagKey /tag/:key
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param organisationId ID of organisation
* @param key key
@return map[string]string
*/
func (a *OrganisationApiService) OrganisationDeleteTagKey(ctx _context.Context, organisationId string, key string) (map[string]string, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodDelete
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/tag/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", key)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v 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
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationGetTag /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 organisationId ID of organisation
@return map[string]string
2019-02-08 05:15:45 -05:00
*/
func (a *OrganisationApiService) OrganisationGetTag(ctx _context.Context, organisationId string) (map[string]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v 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
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// OrganisationListOpts Optional parameters for the method 'OrganisationList'
type OrganisationListOpts struct {
Name optional.String
BillingCompany optional.String
Limit optional.Float32
Active optional.Bool
AccessRightsId optional.String
Tag optional.Interface
2019-02-08 05:15:45 -05:00
}
/*
OrganisationList List
2019-02-08 05:15:45 -05:00
List organisation
* @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 *OrganisationListOpts - Optional Parameters:
* @param "Name" (optional.String) - Filter by name
* @param "BillingCompany" (optional.String) - Filter by billing.company
* @param "Limit" (optional.Float32) - Filter by $limit
* @param "Active" (optional.Bool) - Filter by active
* @param "AccessRightsId" (optional.String) - Filter by accessRights.id
* @param "Tag" (optional.Interface of map[string]string) - Filter by tag
2019-02-08 05:15:45 -05:00
@return []Organisation
*/
func (a *OrganisationApiService) OrganisationList(ctx _context.Context, localVarOptionals *OrganisationListOpts) ([]Organisation, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Organisation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
if localVarOptionals != nil && localVarOptionals.Name.IsSet() {
localVarQueryParams.Add("name", parameterToString(localVarOptionals.Name.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.BillingCompany.IsSet() {
localVarQueryParams.Add("billing.company", parameterToString(localVarOptionals.BillingCompany.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("$limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Active.IsSet() {
localVarQueryParams.Add("active", parameterToString(localVarOptionals.Active.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.AccessRightsId.IsSet() {
localVarQueryParams.Add("accessRights.id", parameterToString(localVarOptionals.AccessRightsId.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Tag.IsSet() {
localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), ""))
}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationListAccessrights /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 organisationId ID of organisation
@return []AccessrightsUserRole
*/
func (a *OrganisationApiService) OrganisationListAccessrights(ctx _context.Context, organisationId string) ([]AccessrightsUserRole, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []AccessrightsUserRole
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v []AccessrightsUserRole
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// OrganisationListBillingOpts Optional parameters for the method 'OrganisationListBilling'
type OrganisationListBillingOpts struct {
Start optional.Time
End optional.Time
ResourceType optional.String
}
/*
OrganisationListBilling /billing
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param organisationId ID of organisation
* @param optional nil or *OrganisationListBillingOpts - Optional Parameters:
* @param "Start" (optional.Time) - start
* @param "End" (optional.Time) - end
* @param "ResourceType" (optional.String) - resource.type
@return []Billing
*/
func (a *OrganisationApiService) OrganisationListBilling(ctx _context.Context, organisationId string, localVarOptionals *OrganisationListBillingOpts) ([]Billing, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Billing
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/billing"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
if localVarOptionals != nil && localVarOptionals.Start.IsSet() {
localVarQueryParams.Add("start", parameterToString(localVarOptionals.Start.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.End.IsSet() {
localVarQueryParams.Add("end", parameterToString(localVarOptionals.End.Value(), ""))
2019-02-08 05:15:45 -05:00
}
if localVarOptionals != nil && localVarOptionals.ResourceType.IsSet() {
localVarQueryParams.Add("resource.type", parameterToString(localVarOptionals.ResourceType.Value(), ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v []Billing
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// OrganisationListQueueOpts Optional parameters for the method 'OrganisationListQueue'
type OrganisationListQueueOpts struct {
Limit optional.Float32
Skip optional.Float32
2019-02-08 05:15:45 -05:00
}
/*
OrganisationListQueue /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 organisationId ID of organisation
* @param optional nil or *OrganisationListQueueOpts - Optional Parameters:
* @param "Limit" (optional.Float32) - $limit
* @param "Skip" (optional.Float32) - $skip
2019-02-08 05:15:45 -05:00
@return []Event
*/
func (a *OrganisationApiService) OrganisationListQueue(ctx _context.Context, organisationId string, localVarOptionals *OrganisationListQueueOpts) ([]Event, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Event
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/queue"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("$limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Skip.IsSet() {
localVarQueryParams.Add("$skip", parameterToString(localVarOptionals.Skip.Value(), ""))
}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []Event
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationPatchTag /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 organisationId ID of organisation
* @param requestBody
@return map[string]string
2019-02-08 05:15:45 -05:00
*/
func (a *OrganisationApiService) OrganisationPatchTag(ctx _context.Context, organisationId string, requestBody map[string]string) (map[string]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPatch
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &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
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v 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
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationPostAccessrights /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 organisationId ID of organisation
* @param organisationPostAccessrights
*/
func (a *OrganisationApiService) OrganisationPostAccessrights(ctx _context.Context, organisationId string, organisationPostAccessrights OrganisationPostAccessrights) (*_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &organisationPostAccessrights
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
/*
OrganisationPutTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param organisationId ID of organisation
* @param requestBody
@return map[string]string
*/
func (a *OrganisationApiService) OrganisationPutTag(ctx _context.Context, organisationId 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 + "/organisation/{organisationId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = &requestBody
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationShow Get
2019-02-08 05:15:45 -05:00
Returns a single organisation
* @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 organisationId ID of organisation
@return Organisation
*/
func (a *OrganisationApiService) OrganisationShow(ctx _context.Context, organisationId string) (Organisation, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Organisation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
OrganisationUpdate Update
2019-02-08 05:15:45 -05:00
Returns modified organisation
* @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 organisationId ID of organisation
* @param organisationUpdate
@return Organisation
*/
func (a *OrganisationApiService) OrganisationUpdate(ctx _context.Context, organisationId string, organisationUpdate OrganisationUpdate) (Organisation, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPatch
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Organisation
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/organisation/{organisationId}"
localVarPath = strings.Replace(localVarPath, "{"+"organisationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", organisationId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &organisationUpdate
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Organisation
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}