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

1645 lines
54 KiB
Go
Raw Normal View History

2019-02-08 05:15:45 -05:00
/*
* HyperOne API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 0.0.2
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
_context "context"
2019-02-08 05:15:45 -05:00
"fmt"
"github.com/antihax/optional"
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"strings"
2019-02-08 05:15:45 -05:00
)
// Linger please
var (
_ _context.Context
2019-02-08 05:15:45 -05:00
)
// NetadpApiService NetadpApi service
2019-02-08 05:15:45 -05:00
type NetadpApiService service
/*
NetadpActionFirewallAdd /actions/firewall_add
Action firewall_add
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
* @param netadpActionFirewallAdd
2019-02-08 05:15:45 -05:00
@return Netadp
*/
func (a *NetadpApiService) NetadpActionFirewallAdd(ctx _context.Context, netadpId string, netadpActionFirewallAdd NetadpActionFirewallAdd) (Netadp, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Netadp
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/actions/firewall_add"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &netadpActionFirewallAdd
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
var v Netadp
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
}
/*
NetadpActionFirewallRemove /actions/firewall_remove
Action firewall_remove
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param netadpId ID of netadp
@return Netadp
*/
func (a *NetadpApiService) NetadpActionFirewallRemove(ctx _context.Context, netadpId string) (Netadp, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Netadp
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/actions/firewall_remove"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 202 {
2019-02-08 05:15:45 -05:00
var v Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpDeleteAccessrightsIdentity /accessrights/:identity
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
* @param identity identity
@return Netadp
2019-02-08 05:15:45 -05:00
*/
func (a *NetadpApiService) NetadpDeleteAccessrightsIdentity(ctx _context.Context, netadpId string, identity string) (Netadp, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodDelete
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Netadp
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/accessrights/{identity}"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"identity"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", identity)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Netadp
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 Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
NetadpDeleteTagKey /tag/:key
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param netadpId ID of netadp
* @param key key
@return map[string]string
*/
func (a *NetadpApiService) NetadpDeleteTagKey(ctx _context.Context, netadpId 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 + "/netadp/{netadpId}/tag/{key}"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -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
}
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpGetServicesServiceId /services/:serviceId
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
* @param serviceId serviceId
@return NetadpServices
*/
func (a *NetadpApiService) NetadpGetServicesServiceId(ctx _context.Context, netadpId string, serviceId string) (NetadpServices, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue NetadpServices
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/services/{serviceId}"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
localVarPath = strings.Replace(localVarPath, "{"+"serviceId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", serviceId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v NetadpServices
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpGetTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
@return map[string]string
2019-02-08 05:15:45 -05:00
*/
func (a *NetadpApiService) NetadpGetTag(ctx _context.Context, netadpId string) (map[string]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// NetadpListOpts Optional parameters for the method 'NetadpList'
type NetadpListOpts struct {
AssignedResource optional.String
AssignedId optional.String
2019-02-08 05:15:45 -05:00
}
/*
NetadpList List
2019-02-08 05:15:45 -05:00
List netadp
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param optional nil or *NetadpListOpts - Optional Parameters:
* @param "AssignedResource" (optional.String) - Filter by assigned.resource
* @param "AssignedId" (optional.String) - Filter by assigned.id
@return []Netadp
*/
func (a *NetadpApiService) NetadpList(ctx _context.Context, localVarOptionals *NetadpListOpts) ([]Netadp, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Netadp
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
if localVarOptionals != nil && localVarOptionals.AssignedResource.IsSet() {
localVarQueryParams.Add("assigned.resource", parameterToString(localVarOptionals.AssignedResource.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.AssignedId.IsSet() {
localVarQueryParams.Add("assigned.id", parameterToString(localVarOptionals.AssignedId.Value(), ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpListAccessrights /accessrights
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
@return []string
*/
func (a *NetadpApiService) NetadpListAccessrights(ctx _context.Context, netadpId string) ([]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []string
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
}
// NetadpListQueueOpts Optional parameters for the method 'NetadpListQueue'
type NetadpListQueueOpts struct {
Limit optional.Float32
Skip optional.Float32
2019-02-08 05:15:45 -05:00
}
/*
NetadpListQueue /queue
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
* @param optional nil or *NetadpListQueueOpts - Optional Parameters:
* @param "Limit" (optional.Float32) - $limit
* @param "Skip" (optional.Float32) - $skip
2019-02-08 05:15:45 -05:00
@return []Event
*/
func (a *NetadpApiService) NetadpListQueue(ctx _context.Context, netadpId string, localVarOptionals *NetadpListQueueOpts) ([]Event, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Event
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/queue"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("$limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Skip.IsSet() {
localVarQueryParams.Add("$skip", parameterToString(localVarOptionals.Skip.Value(), ""))
}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []Event
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpListServices /services
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
@return []NetadpServices
*/
func (a *NetadpApiService) NetadpListServices(ctx _context.Context, netadpId string) ([]NetadpServices, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []NetadpServices
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/services"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v []NetadpServices
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpPatchTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
* @param requestBody
@return map[string]string
2019-02-08 05:15:45 -05:00
*/
func (a *NetadpApiService) NetadpPatchTag(ctx _context.Context, netadpId string, requestBody map[string]string) (map[string]string, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPatch
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]string
2019-02-08 05:15:45 -05:00
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &requestBody
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpPostAccessrights /accessrights
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
* @param netadpPostAccessrights
@return Netadp
*/
func (a *NetadpApiService) NetadpPostAccessrights(ctx _context.Context, netadpId string, netadpPostAccessrights NetadpPostAccessrights) (Netadp, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodPost
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Netadp
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}/accessrights"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
// body params
localVarPostBody = &netadpPostAccessrights
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
2019-02-08 05:15:45 -05:00
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 200 {
var v Netadp
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 Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
/*
NetadpPutTag /tag
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param netadpId ID of netadp
* @param requestBody
@return map[string]string
*/
func (a *NetadpApiService) NetadpPutTag(ctx _context.Context, netadpId 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 + "/netadp/{netadpId}/tag"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -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
2019-02-08 05:15:45 -05:00
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
2019-02-08 05:15:45 -05:00
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
var v map[string]string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}
/*
NetadpShow Get
2019-02-08 05:15:45 -05:00
Returns a single netadp
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
2019-02-08 05:15:45 -05:00
* @param netadpId ID of netadp
@return Netadp
*/
func (a *NetadpApiService) NetadpShow(ctx _context.Context, netadpId string) (Netadp, *_nethttp.Response, error) {
2019-02-08 05:15:45 -05:00
var (
localVarHTTPMethod = _nethttp.MethodGet
2019-02-08 05:15:45 -05:00
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Netadp
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/netadp/{netadpId}"
localVarPath = strings.Replace(localVarPath, "{"+"netadpId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", netadpId)), -1)
2019-02-08 05:15:45 -05:00
localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
2019-02-08 05:15:45 -05:00
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
2019-02-08 05:15:45 -05:00
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
2019-02-08 05:15:45 -05:00
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
2019-02-08 05:15:45 -05:00
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
2019-02-08 05:15:45 -05:00
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["x-project"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
2019-02-08 05:15:45 -05:00
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode >= 300 {
2019-02-08 05:15:45 -05:00
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
2019-02-08 05:15:45 -05:00
}
if localVarHTTPResponse.StatusCode == 200 {
2019-02-08 05:15:45 -05:00
var v Netadp
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 400 {
var v InlineResponse400
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
2019-02-08 05:15:45 -05:00
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
2019-02-08 05:15:45 -05:00
}
return localVarReturnValue, localVarHTTPResponse, nil
2019-02-08 05:15:45 -05:00
}