public async Task WhenAsync(MergePatchShipmentPackageDto c) { var idObj = ShipmentPackageProxyUtils.ToIdString((c as IMergePatchShipmentPackage).ShipmentPackageId); var uriParameters = new ShipmentPackageUriParameters(); uriParameters.Id = idObj; var req = new ShipmentPackagePatchRequest(uriParameters, (MergePatchShipmentPackageDto)c); var resp = await _ramlClient.ShipmentPackage.Patch(req); ShipmentPackageProxyUtils.ThrowOnHttpResponseError(resp); }
public async Task <IShipmentPackageState> GetAsync(ShipmentPackageId shipmentPackageId) { IShipmentPackageState state = null; var idObj = ShipmentPackageProxyUtils.ToIdString(shipmentPackageId); var uriParameters = new ShipmentPackageUriParameters(); uriParameters.Id = idObj; var req = new ShipmentPackageGetRequest(uriParameters); var resp = await _ramlClient.ShipmentPackage.Get(req); ShipmentPackageProxyUtils.ThrowOnHttpResponseError(resp); state = (resp.Content == null) ? null : resp.Content.ToShipmentPackageState(); return(state); }
public async Task WhenAsync(DeleteShipmentPackageDto c) { var idObj = ShipmentPackageProxyUtils.ToIdString((c as IDeleteShipmentPackage).ShipmentPackageId); var uriParameters = new ShipmentPackageUriParameters(); uriParameters.Id = idObj; var q = new ShipmentPackageDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new ShipmentPackageDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.ShipmentPackage.Delete(req); ShipmentPackageProxyUtils.ThrowOnHttpResponseError(resp); }