コード例 #1
0
            public async Task <Batch <EnumValueData> > GetAllEnumValuesAsync(string typeKey, string customFieldId, ExtendedTypeScope scope, EnumValueOrdering ordering = EnumValueOrdering.NAMEASC, string?skip = null, int?top = 100, string?query = null, bool?countRecords = null, string?addedByProfileId = null, Func <Partial <Batch <EnumValueData> >, Partial <Batch <EnumValueData> > >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                if (skip != null)
                {
                    queryParameters.Append("$skip", skip);
                }
                if (top != null)
                {
                    queryParameters.Append("$top", top?.ToString());
                }
                if (query != null)
                {
                    queryParameters.Append("query", query);
                }
                queryParameters.Append("ordering", ordering.ToEnumString());
                if (countRecords != null)
                {
                    queryParameters.Append("countRecords", countRecords?.ToString("l"));
                }
                if (addedByProfileId != null)
                {
                    queryParameters.Append("addedByProfileId", addedByProfileId);
                }
                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <EnumValueData> >()) : Partial <Batch <EnumValueData> > .Default()).ToString());

                return(await _connection.RequestResourceAsync <Batch <EnumValueData> >("GET", $"api/http/custom-fields/{typeKey}/enum-values/{customFieldId}{queryParameters.ToQueryString()}", cancellationToken));
            }
コード例 #2
0
            public async Task DeleteFieldAsync(string typeKey, string id, ExtendedTypeScope scope, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("scope", scope.ToString());

                await _connection.RequestResourceAsync("DELETE", $"api/http/custom-fields/{typeKey}/fields/{id}{queryParameters.ToQueryString()}", cancellationToken);
            }
コード例 #3
0
            public async Task <CustomFieldsRecord> GetValueAsync(string typeKey, string entityId, ExtendedTypeScope scope, Func <Partial <CustomFieldsRecord>, Partial <CustomFieldsRecord> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <CustomFieldsRecord>()) : Partial <CustomFieldsRecord> .Default()).ToString());

                return(await _connection.RequestResourceAsync <CustomFieldsRecord>("GET", $"api/http/custom-fields/{typeKey}/{entityId}/values{queryParameters.ToQueryString()}", cancellationToken));
            }
コード例 #4
0
            public async Task <List <CustomField> > GetAllFieldsAsync(string typeKey, ExtendedTypeScope scope, bool withArchived = false, Func <Partial <CustomField>, Partial <CustomField> >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                queryParameters.Append("withArchived", withArchived.ToString("l"));
                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <CustomField>()) : Partial <CustomField> .Default()).ToString());

                return(await _connection.RequestResourceAsync <List <CustomField> >("GET", $"api/http/custom-fields/{typeKey}/fields{queryParameters.ToQueryString()}", cancellationToken));
            }
コード例 #5
0
                public async Task <Batch <CFValue> > GetAllFilterValuesAsync(string typeKey, string id, ExtendedTypeScope scope, bool calculateTotal = false, string?skip = null, int?top = 100, Func <Partial <Batch <CFValue> >, Partial <Batch <CFValue> > >?partial = null, CancellationToken cancellationToken = default)
                {
                    var queryParameters = new NameValueCollection();

                    if (skip != null)
                    {
                        queryParameters.Append("$skip", skip);
                    }
                    if (top != null)
                    {
                        queryParameters.Append("$top", top?.ToString());
                    }
                    queryParameters.Append("scope", scope.ToString());
                    queryParameters.Append("calculateTotal", calculateTotal.ToString("l"));
                    queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <CFValue> >()) : Partial <Batch <CFValue> > .Default()).ToString());

                    return(await _connection.RequestResourceAsync <Batch <CFValue> >("GET", $"api/http/custom-fields/{typeKey}/fields/{id}/filter-values{queryParameters.ToQueryString()}", cancellationToken));
                }
コード例 #6
0
            public async Task <Batch <CustomFieldsRecord> > GetAllValuesAsync(string typeKey, ExtendedTypeScope scope, string?skip = null, int?top = 100, List <string>?extendedEntityIds = null, Func <Partial <Batch <CustomFieldsRecord> >, Partial <Batch <CustomFieldsRecord> > >?partial = null, CancellationToken cancellationToken = default)
            {
                var queryParameters = new NameValueCollection();

                if (skip != null)
                {
                    queryParameters.Append("$skip", skip);
                }
                if (top != null)
                {
                    queryParameters.Append("$top", top?.ToString());
                }
                if (extendedEntityIds != null)
                {
                    queryParameters.Append("extendedEntityIds", extendedEntityIds.Select(it => it));
                }
                queryParameters.Append("scope", scope.ToString());
                queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <CustomFieldsRecord> >()) : Partial <Batch <CustomFieldsRecord> > .Default()).ToString());

                return(await _connection.RequestResourceAsync <Batch <CustomFieldsRecord> >("GET", $"api/http/custom-fields/{typeKey}/all-values{queryParameters.ToQueryString()}", cancellationToken));
            }