2025-04-06 04:55:01 +00:00
|
|
|
/*
|
2025-04-07 02:59:20 +00:00
|
|
|
Copyright © 2025 filifa
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation, either version 3 of the License, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Stats API Documentation
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
Official API for Major League Baseball.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
API version: 2.0.0
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2025-04-06 23:39:04 +00:00
|
|
|
"bytes"
|
2025-04-06 04:55:01 +00:00
|
|
|
"context"
|
2025-04-06 23:39:04 +00:00
|
|
|
"io"
|
2025-04-06 04:55:01 +00:00
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// AwardsAPIService AwardsAPI service
|
|
|
|
type AwardsAPIService service
|
|
|
|
|
|
|
|
type ApiAwardRecipientsRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AwardsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
awardId interface{}
|
|
|
|
season *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
leagueId *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiAwardRecipientsRequest) Season(season interface{}) ApiAwardRecipientsRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiAwardRecipientsRequest) SportId(sportId interface{}) ApiAwardRecipientsRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of Unique league identifiers
|
|
|
|
func (r ApiAwardRecipientsRequest) LeagueId(leagueId interface{}) ApiAwardRecipientsRequest {
|
|
|
|
r.leagueId = &leagueId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiAwardRecipientsRequest) Fields(fields interface{}) ApiAwardRecipientsRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiAwardRecipientsRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.AwardRecipientsExecute(r)
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
AwardRecipients View recipients of an award
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param awardId Unique Award Identifier. Available awards in /api/v1/awards
|
|
|
|
@return ApiAwardRecipientsRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AwardsAPIService) AwardRecipients(ctx context.Context, awardId interface{}) ApiAwardRecipientsRequest {
|
|
|
|
return ApiAwardRecipientsRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
awardId: awardId,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *AwardsAPIService) AwardRecipientsExecute(r ApiAwardRecipientsRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AwardsAPIService.AwardRecipients")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/awards/{awardId}/recipients"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"awardId"+"}", url.PathEscape(parameterValueToString(r.awardId, "awardId")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.season != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.sportId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "sportId", r.sportId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.leagueId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueId", r.leagueId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.fields != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
// to determine the Content-Type header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
// set Content-Type header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPHeaderAccepts := []string{}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
// set Accept header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
2025-04-06 04:55:01 +00:00
|
|
|
if err != nil {
|
2025-04-06 23:39:04 +00:00
|
|
|
return nil, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarHTTPResponse, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
|
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
2025-04-06 04:55:01 +00:00
|
|
|
if err != nil {
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
|
|
newErr := &GenericOpenAPIError{
|
2025-04-06 04:55:01 +00:00
|
|
|
body: localVarBody,
|
2025-04-06 23:39:04 +00:00
|
|
|
error: localVarHTTPResponse.Status,
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, newErr
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApiAwardsRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AwardsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
awardId interface{}
|
|
|
|
orgId *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of top level organizations of a sport
|
|
|
|
func (r ApiAwardsRequest) OrgId(orgId interface{}) ApiAwardsRequest {
|
|
|
|
r.orgId = &orgId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiAwardsRequest) Fields(fields interface{}) ApiAwardsRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiAwardsRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.AwardsExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Awards View awards info
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param awardId Unique Award Identifier. Available awards in /api/v1/awards
|
|
|
|
@return ApiAwardsRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AwardsAPIService) Awards(ctx context.Context, awardId interface{}) ApiAwardsRequest {
|
|
|
|
return ApiAwardsRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
awardId: awardId,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *AwardsAPIService) AwardsExecute(r ApiAwardsRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AwardsAPIService.Awards")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/awards"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"awardId"+"}", url.PathEscape(parameterValueToString(r.awardId, "awardId")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.orgId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "orgId", r.orgId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.fields != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
// to determine the Content-Type header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
// set Content-Type header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPHeaderAccepts := []string{}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
// set Accept header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
2025-04-06 04:55:01 +00:00
|
|
|
if err != nil {
|
2025-04-06 23:39:04 +00:00
|
|
|
return nil, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarHTTPResponse, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
|
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
2025-04-06 04:55:01 +00:00
|
|
|
if err != nil {
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
|
|
newErr := &GenericOpenAPIError{
|
2025-04-06 04:55:01 +00:00
|
|
|
body: localVarBody,
|
2025-04-06 23:39:04 +00:00
|
|
|
error: localVarHTTPResponse.Status,
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, newErr
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApiAwards1Request struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AwardsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
awardId interface{}
|
|
|
|
orgId *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of top level organizations of a sport
|
|
|
|
func (r ApiAwards1Request) OrgId(orgId interface{}) ApiAwards1Request {
|
|
|
|
r.orgId = &orgId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiAwards1Request) Fields(fields interface{}) ApiAwards1Request {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiAwards1Request) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.Awards1Execute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Awards1 View awards info
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param awardId Unique Award Identifier. Available awards in /api/v1/awards
|
|
|
|
@return ApiAwards1Request
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AwardsAPIService) Awards1(ctx context.Context, awardId interface{}) ApiAwards1Request {
|
|
|
|
return ApiAwards1Request{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
awardId: awardId,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *AwardsAPIService) Awards1Execute(r ApiAwards1Request) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AwardsAPIService.Awards1")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/awards/{awardId}"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"awardId"+"}", url.PathEscape(parameterValueToString(r.awardId, "awardId")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.orgId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "orgId", r.orgId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.fields != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
// to determine the Content-Type header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPContentTypes := []string{}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
// set Content-Type header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
|
|
if localVarHTTPContentType != "" {
|
|
|
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// to determine the Accept header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPHeaderAccepts := []string{}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
// set Accept header
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
|
|
if localVarHTTPHeaderAccept != "" {
|
|
|
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
2025-04-06 04:55:01 +00:00
|
|
|
if err != nil {
|
2025-04-06 23:39:04 +00:00
|
|
|
return nil, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
|
|
if err != nil || localVarHTTPResponse == nil {
|
|
|
|
return localVarHTTPResponse, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
|
|
localVarHTTPResponse.Body.Close()
|
|
|
|
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
2025-04-06 04:55:01 +00:00
|
|
|
if err != nil {
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, err
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if localVarHTTPResponse.StatusCode >= 300 {
|
|
|
|
newErr := &GenericOpenAPIError{
|
2025-04-06 04:55:01 +00:00
|
|
|
body: localVarBody,
|
2025-04-06 23:39:04 +00:00
|
|
|
error: localVarHTTPResponse.Status,
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, newErr
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
return localVarHTTPResponse, nil
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|