Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new analytics endpoints & livestream complete() #82

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ Sources/JSONEncodingHelper.swift
Sources/Models.swift
Sources/Models/AccessToken.swift
Sources/Models/AdditionalBadRequestErrors.swift
Sources/Models/AnalyticsAggregatedMetricsResponse.swift
Sources/Models/AnalyticsAggregatedMetricsResponseContext.swift
Sources/Models/AnalyticsAggregatedMetricsResponseContextTimeframe.swift
Sources/Models/AnalyticsData.swift
Sources/Models/AnalyticsMetricsBreakdownResponse.swift
Sources/Models/AnalyticsMetricsBreakdownResponseContext.swift
Sources/Models/AnalyticsMetricsBreakdownResponseData.swift
Sources/Models/AnalyticsMetricsOverTimeResponse.swift
Sources/Models/AnalyticsMetricsOverTimeResponseContext.swift
Sources/Models/AnalyticsMetricsOverTimeResponseData.swift
Sources/Models/AnalyticsPlays400Error.swift
Sources/Models/AnalyticsPlaysResponse.swift
Sources/Models/AuthenticatePayload.swift
Expand All @@ -38,17 +47,14 @@ Sources/Models/CaptionsUpdatePayload.swift
Sources/Models/Chapter.swift
Sources/Models/ChaptersListResponse.swift
Sources/Models/Environment.swift
Sources/Models/FilterBy.swift
Sources/Models/FilterBy1.swift
Sources/Models/FilterBy2.swift
Sources/Models/Link.swift
Sources/Models/LiveStream.swift
Sources/Models/LiveStreamAssets.swift
Sources/Models/LiveStreamCreationPayload.swift
Sources/Models/LiveStreamListResponse.swift
Sources/Models/LiveStreamSession.swift
Sources/Models/LiveStreamSessionClient.swift
Sources/Models/LiveStreamSessionDevice.swift
Sources/Models/LiveStreamSessionLocation.swift
Sources/Models/LiveStreamSessionReferrer.swift
Sources/Models/LiveStreamSessionSession.swift
Sources/Models/LiveStreamUpdatePayload.swift
Sources/Models/Metadata.swift
Sources/Models/Model403ErrorSchema.swift
Expand All @@ -69,18 +75,12 @@ Sources/Models/RestreamsResponseObject.swift
Sources/Models/TokenCreationPayload.swift
Sources/Models/TokenListResponse.swift
Sources/Models/TooManyRequests.swift
Sources/Models/UnrecognizedRequestUrl.swift
Sources/Models/UploadToken.swift
Sources/Models/Video.swift
Sources/Models/VideoAssets.swift
Sources/Models/VideoClip.swift
Sources/Models/VideoCreationPayload.swift
Sources/Models/VideoSession.swift
Sources/Models/VideoSessionClient.swift
Sources/Models/VideoSessionDevice.swift
Sources/Models/VideoSessionLocation.swift
Sources/Models/VideoSessionOs.swift
Sources/Models/VideoSessionReferrer.swift
Sources/Models/VideoSessionSession.swift
Sources/Models/VideoSource.swift
Sources/Models/VideoSourceLiveStream.swift
Sources/Models/VideoSourceLiveStreamLink.swift
Expand Down Expand Up @@ -108,7 +108,16 @@ docs/AccessToken.md
docs/AdditionalBadRequestErrors.md
docs/AdvancedAuthenticationAPI.md
docs/AnalyticsAPI.md
docs/AnalyticsAggregatedMetricsResponse.md
docs/AnalyticsAggregatedMetricsResponseContext.md
docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md
docs/AnalyticsData.md
docs/AnalyticsMetricsBreakdownResponse.md
docs/AnalyticsMetricsBreakdownResponseContext.md
docs/AnalyticsMetricsBreakdownResponseData.md
docs/AnalyticsMetricsOverTimeResponse.md
docs/AnalyticsMetricsOverTimeResponseContext.md
docs/AnalyticsMetricsOverTimeResponseData.md
docs/AnalyticsPlays400Error.md
docs/AnalyticsPlaysResponse.md
docs/AuthenticatePayload.md
Expand All @@ -121,17 +130,14 @@ docs/CaptionsUpdatePayload.md
docs/Chapter.md
docs/ChaptersAPI.md
docs/ChaptersListResponse.md
docs/FilterBy.md
docs/FilterBy1.md
docs/FilterBy2.md
docs/Link.md
docs/LiveStream.md
docs/LiveStreamAssets.md
docs/LiveStreamCreationPayload.md
docs/LiveStreamListResponse.md
docs/LiveStreamSession.md
docs/LiveStreamSessionClient.md
docs/LiveStreamSessionDevice.md
docs/LiveStreamSessionLocation.md
docs/LiveStreamSessionReferrer.md
docs/LiveStreamSessionSession.md
docs/LiveStreamUpdatePayload.md
docs/LiveStreamsAPI.md
docs/Metadata.md
Expand All @@ -153,19 +159,13 @@ docs/RestreamsResponseObject.md
docs/TokenCreationPayload.md
docs/TokenListResponse.md
docs/TooManyRequests.md
docs/UnrecognizedRequestUrl.md
docs/UploadToken.md
docs/UploadTokensAPI.md
docs/Video.md
docs/VideoAssets.md
docs/VideoClip.md
docs/VideoCreationPayload.md
docs/VideoSession.md
docs/VideoSessionClient.md
docs/VideoSessionDevice.md
docs/VideoSessionLocation.md
docs/VideoSessionOs.md
docs/VideoSessionReferrer.md
docs/VideoSessionSession.md
docs/VideoSource.md
docs/VideoSourceLiveStream.md
docs/VideoSourceLiveStreamLink.md
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/oas_apivideo.yaml-defaut-cli.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d7b342ceb1a4805da9e3d6355384e34c1a99e1300d01cac3ae3218c5738f11f1
3637a70fc3b7f045b2927373115f2132767e3ea4ee8f19f7ffd324bb9f8eb7bf
4 changes: 2 additions & 2 deletions ApiVideoClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = '10.0'
# Add back when CocoaPods/CocoaPods#11558 is released
#s.watchos.deployment_target = '3.0'
s.version = '1.2.3'
s.source = { :git => 'https://github.com/apivideo/api.video-swift-client', :tag => 'v1.2.3' }
s.version = '1.3.0'
s.source = { :git => 'https://github.com/apivideo/api.video-swift-client', :tag => 'v1.3.0' }
s.authors = { 'Ecosystem Team' => '[email protected]' }
s.license = { :type => 'MIT' }
s.homepage = 'https://docs.api.video'
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All changes to this project will be documented in this file.

## [1.3.0] - 2024-07-29
- Add new analytics methods
- Add livestream complete() method

## [1.2.3] - 2024-04-25
- Add API to get rate limiting headers

Expand Down
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ api.video's Swift API client for iOS, macOS and tvOS streamlines the coding proc
Specify it in your `Cartfile`:

```
github "apivideo/api.video-swift-client" ~> 1.2.3
github "apivideo/api.video-swift-client" ~> 1.3.0
```

Run `carthage update`

#### CocoaPods

Add `pod 'ApiVideoClient', '1.2.3'` in your `Podfile`
Add `pod 'ApiVideoClient', '1.3.0'` in your `Podfile`

Run `pod install`

Expand Down Expand Up @@ -104,8 +104,9 @@ AnalyticsAPI

Method | HTTP request | Description
------------- | ------------- | -------------
[**getLiveStreamsPlays**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getLiveStreamsPlays) | **GET** `/analytics/live-streams/plays` | Get play events for live stream
[**getVideosPlays**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getVideosPlays) | **GET** `/analytics/videos/plays` | Get play events for video
[**getAggregatedMetrics**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getAggregatedMetrics) | **GET** `/data/metrics/{metric}/{aggregation}` | Retrieve aggregated metrics
[**getMetricsBreakdown**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getMetricsBreakdown) | **GET** `/data/buckets/{metric}/{breakdown}` | Retrieve metrics in a breakdown of dimensions
[**getMetricsOverTime**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getMetricsOverTime) | **GET** `/data/timeseries/{metric}` | Retrieve metrics over time


#### CaptionsAPI
Expand Down Expand Up @@ -164,6 +165,7 @@ Method | HTTP request | Description
[**list**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#list) | **GET** `/live-streams` | List all live streams
[**uploadThumbnail**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#uploadThumbnail) | **POST** `/live-streams/{liveStreamId}/thumbnail` | Upload a thumbnail
[**deleteThumbnail**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#deleteThumbnail) | **DELETE** `/live-streams/{liveStreamId}/thumbnail` | Delete a thumbnail
[**complete**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#complete) | **PUT** `/live-streams/{liveStreamId}/complete` | Complete a live stream


#### PlayerThemesAPI
Expand Down Expand Up @@ -269,7 +271,16 @@ Method | HTTP request | Description

- [AccessToken](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AccessToken.md)
- [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AdditionalBadRequestErrors.md)
- [AnalyticsAggregatedMetricsResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAggregatedMetricsResponse.md)
- [AnalyticsAggregatedMetricsResponseContext](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContext.md)
- [AnalyticsAggregatedMetricsResponseContextTimeframe](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md)
- [AnalyticsData](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsData.md)
- [AnalyticsMetricsBreakdownResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsBreakdownResponse.md)
- [AnalyticsMetricsBreakdownResponseContext](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsBreakdownResponseContext.md)
- [AnalyticsMetricsBreakdownResponseData](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsBreakdownResponseData.md)
- [AnalyticsMetricsOverTimeResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsOverTimeResponse.md)
- [AnalyticsMetricsOverTimeResponseContext](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsOverTimeResponseContext.md)
- [AnalyticsMetricsOverTimeResponseData](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsOverTimeResponseData.md)
- [AnalyticsPlays400Error](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsPlays400Error.md)
- [AnalyticsPlaysResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsPlaysResponse.md)
- [AuthenticatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AuthenticatePayload.md)
Expand All @@ -280,17 +291,14 @@ Method | HTTP request | Description
- [CaptionsUpdatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/CaptionsUpdatePayload.md)
- [Chapter](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Chapter.md)
- [ChaptersListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/ChaptersListResponse.md)
- [FilterBy](https://github.com/apivideo/api.video-swift-client/blob/main/docs/FilterBy.md)
- [FilterBy1](https://github.com/apivideo/api.video-swift-client/blob/main/docs/FilterBy1.md)
- [FilterBy2](https://github.com/apivideo/api.video-swift-client/blob/main/docs/FilterBy2.md)
- [Link](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Link.md)
- [LiveStream](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStream.md)
- [LiveStreamAssets](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamAssets.md)
- [LiveStreamCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamCreationPayload.md)
- [LiveStreamListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamListResponse.md)
- [LiveStreamSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSession.md)
- [LiveStreamSessionClient](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionClient.md)
- [LiveStreamSessionDevice](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionDevice.md)
- [LiveStreamSessionLocation](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionLocation.md)
- [LiveStreamSessionReferrer](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionReferrer.md)
- [LiveStreamSessionSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionSession.md)
- [LiveStreamUpdatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamUpdatePayload.md)
- [Metadata](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Metadata.md)
- [Model403ErrorSchema](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Model403ErrorSchema.md)
Expand All @@ -310,18 +318,12 @@ Method | HTTP request | Description
- [TokenCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TooManyRequests.md)
- [UnrecognizedRequestUrl](https://github.com/apivideo/api.video-swift-client/blob/main/docs/UnrecognizedRequestUrl.md)
- [UploadToken](https://github.com/apivideo/api.video-swift-client/blob/main/docs/UploadToken.md)
- [Video](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Video.md)
- [VideoAssets](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoAssets.md)
- [VideoClip](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoClip.md)
- [VideoCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoCreationPayload.md)
- [VideoSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSession.md)
- [VideoSessionClient](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionClient.md)
- [VideoSessionDevice](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionDevice.md)
- [VideoSessionLocation](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionLocation.md)
- [VideoSessionOs](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionOs.md)
- [VideoSessionReferrer](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionReferrer.md)
- [VideoSessionSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionSession.md)
- [VideoSource](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSource.md)
- [VideoSourceLiveStream](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSourceLiveStream.md)
- [VideoSourceLiveStreamLink](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSourceLiveStreamLink.md)
Expand Down
4 changes: 0 additions & 4 deletions Sources/APIHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public struct APIHelper {
result.append(URLQueryItem(name: item.key, value: "\(value)"))
}
}

if destination.isEmpty {
return nil
}
return destination
}
}
2 changes: 1 addition & 1 deletion Sources/APIs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation
public class ApiVideoClient {
public static var apiKey: String? = nil
public static var basePath = "https://ws.api.video"
internal static var customHeaders:[String: String] = ["AV-Origin-Client": "swift:1.2.3"]
internal static var customHeaders:[String: String] = ["AV-Origin-Client": "swift:1.3.0"]
private static var chunkSize: Int = 50 * 1024 * 1024
internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
internal static var credential = ApiVideoCredential()
Expand Down
Loading
Loading