/* Stats API Documentation Official API for Major League Baseball. API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package api import ( "bytes" "context" "io" "net/http" "net/url" "strings" ) // 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) } /* AllStarBallot View al star ballot info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarBallotExecute(r ApiAllStarBallotRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarBallot1 View al star ballot info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarBallot1Execute(r ApiAllStarBallot1Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarBallot2 View al star ballot info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarBallot2Execute(r ApiAllStarBallot2Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarBallot3 View al star ballot info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarBallot3Execute(r ApiAllStarBallot3Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarFinalVote View all star final vote info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarFinalVoteExecute(r ApiAllStarFinalVoteRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarFinalVote1 View all star final vote info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarFinalVote1Execute(r ApiAllStarFinalVote1Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarWriteIns View all star write ins info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarWriteInsExecute(r ApiAllStarWriteInsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* AllStarWriteIns1 View all star write ins info @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, } } // Execute executes the request func (a *LeagueAPIService) AllStarWriteIns1Execute(r ApiAllStarWriteIns1Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* League View league info @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, } } // Execute executes the request func (a *LeagueAPIService) LeagueExecute(r ApiLeagueRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.seasons != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } if r.sportId != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sportId", r.sportId, "", "") } if r.activeStatus != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* League1 View league info @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, } } // Execute executes the request func (a *LeagueAPIService) League1Execute(r ApiLeague1Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.seasons != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } if r.sportId != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sportId", r.sportId, "", "") } if r.activeStatus != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* League2 View league info @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, } } // Execute executes the request func (a *LeagueAPIService) League2Execute(r ApiLeague2Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.seasons != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } if r.sportId != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sportId", r.sportId, "", "") } if r.activeStatus != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } 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) } /* League3 View league info @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, } } // Execute executes the request func (a *LeagueAPIService) League3Execute(r ApiLeague3Request) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile ) 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) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if r.leagueIds != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "leagueIds", r.leagueIds, "", "") } if r.season != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "") } if r.seasons != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "seasons", r.seasons, "", "") } if r.fields != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "") } if r.sportId != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "sportId", r.sportId, "", "") } if r.activeStatus != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "activeStatus", r.activeStatus, "", "") } // 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{} // 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 nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } return localVarHTTPResponse, newErr } return localVarHTTPResponse, nil }