listProducts method

Future<PayPalProductsList> listProducts({
  1. int page_size = 20,
  2. int page = 1,
  3. bool total_required = true,
})

Implementation

Future<PayPalProductsList> listProducts({
  ///The number of items to return in the response.
  ///Minimum value: 1.
  ///Maximum value: 20.
  int page_size = 20,
  ///A non-zero integer which is the start index of the entire list of items that are returned in the response. So, the combination of page=1 and page_size=20 returns the first 20 items. The combination of page=2 and page_size=20 returns the next 20 items.
  ///Minimum value: 1.
  ///Maximum value: 100000.
  int page = 1,
  ///Indicates whether to show the total items and total pages in the response.
  bool total_required = true,
})async{
  String response = await SexyAPI(
    url: _url,
    path: "/v1/catalogs/products",
    parameters: {
      "page_size" : page_size,
      "page" : page,
      "total_required" : total_required,
    },
  ).get(
    headers: {
      "Authorization" : "Bearer ${accessToken.access_token}",
      "Content-Type" : "application/json",
    },
  );
  try{
    return PayPalProductsList.parse(_parseResponse(response));
  }catch(error){
    throw response;
  }
}