/// <summary> /// Create a Report. /// </summary> /// <param name="type">Type of the report</param> /// <param name="report">Report parameters. Valid fields: /// . StartDate /// . EndDate /// . IncludeChildren /// All invalid keys will be ignored. </param> /// <returns>Report instance.</returns> public async Task <Report> CreateReport( string type, Report report = null) { var request = new EasyPostRequest("reports/{type}", Method.POST); request.AddUrlSegment("type", type); if (report != null) { request.AddQueryString(report.AsDictionary()); } return(await Execute <Report>(request)); }
/// <summary> /// Get a paginated list of scan forms. /// </summary> /// <param name="options">Options for the pagination function</param> /// <returns>Instance of ScanFormList</returns> public async Task <ScanFormList> ListScanForms( ScanFormListOptions options = null) { var request = new EasyPostRequest("scan_forms"); if (options != null) { request.AddQueryString(options.AsDictionary()); } var scanFormList = await Execute <ScanFormList>(request); scanFormList.Options = options; return(scanFormList); }
/// <summary> /// Get a paginated list of shipments. /// </summary> /// <param name="options">Options for the pagination function</param> /// <returns>Instance of EasyPost.ShipmentList</returns> public async Task <ShipmentList> ListShipments( ShipmentListOptions options = null) { var request = new EasyPostRequest("shipments"); if (options != null) { request.AddQueryString(options.AsDictionary()); } var shipmentList = await Execute <ShipmentList>(request); shipmentList.Options = options; return(shipmentList); }
/// <summary> /// Get a paginated list of trackers. /// </summary> /// <param name="options">Options for the pagination function</param> /// <returns>Instance of EasyPost.ShipmentList</returns> public async Task <TrackerList> ListTrackers( TrackerListOptions options = null) { var request = new EasyPostRequest("trackers"); if (options != null) { request.AddQueryString(options.AsDictionary()); } var trackerList = await Execute <TrackerList>(request); trackerList.Options = options; return(trackerList); }
/// <summary> /// Get a paginated list of reports. /// </summary> /// <param name="type">Type of the report</param> /// <param name="options">Options for the pagination function</param> /// <returns>Instance of EasyPost.ScanForm</returns> public async Task <ReportList> ListReports( string type, ReportListOptions options = null) { var request = new EasyPostRequest("reports/{type}"); request.AddUrlSegment("type", type); if (options != null) { request.AddQueryString(options.AsDictionary()); } var reportList = await Execute <ReportList>(request); reportList.Options = options; reportList.Type = type; return(reportList); }