3205 lines
107 KiB
Go
3205 lines
107 KiB
Go
|
/*
|
||
|
* HyperOne API
|
||
|
*
|
||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||
|
*
|
||
|
* API version: 0.0.2
|
||
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||
|
*/
|
||
|
|
||
|
package openapi
|
||
|
|
||
|
import (
|
||
|
_context "context"
|
||
|
"fmt"
|
||
|
_ioutil "io/ioutil"
|
||
|
_nethttp "net/http"
|
||
|
_neturl "net/url"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// Linger please
|
||
|
var (
|
||
|
_ _context.Context
|
||
|
)
|
||
|
|
||
|
// UserApiService UserApi service
|
||
|
type UserApiService service
|
||
|
|
||
|
/*
|
||
|
UserDeleteCredentialId /credential/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
@return User
|
||
|
*/
|
||
|
func (a *UserApiService) UserDeleteCredentialId(ctx _context.Context, userId string, id string) (User, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue User
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v User
|
||
|
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 User
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserDeleteCredentialauthtokenId /credential/authtoken/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param invitationId invitationId
|
||
|
*/
|
||
|
func (a *UserApiService) UserDeleteCredentialauthtokenId(ctx _context.Context, userId string, invitationId string) (*_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/authtoken/:id"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"invitationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", invitationId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserDeleteCredentialcertificateId /credential/certificate/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
@return InlineResponse2001
|
||
|
*/
|
||
|
func (a *UserApiService) UserDeleteCredentialcertificateId(ctx _context.Context, userId string, id string) (InlineResponse2001, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue InlineResponse2001
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/certificate/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v InlineResponse2001
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserDeleteCredentialpasswordId /credential/password/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
@return User
|
||
|
*/
|
||
|
func (a *UserApiService) UserDeleteCredentialpasswordId(ctx _context.Context, userId string, id string) (User, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue User
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/password/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v User
|
||
|
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 User
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserDeleteTagKey /tag/:key
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param key key
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *UserApiService) UserDeleteTagKey(ctx _context.Context, userId 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 + "/user/{userId}/tag/{key}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"key"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", key)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v map[string]string
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserGetCredentialId /credential/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserGetCredentialId(ctx _context.Context, userId string, id string) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserGetCredentialauthtokenId /credential/authtoken/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param invitationId invitationId
|
||
|
@return AuthToken
|
||
|
*/
|
||
|
func (a *UserApiService) UserGetCredentialauthtokenId(ctx _context.Context, userId string, invitationId string) (AuthToken, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue AuthToken
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/authtoken/:id"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"invitationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", invitationId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v AuthToken
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserGetCredentialcertificateId /credential/certificate/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
@return CredentialCertificate
|
||
|
*/
|
||
|
func (a *UserApiService) UserGetCredentialcertificateId(ctx _context.Context, userId string, id string) (CredentialCertificate, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialCertificate
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/certificate/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialCertificate
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserGetCredentialpasswordId /credential/password/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserGetCredentialpasswordId(ctx _context.Context, userId string, id string) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/password/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserGetServicesServiceId /services/:serviceId
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param serviceId serviceId
|
||
|
@return UserServices
|
||
|
*/
|
||
|
func (a *UserApiService) UserGetServicesServiceId(ctx _context.Context, userId string, serviceId string) (UserServices, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue UserServices
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/services/{serviceId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", serviceId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v UserServices
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserGetTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *UserApiService) UserGetTag(ctx _context.Context, userId string) (map[string]string, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue map[string]string
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v map[string]string
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserListCredential /credential
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return []CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserListCredential(ctx _context.Context, userId string) ([]CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserListCredentialauthtoken /credential/authtoken
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return []AuthToken
|
||
|
*/
|
||
|
func (a *UserApiService) UserListCredentialauthtoken(ctx _context.Context, userId string) ([]AuthToken, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []AuthToken
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/authtoken"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []AuthToken
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserListCredentialcertificate /credential/certificate
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return []CredentialCertificate
|
||
|
*/
|
||
|
func (a *UserApiService) UserListCredentialcertificate(ctx _context.Context, userId string) ([]CredentialCertificate, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []CredentialCertificate
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/certificate"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []CredentialCertificate
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserListCredentialpassword /credential/password
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return []CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserListCredentialpassword(ctx _context.Context, userId string) ([]CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/password"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserListInvitation /invitation
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return []InlineResponse200
|
||
|
*/
|
||
|
func (a *UserApiService) UserListInvitation(ctx _context.Context, userId string) ([]InlineResponse200, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []InlineResponse200
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/invitation"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []InlineResponse200
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserListServices /services
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return []UserServices
|
||
|
*/
|
||
|
func (a *UserApiService) UserListServices(ctx _context.Context, userId string) ([]UserServices, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []UserServices
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/services"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []UserServices
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPatchCredentialId /credential/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
* @param userPatchCredentialId
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserPatchCredentialId(ctx _context.Context, userId string, id string, userPatchCredentialId UserPatchCredentialId) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userPatchCredentialId
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPatchCredentialcertificateId /credential/certificate/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
* @param userPatchCredentialcertificateId
|
||
|
@return CredentialCertificate
|
||
|
*/
|
||
|
func (a *UserApiService) UserPatchCredentialcertificateId(ctx _context.Context, userId string, id string, userPatchCredentialcertificateId UserPatchCredentialcertificateId) (CredentialCertificate, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialCertificate
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/certificate/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userPatchCredentialcertificateId
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialCertificate
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPatchCredentialpasswordId /credential/password/:id
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param id id
|
||
|
* @param userPatchCredentialpasswordId
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserPatchCredentialpasswordId(ctx _context.Context, userId string, id string, userPatchCredentialpasswordId UserPatchCredentialpasswordId) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/password/{id}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", id)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userPatchCredentialpasswordId
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPatchTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param requestBody
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *UserApiService) UserPatchTag(ctx _context.Context, userId string, requestBody map[string]string) (map[string]string, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue map[string]string
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &requestBody
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v map[string]string
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPostCredential /credential
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param userPostCredential
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserPostCredential(ctx _context.Context, userId string, userPostCredential UserPostCredential) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userPostCredential
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPostCredentialcertificate /credential/certificate
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param userPostCredentialcertificate
|
||
|
@return CredentialCertificate
|
||
|
*/
|
||
|
func (a *UserApiService) UserPostCredentialcertificate(ctx _context.Context, userId string, userPostCredentialcertificate UserPostCredentialcertificate) (CredentialCertificate, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialCertificate
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/certificate"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userPostCredentialcertificate
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialCertificate
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPostCredentialpassword /credential/password
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param userPostCredentialpassword
|
||
|
@return CredentialPassword
|
||
|
*/
|
||
|
func (a *UserApiService) UserPostCredentialpassword(ctx _context.Context, userId string, userPostCredentialpassword UserPostCredentialpassword) (CredentialPassword, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue CredentialPassword
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/credential/password"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userPostCredentialpassword
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v CredentialPassword
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPostInvitationInvitationIdaccept /invitation/:invitationId/accept
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param invitationId invitationId
|
||
|
*/
|
||
|
func (a *UserApiService) UserPostInvitationInvitationIdaccept(ctx _context.Context, userId string, invitationId string) (*_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/invitation/{invitationId}/accept"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"invitationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", invitationId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPostInvitationInvitationIddecline /invitation/:invitationId/decline
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param invitationId invitationId
|
||
|
*/
|
||
|
func (a *UserApiService) UserPostInvitationInvitationIddecline(ctx _context.Context, userId string, invitationId string) (*_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}/invitation/{invitationId}/decline"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"invitationId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", invitationId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserPutTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param requestBody
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *UserApiService) UserPutTag(ctx _context.Context, userId 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 + "/user/{userId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &requestBody
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v map[string]string
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserShow Get
|
||
|
Returns a single user
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
@return User
|
||
|
*/
|
||
|
func (a *UserApiService) UserShow(ctx _context.Context, userId string) (User, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue User
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v User
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
UserUpdate Update
|
||
|
Returns modified user
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param userId ID of user
|
||
|
* @param userUpdate
|
||
|
@return User
|
||
|
*/
|
||
|
func (a *UserApiService) UserUpdate(ctx _context.Context, userId string, userUpdate UserUpdate) (User, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue User
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/user/{userId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", userId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{"application/json"}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
// body params
|
||
|
localVarPostBody = &userUpdate
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v User
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|