mlbstats/api/api_league.go

1545 lines
46 KiB
Go
Raw Normal View History

2025-04-06 04:55:01 +00:00
/*
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
// LeagueAPIService LeagueAPI service
type LeagueAPIService service
type ApiAllStarBallotRequest struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
fields *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiAllStarBallotRequest) LeagueIds(leagueIds interface{}) ApiAllStarBallotRequest {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiAllStarBallotRequest) Season(season interface{}) ApiAllStarBallotRequest {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarBallotRequest) Fields(fields interface{}) ApiAllStarBallotRequest {
r.fields = &fields
return r
}
func (r ApiAllStarBallotRequest) Execute() (*http.Response, error) {
return r.ApiService.AllStarBallotExecute(r)
}
2025-04-06 04:55:01 +00:00
/*
2025-04-06 23:39:04 +00:00
AllStarBallot View al star ballot info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarBallotRequest
*/
func (a *LeagueAPIService) AllStarBallot(ctx context.Context, leagueId interface{}) ApiAllStarBallotRequest {
return ApiAllStarBallotRequest{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarBallotExecute(r ApiAllStarBallotRequest) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarBallot")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/league/allStarBallot"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.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 ApiAllStarBallot1Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
fields *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiAllStarBallot1Request) LeagueIds(leagueIds interface{}) ApiAllStarBallot1Request {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiAllStarBallot1Request) Season(season interface{}) ApiAllStarBallot1Request {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarBallot1Request) Fields(fields interface{}) ApiAllStarBallot1Request {
r.fields = &fields
return r
}
func (r ApiAllStarBallot1Request) Execute() (*http.Response, error) {
return r.ApiService.AllStarBallot1Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarBallot1 View al star ballot info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarBallot1Request
*/
func (a *LeagueAPIService) AllStarBallot1(ctx context.Context, leagueId interface{}) ApiAllStarBallot1Request {
return ApiAllStarBallot1Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarBallot1Execute(r ApiAllStarBallot1Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarBallot1")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/league/{leagueId}/allStarBallot"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.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 ApiAllStarBallot2Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
fields *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiAllStarBallot2Request) LeagueIds(leagueIds interface{}) ApiAllStarBallot2Request {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiAllStarBallot2Request) Season(season interface{}) ApiAllStarBallot2Request {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarBallot2Request) Fields(fields interface{}) ApiAllStarBallot2Request {
r.fields = &fields
return r
}
func (r ApiAllStarBallot2Request) Execute() (*http.Response, error) {
return r.ApiService.AllStarBallot2Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarBallot2 View al star ballot info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarBallot2Request
*/
func (a *LeagueAPIService) AllStarBallot2(ctx context.Context, leagueId interface{}) ApiAllStarBallot2Request {
return ApiAllStarBallot2Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarBallot2Execute(r ApiAllStarBallot2Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarBallot2")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/leagues/allStarBallot"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.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 ApiAllStarBallot3Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
fields *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiAllStarBallot3Request) LeagueIds(leagueIds interface{}) ApiAllStarBallot3Request {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiAllStarBallot3Request) Season(season interface{}) ApiAllStarBallot3Request {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarBallot3Request) Fields(fields interface{}) ApiAllStarBallot3Request {
r.fields = &fields
return r
}
func (r ApiAllStarBallot3Request) Execute() (*http.Response, error) {
return r.ApiService.AllStarBallot3Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarBallot3 View al star ballot info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarBallot3Request
*/
func (a *LeagueAPIService) AllStarBallot3(ctx context.Context, leagueId interface{}) ApiAllStarBallot3Request {
return ApiAllStarBallot3Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarBallot3Execute(r ApiAllStarBallot3Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarBallot3")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/leagues/{leagueId}/allStarBallot"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.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 ApiAllStarFinalVoteRequest struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
season *interface{}
fields *interface{}
}
// Season of play
func (r ApiAllStarFinalVoteRequest) Season(season interface{}) ApiAllStarFinalVoteRequest {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarFinalVoteRequest) Fields(fields interface{}) ApiAllStarFinalVoteRequest {
r.fields = &fields
return r
}
func (r ApiAllStarFinalVoteRequest) Execute() (*http.Response, error) {
return r.ApiService.AllStarFinalVoteExecute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarFinalVote View all star final vote info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarFinalVoteRequest
*/
func (a *LeagueAPIService) AllStarFinalVote(ctx context.Context, leagueId interface{}) ApiAllStarFinalVoteRequest {
return ApiAllStarFinalVoteRequest{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarFinalVoteExecute(r ApiAllStarFinalVoteRequest) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarFinalVote")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/league/{leagueId}/allStarFinalVote"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.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 ApiAllStarFinalVote1Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
season *interface{}
fields *interface{}
}
// Season of play
func (r ApiAllStarFinalVote1Request) Season(season interface{}) ApiAllStarFinalVote1Request {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarFinalVote1Request) Fields(fields interface{}) ApiAllStarFinalVote1Request {
r.fields = &fields
return r
}
func (r ApiAllStarFinalVote1Request) Execute() (*http.Response, error) {
return r.ApiService.AllStarFinalVote1Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarFinalVote1 View all star final vote info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarFinalVote1Request
*/
func (a *LeagueAPIService) AllStarFinalVote1(ctx context.Context, leagueId interface{}) ApiAllStarFinalVote1Request {
return ApiAllStarFinalVote1Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarFinalVote1Execute(r ApiAllStarFinalVote1Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarFinalVote1")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/leagues/{leagueId}/allStarFinalVote"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.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 ApiAllStarWriteInsRequest struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
season *interface{}
fields *interface{}
}
// Season of play
func (r ApiAllStarWriteInsRequest) Season(season interface{}) ApiAllStarWriteInsRequest {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarWriteInsRequest) Fields(fields interface{}) ApiAllStarWriteInsRequest {
r.fields = &fields
return r
}
func (r ApiAllStarWriteInsRequest) Execute() (*http.Response, error) {
return r.ApiService.AllStarWriteInsExecute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarWriteIns View all star write ins info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarWriteInsRequest
*/
func (a *LeagueAPIService) AllStarWriteIns(ctx context.Context, leagueId interface{}) ApiAllStarWriteInsRequest {
return ApiAllStarWriteInsRequest{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarWriteInsExecute(r ApiAllStarWriteInsRequest) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarWriteIns")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/league/{leagueId}/allStarWriteIns"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.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 ApiAllStarWriteIns1Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
season *interface{}
fields *interface{}
}
// Season of play
func (r ApiAllStarWriteIns1Request) Season(season interface{}) ApiAllStarWriteIns1Request {
r.season = &season
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiAllStarWriteIns1Request) Fields(fields interface{}) ApiAllStarWriteIns1Request {
r.fields = &fields
return r
}
func (r ApiAllStarWriteIns1Request) Execute() (*http.Response, error) {
return r.ApiService.AllStarWriteIns1Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
AllStarWriteIns1 View all star write ins info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiAllStarWriteIns1Request
*/
func (a *LeagueAPIService) AllStarWriteIns1(ctx context.Context, leagueId interface{}) ApiAllStarWriteIns1Request {
return ApiAllStarWriteIns1Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) AllStarWriteIns1Execute(r ApiAllStarWriteIns1Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.AllStarWriteIns1")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/leagues/{leagueId}/allStarWriteIns"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.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 ApiLeagueRequest struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
seasons *interface{}
fields *interface{}
sportId *interface{}
activeStatus *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiLeagueRequest) LeagueIds(leagueIds interface{}) ApiLeagueRequest {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiLeagueRequest) Season(season interface{}) ApiLeagueRequest {
r.season = &season
return r
}
// Comma delimited list of Seasons of play
func (r ApiLeagueRequest) Seasons(seasons interface{}) ApiLeagueRequest {
r.seasons = &seasons
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiLeagueRequest) Fields(fields interface{}) ApiLeagueRequest {
r.fields = &fields
return r
}
// Top level organization of a sport
func (r ApiLeagueRequest) SportId(sportId interface{}) ApiLeagueRequest {
r.sportId = &sportId
return r
}
// Flag for fetching leagues that are currently active (Y), inactive (N), pending (P), or all teams (B)
func (r ApiLeagueRequest) ActiveStatus(activeStatus interface{}) ApiLeagueRequest {
r.activeStatus = &activeStatus
return r
}
func (r ApiLeagueRequest) Execute() (*http.Response, error) {
return r.ApiService.LeagueExecute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
League View league info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiLeagueRequest
*/
func (a *LeagueAPIService) League(ctx context.Context, leagueId interface{}) ApiLeagueRequest {
return ApiLeagueRequest{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) LeagueExecute(r ApiLeagueRequest) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.League")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/league"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.seasons != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "")
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
}
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.activeStatus != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "")
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 ApiLeague1Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
seasons *interface{}
fields *interface{}
sportId *interface{}
activeStatus *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiLeague1Request) LeagueIds(leagueIds interface{}) ApiLeague1Request {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiLeague1Request) Season(season interface{}) ApiLeague1Request {
r.season = &season
return r
}
// Comma delimited list of Seasons of play
func (r ApiLeague1Request) Seasons(seasons interface{}) ApiLeague1Request {
r.seasons = &seasons
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiLeague1Request) Fields(fields interface{}) ApiLeague1Request {
r.fields = &fields
return r
}
// Top level organization of a sport
func (r ApiLeague1Request) SportId(sportId interface{}) ApiLeague1Request {
r.sportId = &sportId
return r
}
// Flag for fetching leagues that are currently active (Y), inactive (N), pending (P), or all teams (B)
func (r ApiLeague1Request) ActiveStatus(activeStatus interface{}) ApiLeague1Request {
r.activeStatus = &activeStatus
return r
}
func (r ApiLeague1Request) Execute() (*http.Response, error) {
return r.ApiService.League1Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
League1 View league info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiLeague1Request
*/
func (a *LeagueAPIService) League1(ctx context.Context, leagueId interface{}) ApiLeague1Request {
return ApiLeague1Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) League1Execute(r ApiLeague1Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.League1")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/league/{leagueId}"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.seasons != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "")
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
}
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.activeStatus != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "")
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 ApiLeague2Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
seasons *interface{}
fields *interface{}
sportId *interface{}
activeStatus *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiLeague2Request) LeagueIds(leagueIds interface{}) ApiLeague2Request {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiLeague2Request) Season(season interface{}) ApiLeague2Request {
r.season = &season
return r
}
// Comma delimited list of Seasons of play
func (r ApiLeague2Request) Seasons(seasons interface{}) ApiLeague2Request {
r.seasons = &seasons
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiLeague2Request) Fields(fields interface{}) ApiLeague2Request {
r.fields = &fields
return r
}
// Top level organization of a sport
func (r ApiLeague2Request) SportId(sportId interface{}) ApiLeague2Request {
r.sportId = &sportId
return r
}
// Flag for fetching leagues that are currently active (Y), inactive (N), pending (P), or all teams (B)
func (r ApiLeague2Request) ActiveStatus(activeStatus interface{}) ApiLeague2Request {
r.activeStatus = &activeStatus
return r
}
func (r ApiLeague2Request) Execute() (*http.Response, error) {
return r.ApiService.League2Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
League2 View league info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiLeague2Request
*/
func (a *LeagueAPIService) League2(ctx context.Context, leagueId interface{}) ApiLeague2Request {
return ApiLeague2Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) League2Execute(r ApiLeague2Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.League2")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/leagues"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.seasons != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "")
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
}
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.activeStatus != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "")
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 ApiLeague3Request struct {
ctx context.Context
ApiService *LeagueAPIService
leagueId interface{}
leagueIds *interface{}
season *interface{}
seasons *interface{}
fields *interface{}
sportId *interface{}
activeStatus *interface{}
}
// Comma delimited list of Unique league identifiers
func (r ApiLeague3Request) LeagueIds(leagueIds interface{}) ApiLeague3Request {
r.leagueIds = &leagueIds
return r
}
// Season of play
func (r ApiLeague3Request) Season(season interface{}) ApiLeague3Request {
r.season = &season
return r
}
// Comma delimited list of Seasons of play
func (r ApiLeague3Request) Seasons(seasons interface{}) ApiLeague3Request {
r.seasons = &seasons
return r
}
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
func (r ApiLeague3Request) Fields(fields interface{}) ApiLeague3Request {
r.fields = &fields
return r
}
// Top level organization of a sport
func (r ApiLeague3Request) SportId(sportId interface{}) ApiLeague3Request {
r.sportId = &sportId
return r
}
// Flag for fetching leagues that are currently active (Y), inactive (N), pending (P), or all teams (B)
func (r ApiLeague3Request) ActiveStatus(activeStatus interface{}) ApiLeague3Request {
r.activeStatus = &activeStatus
return r
}
func (r ApiLeague3Request) Execute() (*http.Response, error) {
return r.ApiService.League3Execute(r)
2025-04-06 04:55:01 +00:00
}
/*
2025-04-06 23:39:04 +00:00
League3 View league info
2025-04-06 04:55:01 +00:00
2025-04-06 23:39:04 +00:00
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param leagueId Unique League Identifier
@return ApiLeague3Request
*/
func (a *LeagueAPIService) League3(ctx context.Context, leagueId interface{}) ApiLeague3Request {
return ApiLeague3Request{
ApiService: a,
ctx: ctx,
leagueId: leagueId,
}
2025-04-06 04:55:01 +00:00
}
2025-04-06 23:39:04 +00:00
// Execute executes the request
func (a *LeagueAPIService) League3Execute(r ApiLeague3Request) (*http.Response, error) {
2025-04-06 04:55:01 +00:00
var (
2025-04-06 23:39:04 +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, "LeagueAPIService.League3")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/api/v1/leagues/{leagueId}"
localVarPath = strings.Replace(localVarPath, "{"+"leagueId"+"}", url.PathEscape(parameterValueToString(r.leagueId, "leagueId")), -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.leagueIds != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "")
2025-04-06 04:55:01 +00:00
}
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.seasons != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "")
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
}
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.activeStatus != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "")
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
}