public async Task WhenAsync(MergePatchShipmentReceiptMvoDto c) { var idObj = ShipmentReceiptMvoProxyUtils.ToIdString((c as IMergePatchShipmentReceiptMvo).ShipmentReceiptId); var uriParameters = new ShipmentReceiptMvoUriParameters(); uriParameters.Id = idObj; var req = new ShipmentReceiptMvoPatchRequest(uriParameters, (MergePatchShipmentReceiptMvoDto)c); var resp = await _ramlClient.ShipmentReceiptMvo.Patch(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); }
public async Task <IShipmentReceiptMvoState> GetHistoryStateAsync(ShipmentReceiptId shipmentReceiptId, long version) { var idObj = ShipmentReceiptMvoProxyUtils.ToIdString(shipmentReceiptId); var uriParameters = new ShipmentReceiptMvoHistoryStateUriParameters(); uriParameters.Id = idObj; uriParameters.Version = version.ToString(); var req = new ShipmentReceiptMvoHistoryStateGetRequest(uriParameters); var resp = await _ramlClient.ShipmentReceiptMvoHistoryState.Get(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); return((resp.Content == null) ? null : resp.Content.ToShipmentReceiptMvoState()); }
public async Task <IShipmentReceiptMvoEvent> GetStateEventAsync(ShipmentReceiptId shipmentReceiptId, long version) { var idObj = ShipmentReceiptMvoProxyUtils.ToIdString(shipmentReceiptId); var uriParameters = new ShipmentReceiptMvoStateEventUriParameters(); uriParameters.Id = idObj; uriParameters.Version = version.ToString(); var req = new ShipmentReceiptMvoStateEventGetRequest(uriParameters); var resp = await _ramlClient.ShipmentReceiptMvoStateEvent.Get(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); return(resp.Content); }
public async Task <IShipmentReceiptMvoState> GetAsync(ShipmentReceiptId shipmentReceiptId) { IShipmentReceiptMvoState state = null; var idObj = ShipmentReceiptMvoProxyUtils.ToIdString(shipmentReceiptId); var uriParameters = new ShipmentReceiptMvoUriParameters(); uriParameters.Id = idObj; var req = new ShipmentReceiptMvoGetRequest(uriParameters); var resp = await _ramlClient.ShipmentReceiptMvo.Get(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); state = (resp.Content == null) ? null : resp.Content.ToShipmentReceiptMvoState(); return(state); }
public async Task <IEnumerable <IShipmentReceiptMvoState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IShipmentReceiptMvoState> states = null; var q = new ShipmentReceiptMvosGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = ShipmentReceiptMvoProxyUtils.GetOrdersQueryValueString(orders); q.Fields = ShipmentReceiptMvoProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = ShipmentReceiptMvoProxyUtils.GetFilterQueryValueString(filter); var req = new ShipmentReceiptMvosGetRequest(); req.Query = q; var resp = await _ramlClient.ShipmentReceiptMvos.Get(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToShipmentReceiptMvoState()); return(states); }
public async Task WhenAsync(DeleteShipmentReceiptMvoDto c) { var idObj = ShipmentReceiptMvoProxyUtils.ToIdString((c as IDeleteShipmentReceiptMvo).ShipmentReceiptId); var uriParameters = new ShipmentReceiptMvoUriParameters(); uriParameters.Id = idObj; var q = new ShipmentReceiptMvoDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.ShipmentVersion); var req = new ShipmentReceiptMvoDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.ShipmentReceiptMvo.Delete(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); }
public async virtual Task <long> GetCountAsync(ICriterion filter) { var q = new ShipmentReceiptMvosCountGetQuery(); q.Filter = ShipmentReceiptMvoProxyUtils.GetFilterQueryValueString(filter); var req = new ShipmentReceiptMvosCountGetRequest(); req.Query = q; var resp = await _ramlClient.ShipmentReceiptMvosCount.Get(req); ShipmentReceiptMvoProxyUtils.ThrowOnHttpResponseError(resp); string str = await resp.RawContent.ReadAsStringAsync(); if (str.StartsWith("\"")) { str = str.Substring(1); } if (str.EndsWith("\"")) { str = str.Substring(0, str.Length - 1); } return(long.Parse(str)); }