2516 lines
83 KiB
Go
2516 lines
83 KiB
Go
|
/*
|
||
|
* HyperOne API
|
||
|
*
|
||
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||
|
*
|
||
|
* API version: 0.0.2
|
||
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||
|
*/
|
||
|
|
||
|
package openapi
|
||
|
|
||
|
import (
|
||
|
_context "context"
|
||
|
"fmt"
|
||
|
"github.com/antihax/optional"
|
||
|
_ioutil "io/ioutil"
|
||
|
_nethttp "net/http"
|
||
|
_neturl "net/url"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// Linger please
|
||
|
var (
|
||
|
_ _context.Context
|
||
|
)
|
||
|
|
||
|
// ZoneApiService ZoneApi service
|
||
|
type ZoneApiService service
|
||
|
|
||
|
/*
|
||
|
ZoneCreate Create
|
||
|
Create zone
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneCreate
|
||
|
@return Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneCreate(ctx _context.Context, zoneCreate ZoneCreate) (Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone"
|
||
|
|
||
|
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 = &zoneCreate
|
||
|
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 Zone
|
||
|
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 Zone
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneDelete Delete
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneDelete(ctx _context.Context, zoneId 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 + "/zone/{zoneId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneDeleteAccessrightsIdentity /accessrights/:identity
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param identity identity
|
||
|
@return Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneDeleteAccessrightsIdentity(ctx _context.Context, zoneId string, identity string) (Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/accessrights/{identity}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"identity"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", identity)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v Zone
|
||
|
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 Zone
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneDeleteRecordsetRecordsetId /recordset/:recordsetId
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param recordsetId recordsetId
|
||
|
@return Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneDeleteRecordsetRecordsetId(ctx _context.Context, zoneId string, recordsetId string) (Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodDelete
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset/{recordsetId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"recordsetId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", recordsetId)), -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 Zone
|
||
|
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 Zone
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneDeleteTagKey /tag/:key
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param key key
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneDeleteTagKey(ctx _context.Context, zoneId 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 + "/zone/{zoneId}/tag/{key}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneGetRecordsetRecordsetId /recordset/:recordsetId
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param recordsetId recordsetId
|
||
|
@return ZoneRecordset
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneGetRecordsetRecordsetId(ctx _context.Context, zoneId string, recordsetId string) (ZoneRecordset, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue ZoneRecordset
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset/{recordsetId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"recordsetId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", recordsetId)), -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 ZoneRecordset
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneGetServicesServiceId /services/:serviceId
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param serviceId serviceId
|
||
|
@return ZoneServices
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneGetServicesServiceId(ctx _context.Context, zoneId string, serviceId string) (ZoneServices, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue ZoneServices
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/services/{serviceId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 ZoneServices
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneGetTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneGetTag(ctx _context.Context, zoneId 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 + "/zone/{zoneId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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
|
||
|
}
|
||
|
|
||
|
// ZoneListOpts Optional parameters for the method 'ZoneList'
|
||
|
type ZoneListOpts struct {
|
||
|
Name optional.String
|
||
|
Tag optional.Interface
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneList List
|
||
|
List zone
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param optional nil or *ZoneListOpts - Optional Parameters:
|
||
|
* @param "Name" (optional.String) - Filter by name
|
||
|
* @param "Tag" (optional.Interface of map[string]string) - Filter by tag
|
||
|
@return []Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneList(ctx _context.Context, localVarOptionals *ZoneListOpts) ([]Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone"
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
if localVarOptionals != nil && localVarOptionals.Name.IsSet() {
|
||
|
localVarQueryParams.Add("name", parameterToString(localVarOptionals.Name.Value(), ""))
|
||
|
}
|
||
|
if localVarOptionals != nil && localVarOptionals.Tag.IsSet() {
|
||
|
localVarQueryParams.Add("tag", parameterToString(localVarOptionals.Tag.Value(), ""))
|
||
|
}
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []Zone
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneListAccessrights /accessrights
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
@return []string
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneListAccessrights(ctx _context.Context, zoneId string) ([]string, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []string
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/accessrights"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []string
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
// ZoneListQueueOpts Optional parameters for the method 'ZoneListQueue'
|
||
|
type ZoneListQueueOpts struct {
|
||
|
Limit optional.Float32
|
||
|
Skip optional.Float32
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneListQueue /queue
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param optional nil or *ZoneListQueueOpts - Optional Parameters:
|
||
|
* @param "Limit" (optional.Float32) - $limit
|
||
|
* @param "Skip" (optional.Float32) - $skip
|
||
|
@return []Event
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneListQueue(ctx _context.Context, zoneId string, localVarOptionals *ZoneListQueueOpts) ([]Event, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []Event
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/queue"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
|
||
|
localVarHeaderParams := make(map[string]string)
|
||
|
localVarQueryParams := _neturl.Values{}
|
||
|
localVarFormParams := _neturl.Values{}
|
||
|
|
||
|
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
|
||
|
localVarQueryParams.Add("$limit", parameterToString(localVarOptionals.Limit.Value(), ""))
|
||
|
}
|
||
|
if localVarOptionals != nil && localVarOptionals.Skip.IsSet() {
|
||
|
localVarQueryParams.Add("$skip", parameterToString(localVarOptionals.Skip.Value(), ""))
|
||
|
}
|
||
|
// to determine the Content-Type header
|
||
|
localVarHTTPContentTypes := []string{}
|
||
|
|
||
|
// set Content-Type header
|
||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||
|
if localVarHTTPContentType != "" {
|
||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||
|
}
|
||
|
|
||
|
// to determine the Accept header
|
||
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||
|
|
||
|
// set Accept header
|
||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||
|
if localVarHTTPHeaderAccept != "" {
|
||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||
|
}
|
||
|
if ctx != nil {
|
||
|
// API Key Authentication
|
||
|
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||
|
var key string
|
||
|
if auth.Prefix != "" {
|
||
|
key = auth.Prefix + " " + auth.Key
|
||
|
} else {
|
||
|
key = auth.Key
|
||
|
}
|
||
|
localVarHeaderParams["x-project"] = key
|
||
|
}
|
||
|
}
|
||
|
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, nil, err
|
||
|
}
|
||
|
|
||
|
localVarHTTPResponse, err := a.client.callAPI(r)
|
||
|
if err != nil || localVarHTTPResponse == nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
|
||
|
localVarHTTPResponse.Body.Close()
|
||
|
if err != nil {
|
||
|
return localVarReturnValue, localVarHTTPResponse, err
|
||
|
}
|
||
|
|
||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: localVarHTTPResponse.Status,
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 200 {
|
||
|
var v []Event
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
if localVarHTTPResponse.StatusCode == 400 {
|
||
|
var v InlineResponse400
|
||
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr.error = err.Error()
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
newErr.model = v
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||
|
if err != nil {
|
||
|
newErr := GenericOpenAPIError{
|
||
|
body: localVarBody,
|
||
|
error: err.Error(),
|
||
|
}
|
||
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
||
|
}
|
||
|
|
||
|
return localVarReturnValue, localVarHTTPResponse, nil
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneListRecordset /recordset
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
@return []ZoneRecordset
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneListRecordset(ctx _context.Context, zoneId string) ([]ZoneRecordset, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []ZoneRecordset
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 []ZoneRecordset
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneListRecordsetRecordsetIdrecord /recordset/:recordsetId/record
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param recordsetId recordsetId
|
||
|
@return []ZoneRecordsetRecord
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneListRecordsetRecordsetIdrecord(ctx _context.Context, zoneId string, recordsetId string) ([]ZoneRecordsetRecord, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []ZoneRecordsetRecord
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset/{recordsetId}/record"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"recordsetId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", recordsetId)), -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 []ZoneRecordsetRecord
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneListServices /services
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
@return []ZoneServices
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneListServices(ctx _context.Context, zoneId string) ([]ZoneServices, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue []ZoneServices
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/services"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 []ZoneServices
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZonePatchRecordsetRecordsetId /recordset/:recordsetId
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param recordsetId recordsetId
|
||
|
* @param zonePatchRecordsetRecordsetId
|
||
|
@return ZoneRecordset
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZonePatchRecordsetRecordsetId(ctx _context.Context, zoneId string, recordsetId string, zonePatchRecordsetRecordsetId ZonePatchRecordsetRecordsetId) (ZoneRecordset, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue ZoneRecordset
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset/{recordsetId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"recordsetId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", recordsetId)), -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 = &zonePatchRecordsetRecordsetId
|
||
|
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 ZoneRecordset
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZonePatchTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param requestBody
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZonePatchTag(ctx _context.Context, zoneId 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 + "/zone/{zoneId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZonePostAccessrights /accessrights
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param zonePostAccessrights
|
||
|
@return Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZonePostAccessrights(ctx _context.Context, zoneId string, zonePostAccessrights ZonePostAccessrights) (Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/accessrights"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 = &zonePostAccessrights
|
||
|
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 Zone
|
||
|
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 Zone
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZonePostRecordset /recordset
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param zonePostRecordset
|
||
|
@return ZoneRecordset
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZonePostRecordset(ctx _context.Context, zoneId string, zonePostRecordset ZonePostRecordset) (ZoneRecordset, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPost
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue ZoneRecordset
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 = &zonePostRecordset
|
||
|
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 ZoneRecordset
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZonePutRecordsetRecordsetIdrecord /recordset/:recordsetId/record
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param recordsetId recordsetId
|
||
|
* @param mapStringinterface
|
||
|
@return ZoneRecordsetRecord
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZonePutRecordsetRecordsetIdrecord(ctx _context.Context, zoneId string, recordsetId string, mapStringinterface []map[string]interface{}) (ZoneRecordsetRecord, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPut
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue ZoneRecordsetRecord
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}/recordset/{recordsetId}/record"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -1)
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"recordsetId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", recordsetId)), -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 = &mapStringinterface
|
||
|
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 ZoneRecordsetRecord
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZonePutTag /tag
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param requestBody
|
||
|
@return map[string]string
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZonePutTag(ctx _context.Context, zoneId 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 + "/zone/{zoneId}/tag"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneShow Get
|
||
|
Returns a single zone
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
@return Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneShow(ctx _context.Context, zoneId string) (Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodGet
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 Zone
|
||
|
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
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
ZoneUpdate Update
|
||
|
Returns modified zone
|
||
|
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||
|
* @param zoneId ID of zone
|
||
|
* @param zoneUpdate
|
||
|
@return Zone
|
||
|
*/
|
||
|
func (a *ZoneApiService) ZoneUpdate(ctx _context.Context, zoneId string, zoneUpdate ZoneUpdate) (Zone, *_nethttp.Response, error) {
|
||
|
var (
|
||
|
localVarHTTPMethod = _nethttp.MethodPatch
|
||
|
localVarPostBody interface{}
|
||
|
localVarFormFileName string
|
||
|
localVarFileName string
|
||
|
localVarFileBytes []byte
|
||
|
localVarReturnValue Zone
|
||
|
)
|
||
|
|
||
|
// create path and map variables
|
||
|
localVarPath := a.client.cfg.BasePath + "/zone/{zoneId}"
|
||
|
localVarPath = strings.Replace(localVarPath, "{"+"zoneId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", zoneId)), -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 = &zoneUpdate
|
||
|
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 Zone
|
||
|
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
|
||
|
}
|