getCommercePlanListWithHttpInfo method
List all billing plans
Returns a list of all billing plans for the instance. The plans are returned sorted by creation date, with the newest plans appearing first. This includes both free and paid plans. Pagination is supported.
Note: This method returns the HTTP Response.
Parameters:
-
bool paginated: Whether to paginate the results. If true, the results will be paginated. If false, the results will not be paginated.
-
int limit: Applies a limit to the number of results returned. Can be used for paginating the results together with
offset. -
int offset: Skip the first
offsetresults when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction withlimit. -
String payerType: Filter plans by payer type
Implementation
Future<http.Response> getCommercePlanListWithHttpInfo({
bool? paginated,
int? limit,
int? offset,
String? payerType,
}) async {
// ignore: prefer_const_declarations
final path = r'/billing/plans';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (paginated != null) {
queryParams.addAll(_queryParams('', 'paginated', paginated));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (offset != null) {
queryParams.addAll(_queryParams('', 'offset', offset));
}
if (payerType != null) {
queryParams.addAll(_queryParams('', 'payer_type', payerType));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}