2025-04-06 04:55:01 +00:00
|
|
|
/*
|
2025-04-07 02:59:20 +00:00
|
|
|
Copyright © 2025 filifa
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation, either version 3 of the License, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
Stats API Documentation
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
Official API for Major League Baseball.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
API version: 2.0.0
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
|
2025-04-06 04:55:01 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
2025-04-06 23:39:04 +00:00
|
|
|
"bytes"
|
2025-04-06 04:55:01 +00:00
|
|
|
"context"
|
2025-04-06 23:39:04 +00:00
|
|
|
"io"
|
2025-04-06 04:55:01 +00:00
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
// AnalyticsAPIService AnalyticsAPI service
|
|
|
|
type AnalyticsAPIService service
|
|
|
|
|
|
|
|
type ApiContextMetricsRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AnalyticsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
gamePk interface{}
|
|
|
|
guid interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiContextMetricsRequest) Fields(fields interface{}) ApiContextMetricsRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiContextMetricsRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.ContextMetricsExecute(r)
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
ContextMetrics Get context metrics for a specific gamePk.
|
|
|
|
|
|
|
|
Returns a json file containing raw coordinate data and refined calculated metrics.<br/><br/>This responses can be very large, so it is strongly recommended that you pass "Accept-Encoding: gzip" as a header to have the responses compressed.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param gamePk Unique Primary Key Representing a Game
|
|
|
|
@param guid Unique identifier for a play within a game
|
|
|
|
@return ApiContextMetricsRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AnalyticsAPIService) ContextMetrics(ctx context.Context, gamePk interface{}, guid interface{}) ApiContextMetricsRequest {
|
|
|
|
return ApiContextMetricsRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
gamePk: gamePk,
|
|
|
|
guid: guid,
|
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 *AnalyticsAPIService) ContextMetricsExecute(r ApiContextMetricsRequest) (*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, "AnalyticsAPIService.ContextMetrics")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/{gamePk}/{guid}/contextMetrics"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"gamePk"+"}", url.PathEscape(parameterValueToString(r.gamePk, "gamePk")), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"guid"+"}", url.PathEscape(parameterValueToString(r.guid, "guid")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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 ApiContextMetricsWithAveragesRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AnalyticsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
gamePk interface{}
|
|
|
|
guid interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiContextMetricsWithAveragesRequest) Fields(fields interface{}) ApiContextMetricsWithAveragesRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiContextMetricsWithAveragesRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.ContextMetricsWithAveragesExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
ContextMetricsWithAverages Get a json file containing raw coordinate data and refined calculated metrics.
|
|
|
|
|
|
|
|
Returns a json file containing raw coordinate data and refined calculated metrics.<br/><br/>This responses can be very large, so it is strongly recommended that you pass "Accept-Encoding: gzip" as a header to have the responses compressed.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param gamePk Unique Primary Key Representing a Game
|
|
|
|
@param guid Unique identifier for a play within a game
|
|
|
|
@return ApiContextMetricsWithAveragesRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AnalyticsAPIService) ContextMetricsWithAverages(ctx context.Context, gamePk interface{}, guid interface{}) ApiContextMetricsWithAveragesRequest {
|
|
|
|
return ApiContextMetricsWithAveragesRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
gamePk: gamePk,
|
|
|
|
guid: guid,
|
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 *AnalyticsAPIService) ContextMetricsWithAveragesExecute(r ApiContextMetricsWithAveragesRequest) (*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, "AnalyticsAPIService.ContextMetricsWithAverages")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/{gamePk}/{guid}/contextMetricsAverages"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"gamePk"+"}", url.PathEscape(parameterValueToString(r.gamePk, "gamePk")), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"guid"+"}", url.PathEscape(parameterValueToString(r.guid, "guid")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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 ApiContextMetricsWithAveragesPostRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AnalyticsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
gamePk interface{}
|
|
|
|
guid interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiContextMetricsWithAveragesPostRequest) Fields(fields interface{}) ApiContextMetricsWithAveragesPostRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiContextMetricsWithAveragesPostRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.ContextMetricsWithAveragesPostExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
ContextMetricsWithAveragesPost Get a json file containing raw coordinate data and refined calculated metrics.
|
|
|
|
|
|
|
|
Returns a json file containing raw coordinate data and refined calculated metrics.<br/><br/>This responses can be very large, so it is strongly recommended that you pass "Accept-Encoding: gzip" as a header to have the responses compressed.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param gamePk Unique Primary Key Representing a Game
|
|
|
|
@param guid Unique identifier for a play within a game
|
|
|
|
@return ApiContextMetricsWithAveragesPostRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AnalyticsAPIService) ContextMetricsWithAveragesPost(ctx context.Context, gamePk interface{}, guid interface{}) ApiContextMetricsWithAveragesPostRequest {
|
|
|
|
return ApiContextMetricsWithAveragesPostRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
gamePk: gamePk,
|
|
|
|
guid: guid,
|
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 *AnalyticsAPIService) ContextMetricsWithAveragesPostExecute(r ApiContextMetricsWithAveragesPostRequest) (*http.Response, error) {
|
2025-04-06 04:55:01 +00:00
|
|
|
var (
|
2025-04-07 02:14:30 +00:00
|
|
|
localVarHTTPMethod = http.MethodPost
|
|
|
|
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, "AnalyticsAPIService.ContextMetricsWithAveragesPost")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/{gamePk}/{guid}/contextMetricsAverages"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"gamePk"+"}", url.PathEscape(parameterValueToString(r.gamePk, "gamePk")), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"guid"+"}", url.PathEscape(parameterValueToString(r.guid, "guid")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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 ApiGameGuidsRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *AnalyticsAPIService
|
|
|
|
gamePk interface{}
|
|
|
|
fields *interface{}
|
|
|
|
gameModeId *interface{}
|
|
|
|
isPitch *interface{}
|
|
|
|
isHit *interface{}
|
|
|
|
isPickoff *interface{}
|
|
|
|
hasUpdates *interface{}
|
|
|
|
since *interface{}
|
|
|
|
updatedSince *interface{}
|
|
|
|
lastPlayTime *interface{}
|
|
|
|
lastUpdatedTime *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
lastMetricsUpdatedTime *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
lastAuditUpdatedTime *interface{}
|
|
|
|
lastVideoUpdatedTime *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiGameGuidsRequest) Fields(fields interface{}) ApiGameGuidsRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Statcast game mode. Format: 0 = Batting Practive, 1 = Warmup 2 = Live
|
|
|
|
func (r ApiGameGuidsRequest) GameModeId(gameModeId interface{}) ApiGameGuidsRequest {
|
|
|
|
r.gameModeId = &gameModeId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a pitch
|
|
|
|
func (r ApiGameGuidsRequest) IsPitch(isPitch interface{}) ApiGameGuidsRequest {
|
|
|
|
r.isPitch = &isPitch
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a hit ball tracked
|
|
|
|
func (r ApiGameGuidsRequest) IsHit(isHit interface{}) ApiGameGuidsRequest {
|
|
|
|
r.isHit = &isHit
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a pickoff
|
|
|
|
func (r ApiGameGuidsRequest) IsPickoff(isPickoff interface{}) ApiGameGuidsRequest {
|
|
|
|
r.isPickoff = &isPickoff
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// True if updated by an auditor
|
|
|
|
func (r ApiGameGuidsRequest) HasUpdates(hasUpdates interface{}) ApiGameGuidsRequest {
|
|
|
|
r.hasUpdates = &hasUpdates
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns all data that was created after the specified timestamp. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsRequest) Since(since interface{}) ApiGameGuidsRequest {
|
|
|
|
r.since = &since
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsRequest) UpdatedSince(updatedSince interface{}) ApiGameGuidsRequest {
|
|
|
|
r.updatedSince = &updatedSince
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns all data that was created after the specified timestamp. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsRequest) LastPlayTime(lastPlayTime interface{}) ApiGameGuidsRequest {
|
|
|
|
r.lastPlayTime = &lastPlayTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsRequest) LastUpdatedTime(lastUpdatedTime interface{}) ApiGameGuidsRequest {
|
|
|
|
r.lastUpdatedTime = &lastUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsRequest) LastMetricsUpdatedTime(lastMetricsUpdatedTime interface{}) ApiGameGuidsRequest {
|
|
|
|
r.lastMetricsUpdatedTime = &lastMetricsUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsRequest) LastAuditUpdatedTime(lastAuditUpdatedTime interface{}) ApiGameGuidsRequest {
|
|
|
|
r.lastAuditUpdatedTime = &lastAuditUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// The last time SportyBot video was updated
|
|
|
|
func (r ApiGameGuidsRequest) LastVideoUpdatedTime(lastVideoUpdatedTime interface{}) ApiGameGuidsRequest {
|
|
|
|
r.lastVideoUpdatedTime = &lastVideoUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiGameGuidsRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.GameGuidsExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-07 02:14:30 +00:00
|
|
|
GameGuids Get the GUIDs (plays) for a specific game.
|
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().
|
|
|
|
@param gamePk Unique Primary Key Representing a Game
|
|
|
|
@return ApiGameGuidsRequest
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *AnalyticsAPIService) GameGuids(ctx context.Context, gamePk interface{}) ApiGameGuidsRequest {
|
|
|
|
return ApiGameGuidsRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
gamePk: gamePk,
|
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 *AnalyticsAPIService) GameGuidsExecute(r ApiGameGuidsRequest) (*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, "AnalyticsAPIService.GameGuids")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/{gamePk}/guids"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"gamePk"+"}", url.PathEscape(parameterValueToString(r.gamePk, "gamePk")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.fields != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameModeId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameModeId", r.gameModeId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isPitch != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isPitch", r.isPitch, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isHit != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isHit", r.isHit, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isPickoff != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isPickoff", r.isPickoff, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.hasUpdates != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "hasUpdates", r.hasUpdates, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.since != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "since", r.since, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.updatedSince != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "updatedSince", r.updatedSince, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastPlayTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastPlayTime", r.lastPlayTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastUpdatedTime", r.lastUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastMetricsUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastMetricsUpdatedTime", r.lastMetricsUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastAuditUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastAuditUpdatedTime", r.lastAuditUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastVideoUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastVideoUpdatedTime", r.lastVideoUpdatedTime, "", "")
|
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 ApiGameGuidsFromPostgresRangeRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *AnalyticsAPIService
|
|
|
|
fields *interface{}
|
|
|
|
gameModeId *interface{}
|
|
|
|
isPitch *interface{}
|
|
|
|
isHit *interface{}
|
|
|
|
isPickoff *interface{}
|
|
|
|
isNonStatcast *interface{}
|
|
|
|
gamedayType *interface{}
|
|
|
|
hasUpdates *interface{}
|
|
|
|
lastPlayTime *interface{}
|
|
|
|
lastUpdatedTime *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
lastMetricsUpdatedTime *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
lastAuditUpdatedTime *interface{}
|
|
|
|
lastVideoUpdatedTime *interface{}
|
|
|
|
gameDate *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
gameType *interface{}
|
|
|
|
trackingSystemOwner *interface{}
|
|
|
|
season *interface{}
|
|
|
|
sortBy *interface{}
|
|
|
|
limit *interface{}
|
|
|
|
offset *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) Fields(fields interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Statcast game mode. Format: 0 = Batting Practive, 1 = Warmup 2 = Live
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) GameModeId(gameModeId interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.gameModeId = &gameModeId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a pitch
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) IsPitch(isPitch interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.isPitch = &isPitch
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a hit ball tracked
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) IsHit(isHit interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.isHit = &isHit
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a pickoff
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) IsPickoff(isPickoff interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.isPickoff = &isPickoff
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If non statcast games need to be included
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) IsNonStatcast(isNonStatcast interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.isNonStatcast = &isNonStatcast
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Indicates the level of Gameday (tracking, play-by-play, linescore, etc...)
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) GamedayType(gamedayType interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.gamedayType = &gamedayType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// True if updated by an auditor
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) HasUpdates(hasUpdates interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.hasUpdates = &hasUpdates
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns all data that was created after the specified timestamp. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) LastPlayTime(lastPlayTime interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.lastPlayTime = &lastPlayTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) LastUpdatedTime(lastUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.lastUpdatedTime = &lastUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) LastMetricsUpdatedTime(lastMetricsUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.lastMetricsUpdatedTime = &lastMetricsUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) LastAuditUpdatedTime(lastAuditUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.lastAuditUpdatedTime = &lastAuditUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// The last time SportyBot video was updated
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) LastVideoUpdatedTime(lastVideoUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.lastVideoUpdatedTime = &lastVideoUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date of Game. Format: YYYY-MM-DD
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) GameDate(gameDate interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.gameDate = &gameDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) SportId(sportId interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) GameType(gameType interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.gameType = &gameType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Owner of the tracking system
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) TrackingSystemOwner(trackingSystemOwner interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.trackingSystemOwner = &trackingSystemOwner
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) Season(season interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sort the set of data by the specified field
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) SortBy(sortBy interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.sortBy = &sortBy
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Number of results to return
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) Limit(limit interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.limit = &limit
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// The pointer to start for a return set; used for pagination
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) Offset(offset interface{}) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
r.offset = &offset
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.GameGuidsFromPostgresRangeExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-07 02:14:30 +00:00
|
|
|
GameGuidsFromPostgresRange Get the GUIDs (plays) for a specific game.
|
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 ApiGameGuidsFromPostgresRangeRequest
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *AnalyticsAPIService) GameGuidsFromPostgresRange(ctx context.Context) ApiGameGuidsFromPostgresRangeRequest {
|
|
|
|
return ApiGameGuidsFromPostgresRangeRequest{
|
|
|
|
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 *AnalyticsAPIService) GameGuidsFromPostgresRangeExecute(r ApiGameGuidsFromPostgresRangeRequest) (*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, "AnalyticsAPIService.GameGuidsFromPostgresRange")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/analytics/guids"
|
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.fields != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameModeId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameModeId", r.gameModeId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isPitch != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isPitch", r.isPitch, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isHit != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isHit", r.isHit, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isPickoff != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isPickoff", r.isPickoff, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isNonStatcast != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isNonStatcast", r.isNonStatcast, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gamedayType != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamedayType", r.gamedayType, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.hasUpdates != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "hasUpdates", r.hasUpdates, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastPlayTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastPlayTime", r.lastPlayTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastUpdatedTime", r.lastUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastMetricsUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastMetricsUpdatedTime", r.lastMetricsUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastAuditUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastAuditUpdatedTime", r.lastAuditUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastVideoUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastVideoUpdatedTime", r.lastVideoUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameDate", r.gameDate, "", "")
|
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.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.trackingSystemOwner != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "trackingSystemOwner", r.trackingSystemOwner, "", "")
|
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.sortBy != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.limit != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.offset != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "", "")
|
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 ApiGameGuidsFromPostgresRangeByGameRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *AnalyticsAPIService
|
|
|
|
fields *interface{}
|
|
|
|
gameModeId *interface{}
|
|
|
|
isPitch *interface{}
|
|
|
|
isHit *interface{}
|
|
|
|
isPickoff *interface{}
|
|
|
|
isNonStatcast *interface{}
|
|
|
|
gamedayType *interface{}
|
|
|
|
hasUpdates *interface{}
|
|
|
|
lastPlayTime *interface{}
|
|
|
|
lastVideoUpdatedTime *interface{}
|
|
|
|
lastUpdatedTime *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
lastMetricsUpdatedTime *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
lastAuditUpdatedTime *interface{}
|
|
|
|
gameDate *interface{}
|
|
|
|
sportId *interface{}
|
|
|
|
gameType *interface{}
|
|
|
|
season *interface{}
|
|
|
|
trackingSystemOwner *interface{}
|
|
|
|
sortBy *interface{}
|
|
|
|
limit *interface{}
|
|
|
|
offset *interface{}
|
|
|
|
scheduleEventTypes *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) Fields(fields interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Statcast game mode. Format: 0 = Batting Practive, 1 = Warmup 2 = Live
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) GameModeId(gameModeId interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.gameModeId = &gameModeId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a pitch
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) IsPitch(isPitch interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.isPitch = &isPitch
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a hit ball tracked
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) IsHit(isHit interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.isHit = &isHit
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If there was a pickoff
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) IsPickoff(isPickoff interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.isPickoff = &isPickoff
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// If non statcast games need to be included
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) IsNonStatcast(isNonStatcast interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.isNonStatcast = &isNonStatcast
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Indicates the level of Gameday (tracking, play-by-play, linescore, etc...)
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) GamedayType(gamedayType interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.gamedayType = &gamedayType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// True if updated by an auditor
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) HasUpdates(hasUpdates interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.hasUpdates = &hasUpdates
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns all data that was created after the specified timestamp. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) LastPlayTime(lastPlayTime interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.lastPlayTime = &lastPlayTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// The last time SportyBot video was updated
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) LastVideoUpdatedTime(lastVideoUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.lastVideoUpdatedTime = &lastVideoUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) LastUpdatedTime(lastUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.lastUpdatedTime = &lastUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) LastMetricsUpdatedTime(lastMetricsUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.lastMetricsUpdatedTime = &lastMetricsUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return data updated since a specified date. Format: YYYY-MM-DDTHH:MM:SSZ
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) LastAuditUpdatedTime(lastAuditUpdatedTime interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.lastAuditUpdatedTime = &lastAuditUpdatedTime
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Date of Game. Format: YYYY-MM-DD
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) GameDate(gameDate interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.gameDate = &gameDate
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level organization of a sport
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) SportId(sportId interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.sportId = &sportId
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Type of Game. Available types in /api/v1/gameTypes
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) GameType(gameType interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.gameType = &gameType
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Season of play
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) Season(season interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.season = &season
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Owner of the tracking system
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) TrackingSystemOwner(trackingSystemOwner interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.trackingSystemOwner = &trackingSystemOwner
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sort the set of data by the specified field
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) SortBy(sortBy interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.sortBy = &sortBy
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Number of results to return
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) Limit(limit interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.limit = &limit
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// The pointer to start for a return set; used for pagination
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) Offset(offset interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.offset = &offset
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of type of event types
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) ScheduleEventTypes(scheduleEventTypes interface{}) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
r.scheduleEventTypes = &scheduleEventTypes
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiGameGuidsFromPostgresRangeByGameRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.GameGuidsFromPostgresRangeByGameExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
GameGuidsFromPostgresRangeByGame Get all games by updated date.
|
|
|
|
|
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 ApiGameGuidsFromPostgresRangeByGameRequest
|
2025-04-06 04:55:01 +00:00
|
|
|
*/
|
2025-04-06 23:39:04 +00:00
|
|
|
func (a *AnalyticsAPIService) GameGuidsFromPostgresRangeByGame(ctx context.Context) ApiGameGuidsFromPostgresRangeByGameRequest {
|
|
|
|
return ApiGameGuidsFromPostgresRangeByGameRequest{
|
|
|
|
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 *AnalyticsAPIService) GameGuidsFromPostgresRangeByGameExecute(r ApiGameGuidsFromPostgresRangeByGameRequest) (*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, "AnalyticsAPIService.GameGuidsFromPostgresRangeByGame")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/analytics/game"
|
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.fields != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameModeId != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameModeId", r.gameModeId, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isPitch != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isPitch", r.isPitch, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isHit != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isHit", r.isHit, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isPickoff != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isPickoff", r.isPickoff, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isNonStatcast != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isNonStatcast", r.isNonStatcast, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gamedayType != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamedayType", r.gamedayType, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.hasUpdates != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "hasUpdates", r.hasUpdates, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastPlayTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastPlayTime", r.lastPlayTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastVideoUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastVideoUpdatedTime", r.lastVideoUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastUpdatedTime", r.lastUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastMetricsUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastMetricsUpdatedTime", r.lastMetricsUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.lastAuditUpdatedTime != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "lastAuditUpdatedTime", r.lastAuditUpdatedTime, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.gameDate != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gameDate", r.gameDate, "", "")
|
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.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.trackingSystemOwner != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "trackingSystemOwner", r.trackingSystemOwner, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.sortBy != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.limit != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "", "")
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.offset != nil {
|
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "", "")
|
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
|
|
|
}
|
|
|
|
// 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 ApiGameLastPitchRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AnalyticsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
gamePks *interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Unique Primary Key Representing a Game
|
|
|
|
func (r ApiGameLastPitchRequest) GamePks(gamePks interface{}) ApiGameLastPitchRequest {
|
|
|
|
r.gamePks = &gamePks
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiGameLastPitchRequest) Fields(fields interface{}) ApiGameLastPitchRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiGameLastPitchRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.GameLastPitchExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
GameLastPitch Get the last pitch for a list of games
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@return ApiGameLastPitchRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AnalyticsAPIService) GameLastPitch(ctx context.Context) ApiGameLastPitchRequest {
|
|
|
|
return ApiGameLastPitchRequest{
|
|
|
|
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 *AnalyticsAPIService) GameLastPitchExecute(r ApiGameLastPitchRequest) (*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, "AnalyticsAPIService.GameLastPitch")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/lastPitch"
|
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.gamePks == nil {
|
|
|
|
return nil, reportError("gamePks is required and must be specified")
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "gamePks", r.gamePks, "", "")
|
|
|
|
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 ApiHomeRunBallparksRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
|
|
|
ApiService *AnalyticsAPIService
|
|
|
|
gamePk interface{}
|
|
|
|
guid interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
isHomeRunParks *interface{}
|
2025-04-07 02:14:30 +00:00
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiHomeRunBallparksRequest) IsHomeRunParks(isHomeRunParks interface{}) ApiHomeRunBallparksRequest {
|
|
|
|
r.isHomeRunParks = &isHomeRunParks
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiHomeRunBallparksRequest) Fields(fields interface{}) ApiHomeRunBallparksRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiHomeRunBallparksRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.HomeRunBallparksExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
HomeRunBallparks Get if the play is a home run is each park for a specific play.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
Returns a json file containing raw coordinate data and refined calculated metrics.<br/><br/>This responses can be very large, so it is strongly recommended that you pass "Accept-Encoding: gzip" as a header to have the responses compressed.
|
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param gamePk Unique Primary Key Representing a Game
|
|
|
|
@param guid Unique identifier for a play within a game
|
|
|
|
@return ApiHomeRunBallparksRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AnalyticsAPIService) HomeRunBallparks(ctx context.Context, gamePk interface{}, guid interface{}) ApiHomeRunBallparksRequest {
|
|
|
|
return ApiHomeRunBallparksRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
gamePk: gamePk,
|
|
|
|
guid: guid,
|
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 *AnalyticsAPIService) HomeRunBallparksExecute(r ApiHomeRunBallparksRequest) (*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, "AnalyticsAPIService.HomeRunBallparks")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/{gamePk}/{guid}/homeRunBallparks"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"gamePk"+"}", url.PathEscape(parameterValueToString(r.gamePk, "gamePk")), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"guid"+"}", url.PathEscape(parameterValueToString(r.guid, "guid")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.isHomeRunParks == nil {
|
|
|
|
return nil, reportError("isHomeRunParks is required and must be specified")
|
|
|
|
}
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
parameterAddToHeaderOrQuery(localVarQueryParams, "isHomeRunParks", r.isHomeRunParks, "", "")
|
|
|
|
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 ApiParsedJsonFormattedAnalyticsRequest struct {
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx context.Context
|
2025-04-06 23:39:04 +00:00
|
|
|
ApiService *AnalyticsAPIService
|
2025-04-07 02:14:30 +00:00
|
|
|
gamePk interface{}
|
|
|
|
guid interface{}
|
|
|
|
fields *interface{}
|
2025-04-06 23:39:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Comma delimited list of specific fields to be returned. Format: topLevelNode, childNode, attribute
|
|
|
|
func (r ApiParsedJsonFormattedAnalyticsRequest) Fields(fields interface{}) ApiParsedJsonFormattedAnalyticsRequest {
|
|
|
|
r.fields = &fields
|
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r ApiParsedJsonFormattedAnalyticsRequest) Execute() (*http.Response, error) {
|
|
|
|
return r.ApiService.ParsedJsonFormattedAnalyticsExecute(r)
|
2025-04-06 04:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2025-04-06 23:39:04 +00:00
|
|
|
ParsedJsonFormattedAnalytics Get Statcast data for a specific play.
|
2025-04-06 04:55:01 +00:00
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
Returns a json file containing raw coordinate data and refined calculated metrics.<br/><br/>This responses can be very large, so it is strongly recommended that you pass "Accept-Encoding: gzip" as a header to have the responses compressed.
|
|
|
|
|
2025-04-07 02:14:30 +00:00
|
|
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
|
|
@param gamePk Unique Primary Key Representing a Game
|
|
|
|
@param guid Unique identifier for a play within a game
|
|
|
|
@return ApiParsedJsonFormattedAnalyticsRequest
|
2025-04-06 23:39:04 +00:00
|
|
|
*/
|
|
|
|
func (a *AnalyticsAPIService) ParsedJsonFormattedAnalytics(ctx context.Context, gamePk interface{}, guid interface{}) ApiParsedJsonFormattedAnalyticsRequest {
|
|
|
|
return ApiParsedJsonFormattedAnalyticsRequest{
|
|
|
|
ApiService: a,
|
2025-04-07 02:14:30 +00:00
|
|
|
ctx: ctx,
|
|
|
|
gamePk: gamePk,
|
|
|
|
guid: guid,
|
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 *AnalyticsAPIService) ParsedJsonFormattedAnalyticsExecute(r ApiParsedJsonFormattedAnalyticsRequest) (*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, "AnalyticsAPIService.ParsedJsonFormattedAnalytics")
|
|
|
|
if err != nil {
|
|
|
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
|
|
}
|
|
|
|
|
|
|
|
localVarPath := localBasePath + "/api/v1/game/{gamePk}/{guid}/analytics"
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"gamePk"+"}", url.PathEscape(parameterValueToString(r.gamePk, "gamePk")), -1)
|
|
|
|
localVarPath = strings.Replace(localVarPath, "{"+"guid"+"}", url.PathEscape(parameterValueToString(r.guid, "guid")), -1)
|
2025-04-06 04:55:01 +00:00
|
|
|
|
|
|
|
localVarHeaderParams := make(map[string]string)
|
|
|
|
localVarQueryParams := url.Values{}
|
|
|
|
localVarFormParams := url.Values{}
|
|
|
|
|
2025-04-06 23:39:04 +00:00
|
|
|
if r.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
|
|
|
}
|