Created
September 24, 2020 14:57
-
-
Save thehappybug/13468159f6e803252cda1ca6105179b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WITHOUT COLLECT PARAMS | |
export class PaymentsApi extends BaseApi { | |
async listPayments( | |
beginTime?: string, | |
endTime?: string, | |
sortOrder?: string, | |
cursor?: string, | |
locationId?: string, | |
total?: number, | |
last4?: string, | |
cardBrand?: string, | |
requestOptions?: RequestOptions | |
): Promise<ApiResponse<ListPaymentsResponse>> { | |
/// ... endpoint code comes here | |
} | |
} | |
// WITH COLLECT PARAMS | |
export class PaymentsApi extends BaseApi { | |
async listPayments({ | |
beginTime, | |
endTime, | |
sortOrder, | |
cursor, | |
locationId, | |
total, | |
last4, | |
cardBrand, | |
}: { | |
beginTime?: string, | |
endTime?: string, | |
sortOrder?: string, | |
cursor?: string, | |
locationId?: string, | |
total?: number, | |
last4?: string, | |
cardBrand?: string, | |
} | |
requestOptions?: RequestOptions | |
): Promise<ApiResponse<ListPaymentsResponse>> { | |
/// ... endpoint code remains the same because we've destructured the | |
/// ... collected params into individual variables. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment