public async Task WhenAsync(MergePatchPhysicalInventoryLineMvoDto c)
        {
            var idObj         = PhysicalInventoryLineMvoProxyUtils.ToIdString((c as IMergePatchPhysicalInventoryLineMvo).PhysicalInventoryLineId);
            var uriParameters = new PhysicalInventoryLineMvoUriParameters();

            uriParameters.Id = idObj;

            var req  = new PhysicalInventoryLineMvoPatchRequest(uriParameters, (MergePatchPhysicalInventoryLineMvoDto)c);
            var resp = await _ramlClient.PhysicalInventoryLineMvo.Patch(req);

            PhysicalInventoryLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }
        public async Task <IPhysicalInventoryLineMvoEvent> GetStateEventAsync(PhysicalInventoryLineId physicalInventoryLineId, long version)
        {
            var idObj         = PhysicalInventoryLineMvoProxyUtils.ToIdString(physicalInventoryLineId);
            var uriParameters = new PhysicalInventoryLineMvoStateEventUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new PhysicalInventoryLineMvoStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.PhysicalInventoryLineMvoStateEvent.Get(req);

            PhysicalInventoryLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
        public async Task <IPhysicalInventoryLineMvoState> GetHistoryStateAsync(PhysicalInventoryLineId physicalInventoryLineId, long version)
        {
            var idObj         = PhysicalInventoryLineMvoProxyUtils.ToIdString(physicalInventoryLineId);
            var uriParameters = new PhysicalInventoryLineMvoHistoryStateUriParameters();

            uriParameters.Id      = idObj;
            uriParameters.Version = version.ToString();

            var req  = new PhysicalInventoryLineMvoHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.PhysicalInventoryLineMvoHistoryState.Get(req);

            PhysicalInventoryLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToPhysicalInventoryLineMvoState());
        }
        public async Task <IPhysicalInventoryLineMvoState> GetAsync(PhysicalInventoryLineId physicalInventoryLineId)
        {
            IPhysicalInventoryLineMvoState state = null;
            var idObj         = PhysicalInventoryLineMvoProxyUtils.ToIdString(physicalInventoryLineId);
            var uriParameters = new PhysicalInventoryLineMvoUriParameters();

            uriParameters.Id = idObj;

            var req = new PhysicalInventoryLineMvoGetRequest(uriParameters);

            var resp = await _ramlClient.PhysicalInventoryLineMvo.Get(req);

            PhysicalInventoryLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToPhysicalInventoryLineMvoState();
            return(state);
        }
        public async Task WhenAsync(DeletePhysicalInventoryLineMvoDto c)
        {
            var idObj         = PhysicalInventoryLineMvoProxyUtils.ToIdString((c as IDeletePhysicalInventoryLineMvo).PhysicalInventoryLineId);
            var uriParameters = new PhysicalInventoryLineMvoUriParameters();

            uriParameters.Id = idObj;

            var q = new PhysicalInventoryLineMvoDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.PhysicalInventoryVersion);

            var req = new PhysicalInventoryLineMvoDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.PhysicalInventoryLineMvo.Delete(req);

            PhysicalInventoryLineMvoProxyUtils.ThrowOnHttpResponseError(resp);
        }