mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
526 lines
19 KiB
Go
526 lines
19 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"io"
|
|
"net/http"
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
// ValidatorAPIService ValidatorAPI service
|
|
type ValidatorAPIService service
|
|
|
|
type ValidatorAPIGetValidatorRequest struct {
|
|
ctx context.Context
|
|
ApiService *ValidatorAPIService
|
|
limit *string
|
|
}
|
|
|
|
// Limit is how many slots to return, as a decimal string in the `?limit=` query. Absent, unparseable or non-positive means 200; over 1000 is clamped to 1000. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two.
|
|
func (r ValidatorAPIGetValidatorRequest) Limit(limit string) ValidatorAPIGetValidatorRequest {
|
|
r.limit = &limit
|
|
return r
|
|
}
|
|
|
|
func (r ValidatorAPIGetValidatorRequest) Execute() (*ValidatorValidatorList, *http.Response, error) {
|
|
return r.ApiService.GetValidatorExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetValidator Returns the validator slots the caller's org has claimed.
|
|
|
|
Returns the validator slots the caller's org has claimed.
|
|
|
|
One entry per claimed slot with its node identity, its live-ish node status and
|
|
the owner-gated registration queued for it, if any. Slots are org-scoped by the
|
|
validated identity, so a caller can only ever see their own — a slot claimed by
|
|
another org is not merely hidden from this list, it is unreachable through the
|
|
whole surface.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@return ValidatorAPIGetValidatorRequest
|
|
*/
|
|
func (a *ValidatorAPIService) GetValidator(ctx context.Context) ValidatorAPIGetValidatorRequest {
|
|
return ValidatorAPIGetValidatorRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return ValidatorValidatorList
|
|
func (a *ValidatorAPIService) GetValidatorExecute(r ValidatorAPIGetValidatorRequest) (*ValidatorValidatorList, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *ValidatorValidatorList
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ValidatorAPIService.GetValidator")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/validator"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if r.limit != nil {
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "")
|
|
}
|
|
// 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", "application/problem+json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := &GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v ProblemDetails
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
newErr.model = v
|
|
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
|
|
}
|
|
|
|
type ValidatorAPIGetValidatorByTokenidRequest struct {
|
|
ctx context.Context
|
|
ApiService *ValidatorAPIService
|
|
tokenId string
|
|
}
|
|
|
|
func (r ValidatorAPIGetValidatorByTokenidRequest) Execute() (*ValidatorSlotView, *http.Response, error) {
|
|
return r.ApiService.GetValidatorByTokenidExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetValidatorByTokenid Returns one claimed validator slot, scoped to the caller's org.
|
|
|
|
Returns one claimed validator slot, scoped to the caller's org.
|
|
|
|
A slot another org holds, and a slot nobody holds, are both 404 — never a
|
|
different status, so this route cannot be used to probe which slots are taken.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@param tokenId TokenID is the slot's GenesisNFT token id, from the path, as a decimal string. A value that is not a positive integer is 400. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two.
|
|
@return ValidatorAPIGetValidatorByTokenidRequest
|
|
*/
|
|
func (a *ValidatorAPIService) GetValidatorByTokenid(ctx context.Context, tokenId string) ValidatorAPIGetValidatorByTokenidRequest {
|
|
return ValidatorAPIGetValidatorByTokenidRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
tokenId: tokenId,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return ValidatorSlotView
|
|
func (a *ValidatorAPIService) GetValidatorByTokenidExecute(r ValidatorAPIGetValidatorByTokenidRequest) (*ValidatorSlotView, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *ValidatorSlotView
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ValidatorAPIService.GetValidatorByTokenid")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/validator/{tokenId}"
|
|
localVarPath = strings.Replace(localVarPath, "{"+"tokenId"+"}", url.PathEscape(parameterValueToString(r.tokenId, "tokenId")), -1)
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.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", "application/problem+json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := &GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v ProblemDetails
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
newErr.model = v
|
|
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
|
|
}
|
|
|
|
type ValidatorAPIGetValidatorChallengeRequest struct {
|
|
ctx context.Context
|
|
ApiService *ValidatorAPIService
|
|
tokenId *string
|
|
}
|
|
|
|
// TokenID is the Validator-tier GenesisNFT token id, as a decimal string in the `?tokenId=` query. A value that is not a positive integer is 400. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two.
|
|
func (r ValidatorAPIGetValidatorChallengeRequest) TokenId(tokenId string) ValidatorAPIGetValidatorChallengeRequest {
|
|
r.tokenId = &tokenId
|
|
return r
|
|
}
|
|
|
|
func (r ValidatorAPIGetValidatorChallengeRequest) Execute() (*ValidatorChallengeView, *http.Response, error) {
|
|
return r.ApiService.GetValidatorChallengeExecute(r)
|
|
}
|
|
|
|
/*
|
|
GetValidatorChallenge Issues the single-use nonce and the exact message a wallet must sign to claim a validator slot.
|
|
|
|
Issues the single-use nonce and the exact message a wallet must sign
|
|
to claim a validator slot.
|
|
|
|
The nonce is bound to (validated org, slot) and stored server-side, so a
|
|
signature obtained for one org or one slot can never be replayed for another,
|
|
and the message POST /v1/validator verifies is rebuilt from those same server
|
|
facts rather than trusted from the caller. Redeem it with
|
|
POST /v1/validator before it expires; it can be redeemed once.
|
|
|
|
A tokenId outside the Validator tier is refused here rather than after signing.
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@return ValidatorAPIGetValidatorChallengeRequest
|
|
*/
|
|
func (a *ValidatorAPIService) GetValidatorChallenge(ctx context.Context) ValidatorAPIGetValidatorChallengeRequest {
|
|
return ValidatorAPIGetValidatorChallengeRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return ValidatorChallengeView
|
|
func (a *ValidatorAPIService) GetValidatorChallengeExecute(r ValidatorAPIGetValidatorChallengeRequest) (*ValidatorChallengeView, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodGet
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *ValidatorChallengeView
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ValidatorAPIService.GetValidatorChallenge")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/validator/challenge"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
|
|
if r.tokenId != nil {
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "tokenId", r.tokenId, "form", "")
|
|
}
|
|
// 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", "application/problem+json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := &GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v ProblemDetails
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
newErr.model = v
|
|
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
|
|
}
|
|
|
|
type ValidatorAPIPostValidatorRequest struct {
|
|
ctx context.Context
|
|
ApiService *ValidatorAPIService
|
|
validatorValidatorClaim *ValidatorValidatorClaim
|
|
}
|
|
|
|
func (r ValidatorAPIPostValidatorRequest) ValidatorValidatorClaim(validatorValidatorClaim ValidatorValidatorClaim) ValidatorAPIPostValidatorRequest {
|
|
r.validatorValidatorClaim = &validatorValidatorClaim
|
|
return r
|
|
}
|
|
|
|
func (r ValidatorAPIPostValidatorRequest) Execute() (*ValidatorSlotView, *http.Response, error) {
|
|
return r.ApiService.PostValidatorExecute(r)
|
|
}
|
|
|
|
/*
|
|
PostValidator Claims a validator slot and provisions its node, after proving the caller's wallet owns the slot's NFT.
|
|
|
|
Claims a validator slot and provisions its node, after proving the
|
|
caller's wallet owns the slot's NFT.
|
|
|
|
The pipeline, all server-enforced: burn the single-use challenge (so a replayed
|
|
or forged nonce dies before any chain read), recover the signer from the message
|
|
this server rebuilds, require that wallet to hold Validator-tier GenesisNFT
|
|
#tokenId on Ethereum mainnet, generate a fresh luxd staking identity and seal it
|
|
into KMS, write a LuxNetwork CR for a NEW node, and ENQUEUE an owner-gated
|
|
registration. The registration is never auto-submitted to any P-Chain — the
|
|
owner co-signs it out of band — and the stake weight is set at co-sign time,
|
|
never derived from the NFT.
|
|
|
|
It fails CLOSED at every gate: a bad signature, a non-owner, a non-tier slot or
|
|
an unavailable KMS all leave no claim persisted and no key material exposed.
|
|
Re-claiming a slot this org already holds re-applies the node CR and returns 200
|
|
with the existing identity (keys and NodeID are stable); a slot held by another
|
|
org is 409. A cluster-less deployment still claims the slot, seals the keys and
|
|
queues the registration, reporting the node as "node_pending".
|
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
@return ValidatorAPIPostValidatorRequest
|
|
*/
|
|
func (a *ValidatorAPIService) PostValidator(ctx context.Context) ValidatorAPIPostValidatorRequest {
|
|
return ValidatorAPIPostValidatorRequest{
|
|
ApiService: a,
|
|
ctx: ctx,
|
|
}
|
|
}
|
|
|
|
// Execute executes the request
|
|
//
|
|
// @return ValidatorSlotView
|
|
func (a *ValidatorAPIService) PostValidatorExecute(r ValidatorAPIPostValidatorRequest) (*ValidatorSlotView, *http.Response, error) {
|
|
var (
|
|
localVarHTTPMethod = http.MethodPost
|
|
localVarPostBody interface{}
|
|
formFiles []formFile
|
|
localVarReturnValue *ValidatorSlotView
|
|
)
|
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ValidatorAPIService.PostValidator")
|
|
if err != nil {
|
|
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
}
|
|
|
|
localVarPath := localBasePath + "/v1/validator"
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
localVarQueryParams := url.Values{}
|
|
localVarFormParams := url.Values{}
|
|
if r.validatorValidatorClaim == nil {
|
|
return localVarReturnValue, nil, reportError("validatorValidatorClaim is required and must be specified")
|
|
}
|
|
|
|
// 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", "application/problem+json"}
|
|
|
|
// set Accept header
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
if localVarHTTPHeaderAccept != "" {
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
}
|
|
// body params
|
|
localVarPostBody = r.validatorValidatorClaim
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
if err != nil {
|
|
return localVarReturnValue, nil, err
|
|
}
|
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
localVarHTTPResponse.Body.Close()
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
if err != nil {
|
|
return localVarReturnValue, localVarHTTPResponse, err
|
|
}
|
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
newErr := &GenericOpenAPIError{
|
|
body: localVarBody,
|
|
error: localVarHTTPResponse.Status,
|
|
}
|
|
var v ProblemDetails
|
|
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
newErr.error = err.Error()
|
|
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
}
|
|
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
newErr.model = v
|
|
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
|
|
}
|