Esempio n. 1
0
        public async Task WhenAsync(MergePatchAttributeSetInstanceExtensionFieldDto c)
        {
            var idObj         = (c as IMergePatchAttributeSetInstanceExtensionField).Name;
            var uriParameters = new AttributeSetInstanceExtensionFieldUriParameters();

            uriParameters.Id = idObj;

            var req  = new AttributeSetInstanceExtensionFieldPatchRequest(uriParameters, (MergePatchAttributeSetInstanceExtensionFieldDto)c);
            var resp = await _ramlClient.AttributeSetInstanceExtensionField.Patch(req);

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
        }
Esempio n. 2
0
        public async Task <IAttributeSetInstanceExtensionFieldState> GetHistoryStateAsync(string name, long version)
        {
            var idObj         = name;
            var uriParameters = new AttributeSetInstanceExtensionFieldHistoryStateUriParameters();

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

            var req  = new AttributeSetInstanceExtensionFieldHistoryStateGetRequest(uriParameters);
            var resp = await _ramlClient.AttributeSetInstanceExtensionFieldHistoryState.Get(req);

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
            return((resp.Content == null) ? null : resp.Content.ToAttributeSetInstanceExtensionFieldState());
        }
Esempio n. 3
0
        public async Task <IAttributeSetInstanceExtensionFieldEvent> GetStateEventAsync(string name, long version)
        {
            var idObj         = name;
            var uriParameters = new AttributeSetInstanceExtensionFieldStateEventUriParameters();

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

            var req  = new AttributeSetInstanceExtensionFieldStateEventGetRequest(uriParameters);
            var resp = await _ramlClient.AttributeSetInstanceExtensionFieldStateEvent.Get(req);

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
            return(resp.Content);
        }
Esempio n. 4
0
        public async Task <IAttributeSetInstanceExtensionFieldState> GetAsync(string name)
        {
            IAttributeSetInstanceExtensionFieldState state = null;
            var idObj         = name;
            var uriParameters = new AttributeSetInstanceExtensionFieldUriParameters();

            uriParameters.Id = idObj;

            var req = new AttributeSetInstanceExtensionFieldGetRequest(uriParameters);

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

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
            state = (resp.Content == null) ? null : resp.Content.ToAttributeSetInstanceExtensionFieldState();
            return(state);
        }
Esempio n. 5
0
        public async Task <IEnumerable <IAttributeSetInstanceExtensionFieldState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IAttributeSetInstanceExtensionFieldState> states = null;
            var q = new AttributeSetInstanceExtensionFieldsGetQuery();

            q.FirstResult = firstResult;
            q.MaxResults  = maxResults;
            q.Sort        = AttributeSetInstanceExtensionFieldProxyUtils.GetOrdersQueryValueString(orders);
            q.Fields      = AttributeSetInstanceExtensionFieldProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator);
            q.Filter      = AttributeSetInstanceExtensionFieldProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeSetInstanceExtensionFieldsGetRequest();

            req.Query = q;
            var resp = await _ramlClient.AttributeSetInstanceExtensionFields.Get(req);

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
            states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToAttributeSetInstanceExtensionFieldState());
            return(states);
        }
Esempio n. 6
0
        public async Task WhenAsync(DeleteAttributeSetInstanceExtensionFieldDto c)
        {
            var idObj         = (c as IDeleteAttributeSetInstanceExtensionField).Name;
            var uriParameters = new AttributeSetInstanceExtensionFieldUriParameters();

            uriParameters.Id = idObj;

            var q = new AttributeSetInstanceExtensionFieldDeleteQuery();

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

            var req = new AttributeSetInstanceExtensionFieldDeleteRequest(uriParameters);

            req.Query = q;

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

            AttributeSetInstanceExtensionFieldProxyUtils.ThrowOnHttpResponseError(resp);
        }
Esempio n. 7
0
        public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new AttributeSetInstanceExtensionFieldsCountGetQuery();

            q.Filter = AttributeSetInstanceExtensionFieldProxyUtils.GetFilterQueryValueString(filter);
            var req = new AttributeSetInstanceExtensionFieldsCountGetRequest();

            req.Query = q;
            var resp = await _ramlClient.AttributeSetInstanceExtensionFieldsCount.Get(req);

            AttributeSetInstanceExtensionFieldProxyUtils.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));
        }