Skip to content

Commit

Permalink
Merge pull request #94 from apivideo/sort-params-in-analytics
Browse files Browse the repository at this point in the history
Add sort parameters in analytics routes
  • Loading branch information
bot-api-video authored Sep 5, 2024
2 parents 5e2804c + 2cd95c9 commit bf92b63
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [1.4.1] - 2024-09-05
- Add sort parameters in analytics endpoints

## [1.4.0] - 2024-07-29
- Add new analytics methods
- Add livestream complete() method
Expand Down
72 changes: 72 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11682,6 +11682,42 @@ paths:
format: date-time
type: string
style: form
- description: |
Use this parameter to choose which field the API will use to sort the analytics data.

These are the available fields to sort by:

- `metricValue`: Sorts the results based on the **metric** you selected in your request.
- `dimensionValue`: Sorts the results based on the **dimension** you selected in your request.
example: metricValue
explode: false
in: query
name: sortBy
required: false
schema:
enum:
- metricValue
- dimensionValue
type: string
style: form
- description: |
Use this parameter to define the sort order of results.

These are the available sort orders:

- `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`.
- `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`.
example: asc
explode: false
in: query
name: sortOrder
required: false
schema:
enum:
- asc
- desc
type: string
style: form
- $ref: '#/components/parameters/filterBy_2'
description: "Use this parameter to filter the API's response based on different\
\ data dimensions. You can serialize filters in your query to receive more\
Expand Down Expand Up @@ -12124,6 +12160,42 @@ paths:
- day
type: string
style: form
- description: |
Use this parameter to choose which field the API will use to sort the analytics data.

These are the available fields to sort by:

- `metricValue`: Sorts the results based on the **metric** you selected in your request.
- `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format.
example: metricValue
explode: false
in: query
name: sortBy
required: false
schema:
enum:
- metricValue
- emittedAt
type: string
style: form
- description: |
Use this parameter to define the sort order of results.

These are the available sort orders:

- `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`.
- `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`.
example: asc
explode: false
in: query
name: sortOrder
required: false
schema:
enum:
- asc
- desc
type: string
style: form
- $ref: '#/components/parameters/filterBy_2'
description: "Use this parameter to filter the API's response based on different\
\ data dimensions. You can serialize filters in your query to receive more\
Expand Down
32 changes: 32 additions & 0 deletions api_analytics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (c *Client) prepareRequest(
req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue)
}

req.Header.Set("AV-Origin-Client", "go:1.4.0")
req.Header.Set("AV-Origin-Client", "go:1.4.1")

for headerName := range headerParams {
req.Header.Set(headerName, headerParams[headerName])
Expand Down Expand Up @@ -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.4.0")
req.Header.Set("AV-Origin-Client", "go:1.4.1")

resp, err := c.httpClient.Do(req)

Expand Down
Loading

0 comments on commit bf92b63

Please sign in to comment.