Skip to content

Commit

Permalink
Add API rate limiting to the OAS
Browse files Browse the repository at this point in the history
  • Loading branch information
szekelyzol authored Apr 11, 2024
1 parent e64cc80 commit b4dd533
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Sources/Models/Environment.swift
Sources/Models/Metadata.swift
Sources/Models/NotFound.swift
Sources/Models/RefreshTokenPayload.swift
Sources/Models/TooManyRequests.swift
Sources/Models/Video.swift
Sources/Models/VideoAssets.swift
Sources/Models/VideoSource.swift
Expand All @@ -43,6 +44,7 @@ docs/BadRequest.md
docs/Metadata.md
docs/NotFound.md
docs/RefreshTokenPayload.md
docs/TooManyRequests.md
docs/Video.md
docs/VideoAssets.md
docs/VideoSource.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 @@
5678c55d78ebee898e89b47215b59cb855d1997cdda9202292548ec786d8e9f5
6f6d12eb33f0d5084520aa50a9dc9b3da87129501775807a5ed06bbf66485298
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Method | HTTP request | Description
- [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)
- [TooManyRequests](https://github.com/apivideo/api.video-swift-uploader/blob/main/docs/TooManyRequests.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)
Expand Down
43 changes: 43 additions & 0 deletions Sources/Models/TooManyRequests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// TooManyRequests.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif

public struct TooManyRequests: Codable, Hashable {

/** A link to the error documentation. */
public var type: String?
/** A description of the error that occurred. */
public var title: String?
/** The HTTP status code. */
public var status: Int?

public init(type: String? = nil, title: String? = nil, status: Int? = nil) {
self.type = type
self.title = title
self.status = status
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case type
case title
case status
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(type, forKey: .type)
try container.encodeIfPresent(title, forKey: .title)
try container.encodeIfPresent(status, forKey: .status)
}
}

5 changes: 5 additions & 0 deletions Tests/TestResources/payloads/videos/upload/responses/429.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type" : "https://docs.api.video/reference/too-many-requests",
"title" : "Too many requests.",
"status" : 429
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type" : "https://docs.api.video/reference/too-many-requests",
"title" : "Too many requests.",
"status" : 429
}
12 changes: 12 additions & 0 deletions docs/TooManyRequests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TooManyRequests

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **String** | A link to the error documentation. | [optional]
**title** | **String** | A description of the error that occurred. | [optional]
**status** | **Int** | The HTTP status code. | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


0 comments on commit b4dd533

Please sign in to comment.