2025-04-06 04:55:01 +00:00
|
|
|
/*
|
2025-04-07 02:59:20 +00:00
|
|
|
Copyright © 2025 filifa
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation, either version 3 of the License, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Stats API Documentation
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
Official API for Major League Baseball.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
API version: 2.0.0
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2025-04-06 23:39:04 +00:00
|
|
|
"bytes"
|
2025-04-06 04:55:01 +00:00
|
|
|
"context"
|
2025-04-06 23:39:04 +00:00
|
|
|
"io"
|
2025-04-06 04:55:01 +00:00
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// ScheduleAPIService ScheduleAPI service
|
|
|
|
type ScheduleAPIService service
|
|
|
|
|
|
|
|
type ApiPostseasonScheduleRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *ScheduleAPIService
|
|
|
|
gameTypes *interface{}
|
|
|
|
seriesNumber *interface{}
|
|
|
|
teamId *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
useLatestGames *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
useFeaturedGame *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
season *interface{}
|
|
|
|
publicFacing *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiPostseasonScheduleRequest) GameTypes(gameTypes interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.gameTypes = &gameTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleRequest) SeriesNumber(seriesNumber interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.seriesNumber = &seriesNumber
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Team Identifier. Format: 141, 147, etc
|
|
|
|
func (r ApiPostseasonScheduleRequest) TeamId(teamId interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.teamId = &teamId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique League Identifier
|
|
|
|
func (r ApiPostseasonScheduleRequest) SportId(sportId interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleRequest) UseLatestGames(useLatestGames interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.useLatestGames = &useLatestGames
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleRequest) UseFeaturedGame(useFeaturedGame interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.useFeaturedGame = &useFeaturedGame
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleRequest) Season(season interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return public, non-public or all games. Format: Public Facing = 'Y', Non-Public Facing = 'N', All = 'A'
|
|
|
|
func (r ApiPostseasonScheduleRequest) PublicFacing(publicFacing interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.publicFacing = &publicFacing
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiPostseasonScheduleRequest) Fields(fields interface{}) ApiPostseasonScheduleRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.PostseasonScheduleExecute(r)
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
PostseasonSchedule Get postseason schedule
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
This endpoint allows you to pull postseason schedules
|
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiPostseasonScheduleRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *ScheduleAPIService) PostseasonSchedule(ctx context.Context) ApiPostseasonScheduleRequest {
|
|
|
|
return ApiPostseasonScheduleRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) PostseasonScheduleExecute(r ApiPostseasonScheduleRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.PostseasonSchedule")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule/postseason"
|
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.gameTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameTypes", r.gameTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.seriesNumber != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "seriesNumber", r.seriesNumber, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.teamId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "teamId", r.teamId, "", "")
|
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.useLatestGames != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useLatestGames", r.useLatestGames, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.useFeaturedGame != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useFeaturedGame", r.useFeaturedGame, "", "")
|
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.publicFacing != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "publicFacing", r.publicFacing, "", "")
|
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 ApiPostseasonScheduleSeriesRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *ScheduleAPIService
|
|
|
|
gameTypes *interface{}
|
|
|
|
seriesNumber *interface{}
|
|
|
|
teamId *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
date *interface{}
|
|
|
|
startDate *interface{}
|
|
|
|
endDate *interface{}
|
|
|
|
useLatestGames *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
useFeaturedGame *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
season *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) GameTypes(gameTypes interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.gameTypes = &gameTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) SeriesNumber(seriesNumber interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.seriesNumber = &seriesNumber
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Team Identifier. Format: 141, 147, etc
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) TeamId(teamId interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.teamId = &teamId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique League Identifier
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) SportId(sportId interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date of Game. Format: YYYY-MM-DD
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) Date(date interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.date = &date
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Start date for range of data (must be used with end date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) StartDate(startDate interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.startDate = &startDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// End date for range of data (must be used with start date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) EndDate(endDate interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.endDate = &endDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) UseLatestGames(useLatestGames interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.useLatestGames = &useLatestGames
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) UseFeaturedGame(useFeaturedGame interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.useFeaturedGame = &useFeaturedGame
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) Season(season interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) Fields(fields interface{}) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiPostseasonScheduleSeriesRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.PostseasonScheduleSeriesExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
PostseasonScheduleSeries Get postseason series schedules
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
This endpoint allows you to pull postseason schedules
|
2025-04-06 23:39:04 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiPostseasonScheduleSeriesRequest
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *ScheduleAPIService) PostseasonScheduleSeries(ctx context.Context) ApiPostseasonScheduleSeriesRequest {
|
|
|
|
return ApiPostseasonScheduleSeriesRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) PostseasonScheduleSeriesExecute(r ApiPostseasonScheduleSeriesRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.PostseasonScheduleSeries")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule/postseason/series"
|
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.gameTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameTypes", r.gameTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.seriesNumber != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "seriesNumber", r.seriesNumber, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.teamId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "teamId", r.teamId, "", "")
|
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.date != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.startDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.endDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.useLatestGames != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useLatestGames", r.useLatestGames, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.useFeaturedGame != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useFeaturedGame", r.useFeaturedGame, "", "")
|
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 ApiScheduleRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *ScheduleAPIService
|
2025-04-06 23:39:04 +00:00
|
|
|
usingPrivateEndpoint *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
calendarTypes *interface{}
|
|
|
|
eventTypes *interface{}
|
|
|
|
scheduleEventTypes *interface{}
|
|
|
|
teamId *interface{}
|
|
|
|
leagueId *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
gamePk *interface{}
|
|
|
|
gamePks *interface{}
|
|
|
|
eventIds *interface{}
|
|
|
|
venueIds *interface{}
|
|
|
|
performerIds *interface{}
|
|
|
|
gameTypes *interface{}
|
|
|
|
gameType *interface{}
|
|
|
|
season *interface{}
|
|
|
|
seasons *interface{}
|
|
|
|
date *interface{}
|
|
|
|
startDate *interface{}
|
|
|
|
endDate *interface{}
|
|
|
|
timecode *interface{}
|
|
|
|
useLatestGames *interface{}
|
|
|
|
opponentId *interface{}
|
|
|
|
publicFacing *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiScheduleRequest) UsingPrivateEndpoint(usingPrivateEndpoint interface{}) ApiScheduleRequest {
|
|
|
|
r.usingPrivateEndpoint = &usingPrivateEndpoint
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of calendar types
|
|
|
|
func (r ApiScheduleRequest) CalendarTypes(calendarTypes interface{}) ApiScheduleRequest {
|
|
|
|
r.calendarTypes = &calendarTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of events. <b>Note: Don't Use. This will be deprecated in favor of calendarTypes</b>
|
|
|
|
func (r ApiScheduleRequest) EventTypes(eventTypes interface{}) ApiScheduleRequest {
|
|
|
|
r.eventTypes = &eventTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of event types
|
|
|
|
func (r ApiScheduleRequest) ScheduleEventTypes(scheduleEventTypes interface{}) ApiScheduleRequest {
|
|
|
|
r.scheduleEventTypes = &scheduleEventTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Team Identifier. Format: 141, 147, etc
|
|
|
|
func (r ApiScheduleRequest) TeamId(teamId interface{}) ApiScheduleRequest {
|
|
|
|
r.teamId = &teamId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique League Identifier
|
|
|
|
func (r ApiScheduleRequest) LeagueId(leagueId interface{}) ApiScheduleRequest {
|
|
|
|
r.leagueId = &leagueId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiScheduleRequest) SportId(sportId interface{}) ApiScheduleRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Primary Key Representing a Game
|
|
|
|
func (r ApiScheduleRequest) GamePk(gamePk interface{}) ApiScheduleRequest {
|
|
|
|
r.gamePk = &gamePk
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of unique primary keys
|
|
|
|
func (r ApiScheduleRequest) GamePks(gamePks interface{}) ApiScheduleRequest {
|
|
|
|
r.gamePks = &gamePks
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for non-game event
|
|
|
|
func (r ApiScheduleRequest) EventIds(eventIds interface{}) ApiScheduleRequest {
|
|
|
|
r.eventIds = &eventIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Venue Identifier
|
|
|
|
func (r ApiScheduleRequest) VenueIds(venueIds interface{}) ApiScheduleRequest {
|
|
|
|
r.venueIds = &venueIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for non-team event performers
|
|
|
|
func (r ApiScheduleRequest) PerformerIds(performerIds interface{}) ApiScheduleRequest {
|
|
|
|
r.performerIds = &performerIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiScheduleRequest) GameTypes(gameTypes interface{}) ApiScheduleRequest {
|
|
|
|
r.gameTypes = &gameTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiScheduleRequest) GameType(gameType interface{}) ApiScheduleRequest {
|
|
|
|
r.gameType = &gameType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiScheduleRequest) Season(season interface{}) ApiScheduleRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of Seasons of play
|
|
|
|
func (r ApiScheduleRequest) Seasons(seasons interface{}) ApiScheduleRequest {
|
|
|
|
r.seasons = &seasons
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date of Game. Format: YYYY-MM-DD
|
|
|
|
func (r ApiScheduleRequest) Date(date interface{}) ApiScheduleRequest {
|
|
|
|
r.date = &date
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Start date for range of data (must be used with end date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiScheduleRequest) StartDate(startDate interface{}) ApiScheduleRequest {
|
|
|
|
r.startDate = &startDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// End date for range of data (must be used with start date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiScheduleRequest) EndDate(endDate interface{}) ApiScheduleRequest {
|
|
|
|
r.endDate = &endDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Use this parameter to return a snapshot of the data at the specified time. Format: YYYYMMDD_HHMMSS
|
|
|
|
func (r ApiScheduleRequest) Timecode(timecode interface{}) ApiScheduleRequest {
|
|
|
|
r.timecode = &timecode
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiScheduleRequest) UseLatestGames(useLatestGames interface{}) ApiScheduleRequest {
|
|
|
|
r.useLatestGames = &useLatestGames
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for the opposing team. Must be used with Team ID
|
|
|
|
func (r ApiScheduleRequest) OpponentId(opponentId interface{}) ApiScheduleRequest {
|
|
|
|
r.opponentId = &opponentId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return public, non-public or all games. Format: Public Facing = 'Y', Non-Public Facing = 'N', All = 'A'
|
|
|
|
func (r ApiScheduleRequest) PublicFacing(publicFacing interface{}) ApiScheduleRequest {
|
|
|
|
r.publicFacing = &publicFacing
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiScheduleRequest) Fields(fields interface{}) ApiScheduleRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiScheduleRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.ScheduleExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Schedule View schedule info based on scheduleType.
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
View schedule info. This endpoint allows you to pull schedules
|
2025-04-06 23:39:04 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiScheduleRequest
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *ScheduleAPIService) Schedule(ctx context.Context) ApiScheduleRequest {
|
|
|
|
return ApiScheduleRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) ScheduleExecute(r ApiScheduleRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.Schedule")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule"
|
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.usingPrivateEndpoint == nil {
|
|
|
|
return nil, reportError("usingPrivateEndpoint is required and must be specified")
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.calendarTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "calendarTypes", r.calendarTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.eventTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "eventTypes", r.eventTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.scheduleEventTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "scheduleEventTypes", r.scheduleEventTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.teamId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "teamId", r.teamId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.leagueId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueId", r.leagueId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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.gamePk != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePk", r.gamePk, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gamePks != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePks", r.gamePks, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.eventIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "eventIds", r.eventIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.venueIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "venueIds", r.venueIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.performerIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "performerIds", r.performerIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameTypes", r.gameTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameType != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameType", r.gameType, "", "")
|
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.date != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.startDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.endDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.timecode != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "timecode", r.timecode, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.useLatestGames != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useLatestGames", r.useLatestGames, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.opponentId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "opponentId", r.opponentId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.publicFacing != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "publicFacing", r.publicFacing, "", "")
|
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
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "usingPrivateEndpoint", r.usingPrivateEndpoint, "", "")
|
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 ApiSchedule1Request struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *ScheduleAPIService
|
2025-04-06 23:39:04 +00:00
|
|
|
usingPrivateEndpoint *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
calendarTypes *interface{}
|
|
|
|
eventTypes *interface{}
|
|
|
|
scheduleEventTypes *interface{}
|
|
|
|
teamId *interface{}
|
|
|
|
leagueId *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
gamePk *interface{}
|
|
|
|
gamePks *interface{}
|
|
|
|
eventIds *interface{}
|
|
|
|
venueIds *interface{}
|
|
|
|
performerIds *interface{}
|
|
|
|
gameTypes *interface{}
|
|
|
|
gameType *interface{}
|
|
|
|
season *interface{}
|
|
|
|
seasons *interface{}
|
|
|
|
date *interface{}
|
|
|
|
startDate *interface{}
|
|
|
|
endDate *interface{}
|
|
|
|
timecode *interface{}
|
|
|
|
useLatestGames *interface{}
|
|
|
|
opponentId *interface{}
|
|
|
|
publicFacing *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiSchedule1Request) UsingPrivateEndpoint(usingPrivateEndpoint interface{}) ApiSchedule1Request {
|
|
|
|
r.usingPrivateEndpoint = &usingPrivateEndpoint
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of calendar types
|
|
|
|
func (r ApiSchedule1Request) CalendarTypes(calendarTypes interface{}) ApiSchedule1Request {
|
|
|
|
r.calendarTypes = &calendarTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of events. <b>Note: Don't Use. This will be deprecated in favor of calendarTypes</b>
|
|
|
|
func (r ApiSchedule1Request) EventTypes(eventTypes interface{}) ApiSchedule1Request {
|
|
|
|
r.eventTypes = &eventTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of event types
|
|
|
|
func (r ApiSchedule1Request) ScheduleEventTypes(scheduleEventTypes interface{}) ApiSchedule1Request {
|
|
|
|
r.scheduleEventTypes = &scheduleEventTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Team Identifier. Format: 141, 147, etc
|
|
|
|
func (r ApiSchedule1Request) TeamId(teamId interface{}) ApiSchedule1Request {
|
|
|
|
r.teamId = &teamId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique League Identifier
|
|
|
|
func (r ApiSchedule1Request) LeagueId(leagueId interface{}) ApiSchedule1Request {
|
|
|
|
r.leagueId = &leagueId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiSchedule1Request) SportId(sportId interface{}) ApiSchedule1Request {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Primary Key Representing a Game
|
|
|
|
func (r ApiSchedule1Request) GamePk(gamePk interface{}) ApiSchedule1Request {
|
|
|
|
r.gamePk = &gamePk
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of unique primary keys
|
|
|
|
func (r ApiSchedule1Request) GamePks(gamePks interface{}) ApiSchedule1Request {
|
|
|
|
r.gamePks = &gamePks
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for non-game event
|
|
|
|
func (r ApiSchedule1Request) EventIds(eventIds interface{}) ApiSchedule1Request {
|
|
|
|
r.eventIds = &eventIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Venue Identifier
|
|
|
|
func (r ApiSchedule1Request) VenueIds(venueIds interface{}) ApiSchedule1Request {
|
|
|
|
r.venueIds = &venueIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for non-team event performers
|
|
|
|
func (r ApiSchedule1Request) PerformerIds(performerIds interface{}) ApiSchedule1Request {
|
|
|
|
r.performerIds = &performerIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiSchedule1Request) GameTypes(gameTypes interface{}) ApiSchedule1Request {
|
|
|
|
r.gameTypes = &gameTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiSchedule1Request) GameType(gameType interface{}) ApiSchedule1Request {
|
|
|
|
r.gameType = &gameType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiSchedule1Request) Season(season interface{}) ApiSchedule1Request {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of Seasons of play
|
|
|
|
func (r ApiSchedule1Request) Seasons(seasons interface{}) ApiSchedule1Request {
|
|
|
|
r.seasons = &seasons
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date of Game. Format: YYYY-MM-DD
|
|
|
|
func (r ApiSchedule1Request) Date(date interface{}) ApiSchedule1Request {
|
|
|
|
r.date = &date
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Start date for range of data (must be used with end date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiSchedule1Request) StartDate(startDate interface{}) ApiSchedule1Request {
|
|
|
|
r.startDate = &startDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// End date for range of data (must be used with start date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiSchedule1Request) EndDate(endDate interface{}) ApiSchedule1Request {
|
|
|
|
r.endDate = &endDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Use this parameter to return a snapshot of the data at the specified time. Format: YYYYMMDD_HHMMSS
|
|
|
|
func (r ApiSchedule1Request) Timecode(timecode interface{}) ApiSchedule1Request {
|
|
|
|
r.timecode = &timecode
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiSchedule1Request) UseLatestGames(useLatestGames interface{}) ApiSchedule1Request {
|
|
|
|
r.useLatestGames = &useLatestGames
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for the opposing team. Must be used with Team ID
|
|
|
|
func (r ApiSchedule1Request) OpponentId(opponentId interface{}) ApiSchedule1Request {
|
|
|
|
r.opponentId = &opponentId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return public, non-public or all games. Format: Public Facing = 'Y', Non-Public Facing = 'N', All = 'A'
|
|
|
|
func (r ApiSchedule1Request) PublicFacing(publicFacing interface{}) ApiSchedule1Request {
|
|
|
|
r.publicFacing = &publicFacing
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiSchedule1Request) Fields(fields interface{}) ApiSchedule1Request {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiSchedule1Request) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.Schedule1Execute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Schedule1 View schedule info based on scheduleType.
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
View schedule info. This endpoint allows you to pull schedules
|
2025-04-06 23:39:04 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiSchedule1Request
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *ScheduleAPIService) Schedule1(ctx context.Context) ApiSchedule1Request {
|
|
|
|
return ApiSchedule1Request{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) Schedule1Execute(r ApiSchedule1Request) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.Schedule1")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule/{scheduleType}"
|
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.usingPrivateEndpoint == nil {
|
|
|
|
return nil, reportError("usingPrivateEndpoint is required and must be specified")
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.calendarTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "calendarTypes", r.calendarTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.eventTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "eventTypes", r.eventTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.scheduleEventTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "scheduleEventTypes", r.scheduleEventTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.teamId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "teamId", r.teamId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.leagueId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueId", r.leagueId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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.gamePk != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePk", r.gamePk, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gamePks != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePks", r.gamePks, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.eventIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "eventIds", r.eventIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.venueIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "venueIds", r.venueIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.performerIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "performerIds", r.performerIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameTypes", r.gameTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameType != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameType", r.gameType, "", "")
|
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.date != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.startDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.endDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.timecode != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "timecode", r.timecode, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.useLatestGames != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useLatestGames", r.useLatestGames, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.opponentId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "opponentId", r.opponentId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.publicFacing != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "publicFacing", r.publicFacing, "", "")
|
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
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "usingPrivateEndpoint", r.usingPrivateEndpoint, "", "")
|
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 ApiTieGamesRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *ScheduleAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
season *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
gameTypes *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiTieGamesRequest) Season(season interface{}) ApiTieGamesRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiTieGamesRequest) SportId(sportId interface{}) ApiTieGamesRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiTieGamesRequest) GameTypes(gameTypes interface{}) ApiTieGamesRequest {
|
|
|
|
r.gameTypes = &gameTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiTieGamesRequest) Fields(fields interface{}) ApiTieGamesRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiTieGamesRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.TieGamesExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
TieGames Get tied game schedules
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
This endpoint allows you to pull tie game schedules for the given season
|
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiTieGamesRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *ScheduleAPIService) TieGames(ctx context.Context) ApiTieGamesRequest {
|
|
|
|
return ApiTieGamesRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) TieGamesExecute(r ApiTieGamesRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.TieGames")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule/games/tied"
|
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 {
|
|
|
|
return nil, reportError("season is required and must be specified")
|
|
|
|
}
|
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.gameTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameTypes", r.gameTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "season", r.season, "", "")
|
|
|
|
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 ApiTrackingEventsScheduleRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *ScheduleAPIService
|
|
|
|
calendarTypes *interface{}
|
|
|
|
eventTypes *interface{}
|
|
|
|
teamId *interface{}
|
|
|
|
leagueId *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
gamePk *interface{}
|
|
|
|
gamePks *interface{}
|
|
|
|
eventIds *interface{}
|
|
|
|
venueIds *interface{}
|
|
|
|
performerIds *interface{}
|
|
|
|
gameTypes *interface{}
|
|
|
|
gameType *interface{}
|
|
|
|
season *interface{}
|
|
|
|
seasons *interface{}
|
|
|
|
date *interface{}
|
|
|
|
startDate *interface{}
|
|
|
|
endDate *interface{}
|
|
|
|
timecode *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
useLatestGames *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
opponentId *interface{}
|
|
|
|
publicFacing *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of calendar types
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) CalendarTypes(calendarTypes interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.calendarTypes = &calendarTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of events. <b>Note: Don't Use. This will be deprecated in favor of calendarTypes</b>
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) EventTypes(eventTypes interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.eventTypes = &eventTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Team Identifier. Format: 141, 147, etc
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) TeamId(teamId interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.teamId = &teamId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique League Identifier
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) LeagueId(leagueId interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.leagueId = &leagueId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) SportId(sportId interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Primary Key Representing a Game
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) GamePk(gamePk interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.gamePk = &gamePk
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of unique primary keys
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) GamePks(gamePks interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.gamePks = &gamePks
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for non-game event
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) EventIds(eventIds interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.eventIds = &eventIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Venue Identifier
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) VenueIds(venueIds interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.venueIds = &venueIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for non-team event performers
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) PerformerIds(performerIds interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.performerIds = &performerIds
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) GameTypes(gameTypes interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.gameTypes = &gameTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) GameType(gameType interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.gameType = &gameType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) Season(season interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of Seasons of play
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) Seasons(seasons interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.seasons = &seasons
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date of Game. Format: YYYY-MM-DD
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) Date(date interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.date = &date
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Start date for range of data (must be used with end date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) StartDate(startDate interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.startDate = &startDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// End date for range of data (must be used with start date). Format: MM/DD/YYYY
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) EndDate(endDate interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.endDate = &endDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Use this parameter to return a snapshot of the data at the specified time. Format: YYYYMMDD_HHMMSS
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) Timecode(timecode interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.timecode = &timecode
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) UseLatestGames(useLatestGames interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.useLatestGames = &useLatestGames
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// A unique identifier for the opposing team. Must be used with Team ID
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) OpponentId(opponentId interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.opponentId = &opponentId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return public, non-public or all games. Format: Public Facing = 'Y', Non-Public Facing = 'N', All = 'A'
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) PublicFacing(publicFacing interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.publicFacing = &publicFacing
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) Fields(fields interface{}) ApiTrackingEventsScheduleRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiTrackingEventsScheduleRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.TrackingEventsScheduleExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
TrackingEventsSchedule Get tracking event schedules
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
This endpoint allows you to pull schedules for tracking events
|
2025-04-06 23:39:04 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiTrackingEventsScheduleRequest
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *ScheduleAPIService) TrackingEventsSchedule(ctx context.Context) ApiTrackingEventsScheduleRequest {
|
|
|
|
return ApiTrackingEventsScheduleRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) TrackingEventsScheduleExecute(r ApiTrackingEventsScheduleRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.TrackingEventsSchedule")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule/trackingEvents"
|
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.calendarTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "calendarTypes", r.calendarTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.eventTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "eventTypes", r.eventTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.teamId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "teamId", r.teamId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.leagueId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "leagueId", r.leagueId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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.gamePk != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePk", r.gamePk, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gamePks != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePks", r.gamePks, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.eventIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "eventIds", r.eventIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.venueIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "venueIds", r.venueIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.performerIds != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "performerIds", r.performerIds, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameTypes != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameTypes", r.gameTypes, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameType != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameType", r.gameType, "", "")
|
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.date != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.startDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "startDate", r.startDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.endDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "endDate", r.endDate, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.timecode != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "timecode", r.timecode, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.useLatestGames != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "useLatestGames", r.useLatestGames, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.opponentId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "opponentId", r.opponentId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.publicFacing != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "publicFacing", r.publicFacing, "", "")
|
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 ApiTuneInRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *ScheduleAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
teamId *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
season *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Team Identifier. Format: 141, 147, etc
|
|
|
|
func (r ApiTuneInRequest) TeamId(teamId interface{}) ApiTuneInRequest {
|
|
|
|
r.teamId = &teamId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique League Identifier
|
|
|
|
func (r ApiTuneInRequest) SportId(sportId interface{}) ApiTuneInRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Primary Key Representing a Game
|
|
|
|
func (r ApiTuneInRequest) Season(season interface{}) ApiTuneInRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiTuneInRequest) Fields(fields interface{}) ApiTuneInRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiTuneInRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.TuneInExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
TuneIn Get postseason TuneIn schedules
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
This endpoint allows you to pull postseason schedules
|
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiTuneInRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *ScheduleAPIService) TuneIn(ctx context.Context) ApiTuneInRequest {
|
|
|
|
return ApiTuneInRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Execute executes the request
|
|
|
|
func (a *ScheduleAPIService) TuneInExecute(r ApiTuneInRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodGet
|
|
|
|
localVarPostBody interface{}
|
|
|
|
formFiles []formFile
|
2025-04-06 04:55:01 +00:00
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScheduleAPIService.TuneIn")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/schedule/postseason/tuneIn"
|
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.teamId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "teamId", r.teamId, "", "")
|
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.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
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|