mlbstats/api/docs/SeasonAPI.md

7.3 KiB

\SeasonAPI

All URIs are relative to http://localhost

Method HTTP request Description
AllSeasons Get /api/v1/seasons/all View all seasons
Seasons Get /api/v1/seasons View season info
Seasons1 Get /api/v1/seasons/{seasonId} View season info

AllSeasons

AllSeasons(ctx).DivisionId(divisionId).LeagueId(leagueId).SportId(sportId).WithGameTypeDates(withGameTypeDates).Fields(fields).Execute()

View all seasons

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "//"
)

func main() {
	divisionId := TODO // interface{} | Unique Division Identifier (optional)
	leagueId := TODO // interface{} | Unique League Identifier (optional)
	sportId := TODO // interface{} | Top level organization of a sport (optional)
	withGameTypeDates := TODO // interface{} | Retrieve dates for each game type (optional)
	fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SeasonAPI.AllSeasons(context.Background()).DivisionId(divisionId).LeagueId(leagueId).SportId(sportId).WithGameTypeDates(withGameTypeDates).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SeasonAPI.AllSeasons``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAllSeasonsRequest struct via the builder pattern

Name Type Description Notes
divisionId interface{} Unique Division Identifier
leagueId interface{} Unique League Identifier
sportId interface{} Top level organization of a sport
withGameTypeDates interface{} Retrieve dates for each game type
fields interface{} Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Seasons

Seasons(ctx, seasonId).Season(season).SportId(sportId).WithGameTypeDates(withGameTypeDates).Fields(fields).Execute()

View season info

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "//"
)

func main() {
	seasonId := TODO // interface{} | Season of play
	season := TODO // interface{} | Season of play (optional)
	sportId := TODO // interface{} | Top level organization of a sport (optional)
	withGameTypeDates := TODO // interface{} | Retrieve dates for each game type (optional)
	fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SeasonAPI.Seasons(context.Background(), seasonId).Season(season).SportId(sportId).WithGameTypeDates(withGameTypeDates).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SeasonAPI.Seasons``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
seasonId interface{} Season of play

Other Parameters

Other parameters are passed through a pointer to a apiSeasonsRequest struct via the builder pattern

Name Type Description Notes

season | interface{} | Season of play | sportId | interface{} | Top level organization of a sport | withGameTypeDates | interface{} | Retrieve dates for each game type | fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Seasons1

Seasons1(ctx, seasonId).Season(season).SportId(sportId).WithGameTypeDates(withGameTypeDates).Fields(fields).Execute()

View season info

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "//"
)

func main() {
	seasonId := TODO // interface{} | Season of play
	season := TODO // interface{} | Season of play (optional)
	sportId := TODO // interface{} | Top level organization of a sport (optional)
	withGameTypeDates := TODO // interface{} | Retrieve dates for each game type (optional)
	fields := TODO // interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SeasonAPI.Seasons1(context.Background(), seasonId).Season(season).SportId(sportId).WithGameTypeDates(withGameTypeDates).Fields(fields).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SeasonAPI.Seasons1``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
seasonId interface{} Season of play

Other Parameters

Other parameters are passed through a pointer to a apiSeasons1Request struct via the builder pattern

Name Type Description Notes

season | interface{} | Season of play | sportId | interface{} | Top level organization of a sport | withGameTypeDates | interface{} | Retrieve dates for each game type | fields | interface{} | Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute |

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]