Skip to content

Commit

Permalink
feat!: support logs cursor pagination (#23)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: logs api changed from using offset pagination to cursor pagination
  • Loading branch information
jleon15 authored Jan 16, 2024
1 parent 63435bd commit 64e8fb5
Show file tree
Hide file tree
Showing 38 changed files with 6,051 additions and 5,961 deletions.
2 changes: 0 additions & 2 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ BasisTheory/Models/CreateReactorRequest.swift
BasisTheory/Models/CreateSessionResponse.swift
BasisTheory/Models/CreateTenantInvitationRequest.swift
BasisTheory/Models/CreateTokenRequest.swift
BasisTheory/Models/CreateTokenResponse.swift
BasisTheory/Models/CreateTransactionResponse.swift
BasisTheory/Models/EncryptionKey.swift
BasisTheory/Models/EncryptionMetadata.swift
Expand Down Expand Up @@ -115,7 +114,6 @@ docs/CreateReactorRequest.md
docs/CreateSessionResponse.md
docs/CreateTenantInvitationRequest.md
docs/CreateTokenRequest.md
docs/CreateTokenResponse.md
docs/CreateTransactionResponse.md
docs/EncryptionKey.md
docs/EncryptionMetadata.md
Expand Down
9 changes: 6 additions & 3 deletions BasisTheory/APIs/ApplicationsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ open class ApplicationsAPI {
- parameter id: (query) (optional)
- parameter type: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func callGet(id: [UUID]? = nil, type: [String]? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ApplicationPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(id: id, type: type, page: page, size: size).execute(apiResponseQueue) { result in
open class func callGet(id: [UUID]? = nil, type: [String]? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ApplicationPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(id: id, type: type, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -41,10 +42,11 @@ open class ApplicationsAPI {
- parameter id: (query) (optional)
- parameter type: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<ApplicationPaginatedList>
*/
open class func callGetWithRequestBuilder(id: [UUID]? = nil, type: [String]? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<ApplicationPaginatedList> {
open class func callGetWithRequestBuilder(id: [UUID]? = nil, type: [String]? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<ApplicationPaginatedList> {
let localVariablePath = "/applications"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -54,6 +56,7 @@ open class ApplicationsAPI {
"id": (wrappedValue: id?.encodeToJSON(), isExplode: true),
"type": (wrappedValue: type?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand Down
9 changes: 6 additions & 3 deletions BasisTheory/APIs/LogsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ open class LogsAPI {
- parameter startDate: (query) (optional)
- parameter endDate: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func callGet(entityType: String? = nil, entityId: String? = nil, startDate: Date? = nil, endDate: Date? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: LogPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(entityType: entityType, entityId: entityId, startDate: startDate, endDate: endDate, page: page, size: size).execute(apiResponseQueue) { result in
open class func callGet(entityType: String? = nil, entityId: String? = nil, startDate: Date? = nil, endDate: Date? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: LogPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(entityType: entityType, entityId: entityId, startDate: startDate, endDate: endDate, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -45,10 +46,11 @@ open class LogsAPI {
- parameter startDate: (query) (optional)
- parameter endDate: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<LogPaginatedList>
*/
open class func callGetWithRequestBuilder(entityType: String? = nil, entityId: String? = nil, startDate: Date? = nil, endDate: Date? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<LogPaginatedList> {
open class func callGetWithRequestBuilder(entityType: String? = nil, entityId: String? = nil, startDate: Date? = nil, endDate: Date? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<LogPaginatedList> {
let localVariablePath = "/logs"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -60,6 +62,7 @@ open class LogsAPI {
"start_date": (wrappedValue: startDate?.encodeToJSON(), isExplode: true),
"end_date": (wrappedValue: endDate?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand Down
9 changes: 6 additions & 3 deletions BasisTheory/APIs/ProxiesAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ open class ProxiesAPI {
- parameter id: (query) (optional)
- parameter name: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func callGet(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ProxyPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(id: id, name: name, page: page, size: size).execute(apiResponseQueue) { result in
open class func callGet(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ProxyPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(id: id, name: name, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -41,10 +42,11 @@ open class ProxiesAPI {
- parameter id: (query) (optional)
- parameter name: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<ProxyPaginatedList>
*/
open class func callGetWithRequestBuilder(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<ProxyPaginatedList> {
open class func callGetWithRequestBuilder(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<ProxyPaginatedList> {
let localVariablePath = "/proxies"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -54,6 +56,7 @@ open class ProxiesAPI {
"id": (wrappedValue: id?.encodeToJSON(), isExplode: true),
"name": (wrappedValue: name?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand Down
9 changes: 6 additions & 3 deletions BasisTheory/APIs/ReactorFormulasAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ open class ReactorFormulasAPI {
- parameter name: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func callGet(name: String? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ReactorFormulaPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(name: name, page: page, size: size).execute(apiResponseQueue) { result in
open class func callGet(name: String? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ReactorFormulaPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(name: name, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -39,10 +40,11 @@ open class ReactorFormulasAPI {
- name: ApiKey
- parameter name: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<ReactorFormulaPaginatedList>
*/
open class func callGetWithRequestBuilder(name: String? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<ReactorFormulaPaginatedList> {
open class func callGetWithRequestBuilder(name: String? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<ReactorFormulaPaginatedList> {
let localVariablePath = "/reactor-formulas"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -51,6 +53,7 @@ open class ReactorFormulasAPI {
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"name": (wrappedValue: name?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand Down
9 changes: 6 additions & 3 deletions BasisTheory/APIs/ReactorsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ open class ReactorsAPI {
- parameter id: (query) (optional)
- parameter name: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func callGet(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ReactorPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(id: id, name: name, page: page, size: size).execute(apiResponseQueue) { result in
open class func callGet(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: ReactorPaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return callGetWithRequestBuilder(id: id, name: name, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -41,10 +42,11 @@ open class ReactorsAPI {
- parameter id: (query) (optional)
- parameter name: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<ReactorPaginatedList>
*/
open class func callGetWithRequestBuilder(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<ReactorPaginatedList> {
open class func callGetWithRequestBuilder(id: [UUID]? = nil, name: String? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<ReactorPaginatedList> {
let localVariablePath = "/reactors"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -54,6 +56,7 @@ open class ReactorsAPI {
"id": (wrappedValue: id?.encodeToJSON(), isExplode: true),
"name": (wrappedValue: name?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand Down
18 changes: 12 additions & 6 deletions BasisTheory/APIs/TenantsAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,14 @@ open class TenantsAPI {
- parameter status: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func getInvitations(status: TenantInvitationStatus? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: TenantInvitationResponsePaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return getInvitationsWithRequestBuilder(status: status, page: page, size: size).execute(apiResponseQueue) { result in
open class func getInvitations(status: TenantInvitationStatus? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: TenantInvitationResponsePaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return getInvitationsWithRequestBuilder(status: status, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -261,10 +262,11 @@ open class TenantsAPI {
- name: ApiKey
- parameter status: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<TenantInvitationResponsePaginatedList>
*/
open class func getInvitationsWithRequestBuilder(status: TenantInvitationStatus? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<TenantInvitationResponsePaginatedList> {
open class func getInvitationsWithRequestBuilder(status: TenantInvitationStatus? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<TenantInvitationResponsePaginatedList> {
let localVariablePath = "/tenants/self/invitations"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -273,6 +275,7 @@ open class TenantsAPI {
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"status": (wrappedValue: status?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand All @@ -291,13 +294,14 @@ open class TenantsAPI {
- parameter userId: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- parameter apiResponseQueue: The queue on which api response is dispatched.
- parameter completion: completion handler to receive the data and the error objects
*/
@discardableResult
open class func getMembers(userId: [UUID]? = nil, page: Int? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: TenantMemberResponsePaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return getMembersWithRequestBuilder(userId: userId, page: page, size: size).execute(apiResponseQueue) { result in
open class func getMembers(userId: [UUID]? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil, apiResponseQueue: DispatchQueue = BasisTheoryAPI.apiResponseQueue, completion: @escaping ((_ data: TenantMemberResponsePaginatedList?, _ error: Error?) -> Void)) -> RequestTask {
return getMembersWithRequestBuilder(userId: userId, page: page, start: start, size: size).execute(apiResponseQueue) { result in
switch result {
case let .success(response):
completion(response.body, nil)
Expand All @@ -314,10 +318,11 @@ open class TenantsAPI {
- name: ApiKey
- parameter userId: (query) (optional)
- parameter page: (query) (optional)
- parameter start: (query) (optional)
- parameter size: (query) (optional)
- returns: RequestBuilder<TenantMemberResponsePaginatedList>
*/
open class func getMembersWithRequestBuilder(userId: [UUID]? = nil, page: Int? = nil, size: Int? = nil) -> RequestBuilder<TenantMemberResponsePaginatedList> {
open class func getMembersWithRequestBuilder(userId: [UUID]? = nil, page: Int? = nil, start: String? = nil, size: Int? = nil) -> RequestBuilder<TenantMemberResponsePaginatedList> {
let localVariablePath = "/tenants/self/members"
let localVariableURLString = BasisTheoryAPI.basePath + localVariablePath
let localVariableParameters: [String: Any]? = nil
Expand All @@ -326,6 +331,7 @@ open class TenantsAPI {
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"user_id": (wrappedValue: userId?.encodeToJSON(), isExplode: true),
"page": (wrappedValue: page?.encodeToJSON(), isExplode: true),
"start": (wrappedValue: start?.encodeToJSON(), isExplode: true),
"size": (wrappedValue: size?.encodeToJSON(), isExplode: true),
])

Expand Down
Loading

0 comments on commit 64e8fb5

Please sign in to comment.