diff --git a/.github/workflows/create-documentation-pr.yml b/.github/workflows/create-documentation-pr.yml new file mode 100644 index 0000000..dba0008 --- /dev/null +++ b/.github/workflows/create-documentation-pr.yml @@ -0,0 +1,27 @@ +name: Create documentation PR +on: + # Trigger the workflow on pull requests targeting the main branch + pull_request: + types: [assigned, unassigned, opened, reopened, synchronize, edited, labeled, unlabeled, edited, closed] + branches: + - main + +jobs: + create_documentation_pr: + if: github.event.action != 'closed' + + runs-on: ubuntu-latest + + steps: + - name: Check out current repository code + uses: actions/checkout@v2 + + - name: Create the documentation pull request + uses: apivideo/api.video-create-readme-file-pull-request-action@main + with: + source-file-path: "README.md" + destination-repository: apivideo/api.video-documentation + destination-path: sdks/vod + destination-filename: apivideo-swift-uploader.md + pat: "${{ secrets.PAT }}" + \ No newline at end of file diff --git a/README.md b/README.md index b484670..44aaaa6 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,57 @@ + [![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video)   [![badge](https://img.shields.io/github/stars/apivideo/api.video-swift-uploader?style=social)]()   [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video) ![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)

api.video Swift uploader

[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app. -# Table of contents +## Table of contents +- [Table of contents](#table-of-contents) - [Project description](#project-description) - [Getting started](#getting-started) - [Installation](#installation) - [Carthage](#carthage) - - [CocoaPods](#cocoaPods) + - [CocoaPods](#cocoapods) - [Code sample](#code-sample) - [Documentation](#documentation) - [API Endpoints](#api-endpoints) - - [VideosAPI](#VideosAPI) + - [VideosAPI](#videosapi) + - [Retrieve an instance of VideosAPI:](#retrieve-an-instance-of-videosapi) + - [Endpoints](#endpoints) - [Models](#models) - - [Authorization](#documentation-for-authorization) + - [Documentation for Authorization](#documentation-for-authorization) - [API key](#api-key) - [Public endpoints](#public-endpoints) -- [Have you gotten use from this API client?](#have-you-gotten-use-from-this-api-client) + - [Have you gotten use from this API client?](#have-you-gotten-use-from-this-api-client) - [Contribution](#contribution) -# Project description + + +## Project description + +api.video's Swift uploader for iOS, macOS and tvOS uploads videos to api.video using delegated upload token or API Key. It allows you to upload videos in two ways: - standard upload: to send a whole video file in one go - progressive upload: to send a video file by chunks, without needing to know the final size of the video file -# Getting started +## Getting started -## Installation +### Installation -### Carthage +#### Carthage Specify it in your `Cartfile`: @@ -44,13 +61,13 @@ github "apivideo/api.video-swift-uploader" ~> 1.2.2 Run `carthage update` -### CocoaPods +#### CocoaPods Add `pod 'ApiVideoUploader', '1.2.2'` in your `Podfile` Run `pod install` -## Code sample +### Code sample Please follow the [installation](#installation) instruction and execute the following Swift code: ```swift @@ -69,49 +86,49 @@ try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, } ``` -# Documentation +## Documentation -## API Endpoints +### API Endpoints All URIs are relative to *https://ws.api.video* -### VideosAPI +#### VideosAPI -#### Retrieve an instance of VideosAPI: +##### Retrieve an instance of VideosAPI: ```swift VideosAPI ``` -#### Endpoints +##### Endpoints Method | HTTP request | Description ------------- | ------------- | ------------- -[**upload**](docs/VideosAPI.md#upload) | **POST** /videos/{videoId}/source | Upload a video -[**uploadWithUploadToken**](docs/VideosAPI.md#uploadWithUploadToken) | **POST** /upload | Upload with an delegated upload token +[**upload**](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/VideosAPI.md#upload) | **POST** /videos/{videoId}/source | Upload a video +[**uploadWithUploadToken**](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/VideosAPI.md#uploadWithUploadToken) | **POST** /upload | Upload with an delegated upload token -## Models +### Models - - [AccessToken](docs/AccessToken.md) - - [AdditionalBadRequestErrors](docs/AdditionalBadRequestErrors.md) - - [AuthenticatePayload](docs/AuthenticatePayload.md) - - [BadRequest](docs/BadRequest.md) - - [Metadata](docs/Metadata.md) - - [NotFound](docs/NotFound.md) - - [RefreshTokenPayload](docs/RefreshTokenPayload.md) - - [Video](docs/Video.md) - - [VideoAssets](docs/VideoAssets.md) - - [VideoSource](docs/VideoSource.md) - - [VideoSourceLiveStream](docs/VideoSourceLiveStream.md) - - [VideoSourceLiveStreamLink](docs/VideoSourceLiveStreamLink.md) + - [AccessToken](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/AccessToken.md) + - [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/AdditionalBadRequestErrors.md) + - [AuthenticatePayload](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/AuthenticatePayload.md) + - [BadRequest](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/BadRequest.md) + - [Metadata](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/Metadata.md) + - [NotFound](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/NotFound.md) + - [RefreshTokenPayload](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/RefreshTokenPayload.md) + - [Video](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/Video.md) + - [VideoAssets](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/VideoAssets.md) + - [VideoSource](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/VideoSource.md) + - [VideoSourceLiveStream](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/VideoSourceLiveStream.md) + - [VideoSourceLiveStreamLink](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/VideoSourceLiveStreamLink.md) -## Documentation for Authorization +### Documentation for Authorization -### API key +#### API key Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication). @@ -119,16 +136,16 @@ You must NOT store your API key in your application code to prevent your API key Only the [Public endpoints](#public-endpoints) can be called without authentication. In the case, you want to call an endpoint that requires authentication, you will have to use a backend server. See [Security best practices](https://docs.api.video/sdks/security) for more details. -### Public endpoints +#### Public endpoints Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`. -## Have you gotten use from this API client? +### Have you gotten use from this API client? Please take a moment to leave a star on the client ⭐ This helps other users to find the clients and also helps us understand which clients are most popular. Thank you! -# Contribution +## Contribution -Since this API client is generated from an OpenAPI description, we cannot accept pull requests made directly to the repository. If you want to contribute, you can open a pull request on the repository of our [client generator](https://github.com/apivideo/api-client-generator). Otherwise, you can also simply open an issue detailing your need on this repository. +Since this API client is generated from an OpenAPI description, we cannot accept pull requests made directly to the repository. If you want to contribute, you can open a pull request on the repository of our [client generator](https://github.com/apivideo/api-client-generator). Otherwise, you can also simply open an issue detailing your need on this repository. \ No newline at end of file