diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e65b9..d4c3aa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.2.6] - 2022-09-13 +- period parameter is now mandatory in analytics endpoints + ## [1.2.5] - 2022-07-05 - Add SDK origin header diff --git a/api/openapi.yaml b/api/openapi.yaml index a7ae891..31d7be9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -50,7 +50,7 @@ paths: schema: $ref: '#/components/schemas/bad-request' description: Bad Request - summary: Authenticate + summary: Advanced - Authenticate (1/2) tags: - Authentication x-client-action: authenticate @@ -125,7 +125,7 @@ paths: schema: $ref: '#/components/schemas/bad-request' description: Bad Request - summary: Refresh token + summary: Advanced - Refresh token (2/2) tags: - Authentication x-client-action: refresh @@ -973,6 +973,7 @@ paths: x-client-action: upload x-client-chunk-upload: true x-readme: + explorer-enabled: false code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -1855,6 +1856,7 @@ paths: Note: There may be a short delay before the new thumbnail is delivered to our CDN. x-client-action: uploadThumbnail x-readme: + explorer-enabled: false code-samples: - language: go code: "// First install the go client with \"go get github.com/apivideo/api.video-go-client\"\ @@ -7811,7 +7813,7 @@ paths: explode: true in: query name: period - required: false + required: true schema: format: period type: string @@ -8104,7 +8106,7 @@ paths: explode: true in: query name: period - required: false + required: true schema: format: period type: string diff --git a/api_authentication.go b/api_authentication.go index 6d6b2a1..10604a6 100644 --- a/api_authentication.go +++ b/api_authentication.go @@ -23,14 +23,14 @@ var ( type AuthenticationServiceI interface { /* - * Authenticate Authenticate + * Authenticate Advanced - Authenticate (1/2) * @return AuthenticationApiAuthenticateRequest */ Authenticate(authenticatePayload AuthenticatePayload) (*AccessToken, error) /* - * Authenticate Authenticate + * Authenticate Advanced - Authenticate (1/2) * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return AuthenticationApiAuthenticateRequest */ @@ -38,14 +38,14 @@ type AuthenticationServiceI interface { AuthenticateWithContext(ctx context.Context, authenticatePayload AuthenticatePayload) (*AccessToken, error) /* - * Refresh Refresh token + * Refresh Advanced - Refresh token (2/2) * @return AuthenticationApiRefreshRequest */ Refresh(refreshTokenPayload RefreshTokenPayload) (*AccessToken, error) /* - * Refresh Refresh token + * Refresh Advanced - Refresh token (2/2) * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @return AuthenticationApiRefreshRequest */ @@ -60,7 +60,7 @@ type AuthenticationService struct { } /* - * Authenticate Authenticate + * Authenticate Advanced - Authenticate (1/2) * To get started, submit your API key in the body of your request. api.video returns an access token that is valid for one hour (3600 seconds). A refresh token is also returned. View a [tutorial](https://api.video/blog/tutorials/authentication-tutorial) on authentication. All tutorials using the [authentication endpoint](https://api.video/blog/endpoints/authenticate) @@ -75,7 +75,7 @@ func (s *AuthenticationService) Authenticate(authenticatePayload AuthenticatePay } /* - * Authenticate Authenticate + * Authenticate Advanced - Authenticate (1/2) * To get started, submit your API key in the body of your request. api.video returns an access token that is valid for one hour (3600 seconds). A refresh token is also returned. View a [tutorial](https://api.video/blog/tutorials/authentication-tutorial) on authentication. All tutorials using the [authentication endpoint](https://api.video/blog/endpoints/authenticate) @@ -110,7 +110,7 @@ func (s *AuthenticationService) AuthenticateWithContext(ctx context.Context, aut } /* - * Refresh Refresh token + * Refresh Advanced - Refresh token (2/2) * Use the refresh endpoint with the refresh token you received when you first authenticated using the api-key endpoint. Send the refresh token in the body of your request. The api.video API returns a new access token that is valid for one hour (3600 seconds) and a new refresh token. @@ -125,7 +125,7 @@ func (s *AuthenticationService) Refresh(refreshTokenPayload RefreshTokenPayload) } /* - * Refresh Refresh token + * Refresh Advanced - Refresh token (2/2) * Use the refresh endpoint with the refresh token you received when you first authenticated using the api-key endpoint. Send the refresh token in the body of your request. The api.video API returns a new access token that is valid for one hour (3600 seconds) and a new refresh token. diff --git a/api_raw_statistics.go b/api_raw_statistics.go index 83e951f..537aa7f 100644 --- a/api_raw_statistics.go +++ b/api_raw_statistics.go @@ -167,9 +167,7 @@ func (s *RawStatisticsService) ListLiveStreamSessionsWithContext(ctx context.Con localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} - if r.period != nil { - localVarQueryParams.Add("period", parameterToString(*r.period, "")) - } + localVarQueryParams.Add("period", parameterToString(*r.period, "")) if r.currentPage != nil { localVarQueryParams.Add("currentPage", parameterToString(*r.currentPage, "")) } @@ -276,9 +274,7 @@ func (s *RawStatisticsService) ListVideoSessionsWithContext(ctx context.Context, localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} - if r.period != nil { - localVarQueryParams.Add("period", parameterToString(*r.period, "")) - } + localVarQueryParams.Add("period", parameterToString(*r.period, "")) if r.metadata != nil { if r.metadata != nil && len(*r.metadata) > 0 { for k, v := range *r.metadata { diff --git a/api_videos.go b/api_videos.go index b025b70..9207d0f 100644 --- a/api_videos.go +++ b/api_videos.go @@ -718,7 +718,6 @@ func (s *VideosService) UploadWithUploadTokenWithContext(ctx context.Context, to localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := make(map[string]string) - localVarQueryParams.Add("token", parameterToString(token, "")) requests, err := s.client.prepareRangeRequests(ctx, localVarPath, fileName, fileReader, fileSize, localVarHeaderParams, localVarQueryParams, localVarFormParams) diff --git a/client.go b/client.go index a89a63d..101797c 100644 --- a/client.go +++ b/client.go @@ -255,7 +255,7 @@ func (c *Client) prepareRequest( req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.2.5") + req.Header.Set("AV-Origin-Client", "go:1.2.6") for headerName := range headerParams { req.Header.Set(headerName, headerParams[headerName]) @@ -530,7 +530,7 @@ func (c *Client) auth(req *http.Request) (*http.Request, error) { req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.2.5") + req.Header.Set("AV-Origin-Client", "go:1.2.6") resp, err := c.httpClient.Do(req) diff --git a/docs/Authentication.md b/docs/Authentication.md index 1423425..08adaf5 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -4,8 +4,8 @@ All URIs are relative to *https://ws.api.video* Method | HTTP request | Description ------------- | ------------- | ------------- -[**Authenticate**](Authentication.md#Authenticate) | **Post** /auth/api-key | Authenticate -[**Refresh**](Authentication.md#Refresh) | **Post** /auth/refresh | Refresh token +[**Authenticate**](Authentication.md#Authenticate) | **Post** /auth/api-key | Advanced - Authenticate (1/2) +[**Refresh**](Authentication.md#Refresh) | **Post** /auth/refresh | Advanced - Refresh token (2/2) @@ -16,7 +16,7 @@ Method | HTTP request | Description > AuthenticateWithContext(ctx context.Context, authenticatePayload AuthenticatePayload) (*AccessToken, error) -Authenticate +Advanced - Authenticate (1/2) @@ -77,7 +77,7 @@ Name | Type | Description | Notes > RefreshWithContext(ctx context.Context, refreshTokenPayload RefreshTokenPayload) (*AccessToken, error) -Refresh token +Advanced - Refresh token (2/2)