Skip to content

Instantly share code, notes, and snippets.

@thehappybug
Created September 24, 2020 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thehappybug/13468159f6e803252cda1ca6105179b4 to your computer and use it in GitHub Desktop.
Save thehappybug/13468159f6e803252cda1ca6105179b4 to your computer and use it in GitHub Desktop.
// 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