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); }
public async Task RestoreAsync(string typeKey, string id, ExtendedTypeScope scope, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); await _connection.RequestResourceAsync("POST", $"api/http/custom-fields/{typeKey}/fields/{id}/restore{queryParameters.ToQueryString()}", new CustomFieldsForTypeKeyFieldsForIdRestorePostRequest { Scope = scope, }, cancellationToken); }
public CustomFieldsForTypeKeyFieldsForIdPatchRequest(ExtendedTypeScope scope, string?name = null, string?description = null, CFConstraint?constraint = null, bool?required = null, bool? @private = null, AccessType?access = null, CFInputValue?defaultValue = null, List <EnumValueData>?enumValues = null, CFEnumValuesModification?openEnumValuesModification = null) { Name = name; Description = description; Constraint = constraint; IsRequired = required; IsPrivate = @private; Access = access; DefaultValue = defaultValue; EnumValues = enumValues; OpenEnumValuesModification = openEnumValuesModification; Scope = scope; }
public CustomFieldsForTypeKeyFieldsPostRequest(string name, CFType type, bool required, bool @private, CFInputValue defaultValue, ExtendedTypeScope scope, string?description = null, CFConstraint?constraint = null, AccessType?access = null, CFEnumValuesModification?openEnumValuesModification = null) { Name = name; Description = description; Type = type; Constraint = constraint; IsRequired = required; IsPrivate = @private; Access = access; DefaultValue = defaultValue; OpenEnumValuesModification = openEnumValuesModification; Scope = scope; }
public async Task UpdateFieldAsync(string typeKey, string id, ExtendedTypeScope scope, string?name = null, string?description = null, CFConstraint?constraint = null, bool?required = null, bool? @private = null, AccessType?access = null, CFInputValue?defaultValue = null, List <EnumValueData>?enumValues = null, CFEnumValuesModification?openEnumValuesModification = null, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); await _connection.RequestResourceAsync("PATCH", $"api/http/custom-fields/{typeKey}/fields/{id}{queryParameters.ToQueryString()}", new CustomFieldsForTypeKeyFieldsForIdPatchRequest { Name = name, Description = description, Constraint = constraint, IsRequired = required, IsPrivate = @private, Access = access, DefaultValue = defaultValue, EnumValues = enumValues, OpenEnumValuesModification = openEnumValuesModification, Scope = scope, }, cancellationToken); }
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)); }
public async Task ReorderAsync(string typeKey, List <string> customFieldOrder, ExtendedTypeScope scope, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); await _connection.RequestResourceAsync("POST", $"api/http/custom-fields/{typeKey}/fields/reorder{queryParameters.ToQueryString()}", new CustomFieldsForTypeKeyFieldsReorderPostRequest { CustomFieldOrder = customFieldOrder, Scope = scope, }, cancellationToken); }
public async Task UpdateValueAsync(string entityId, string typeKey, List <CustomFieldInputValue> values, ExtendedTypeScope scope, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); await _connection.RequestResourceAsync("PATCH", $"api/http/custom-fields/{typeKey}/{entityId}/values{queryParameters.ToQueryString()}", new CustomFieldsForTypeKeyForEntityIdValuesPatchRequest { Values = values, Scope = scope, }, cancellationToken); }
public IAsyncEnumerable <CFValue> GetAllFilterValuesAsyncEnumerable(string typeKey, string id, ExtendedTypeScope scope, bool calculateTotal = false, string?skip = null, int?top = 100, Func <Partial <CFValue>, Partial <CFValue> >?partial = null, CancellationToken cancellationToken = default) => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllFilterValuesAsync(typeKey: typeKey, id: id, scope: scope, calculateTotal: calculateTotal, top: top, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <CFValue> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <CFValue> .Default())), skip, cancellationToken);
public async Task <List <EnumValueData> > CreateEnumValueAsync(string typeKey, string customFieldId, List <EnumValueData> valuesToAdd, ExtendedTypeScope scope, Func <Partial <EnumValueData>, Partial <EnumValueData> >?partial = null, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); queryParameters.Append("$fields", (partial != null ? partial(new Partial <EnumValueData>()) : Partial <EnumValueData> .Default()).ToString()); return(await _connection.RequestResourceAsync <CustomFieldsForTypeKeyEnumValuesForCustomFieldIdPostRequest, List <EnumValueData> >("POST", $"api/http/custom-fields/{typeKey}/enum-values/{customFieldId}{queryParameters.ToQueryString()}", new CustomFieldsForTypeKeyEnumValuesForCustomFieldIdPostRequest { ValuesToAdd = valuesToAdd, Scope = scope, }, cancellationToken)); }
public IAsyncEnumerable <CustomFieldsRecord> GetAllValuesAsyncEnumerable(string typeKey, ExtendedTypeScope scope, string?skip = null, int?top = 100, List <string>?extendedEntityIds = null, Func <Partial <CustomFieldsRecord>, Partial <CustomFieldsRecord> >?partial = null, CancellationToken cancellationToken = default) => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllValuesAsync(typeKey: typeKey, scope: scope, top: top, extendedEntityIds: extendedEntityIds, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <CustomFieldsRecord> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <CustomFieldsRecord> .Default())), skip, cancellationToken);
public CustomFieldsForTypeKeyFieldsReorderPostRequest(List <string> customFieldOrder, ExtendedTypeScope scope) { CustomFieldOrder = customFieldOrder; Scope = scope; }
public CustomFieldsForTypeKeyForEntityIdValuesPatchRequest(List <CustomFieldInputValue> values, ExtendedTypeScope scope) { Values = values; Scope = scope; }
public CustomFieldsForTypeKeyFieldsForIdArchivePostRequest(ExtendedTypeScope scope) { Scope = scope; }
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)); }
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)); }
public IAsyncEnumerable <EnumValueData> GetAllEnumValuesAsyncEnumerable(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 <EnumValueData>, Partial <EnumValueData> >?partial = null, CancellationToken cancellationToken = default) => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllEnumValuesAsync(typeKey: typeKey, customFieldId: customFieldId, ordering: ordering, scope: scope, top: top, query: query, countRecords: countRecords, addedByProfileId: addedByProfileId, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <EnumValueData> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <EnumValueData> .Default())), skip, cancellationToken);
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)); }
public async Task <CustomField> CreateFieldAsync(string typeKey, string name, CFType type, bool required, bool @private, CFInputValue defaultValue, ExtendedTypeScope scope, string?description = null, CFConstraint?constraint = null, AccessType?access = null, CFEnumValuesModification?openEnumValuesModification = null, Func <Partial <CustomField>, Partial <CustomField> >?partial = null, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); queryParameters.Append("$fields", (partial != null ? partial(new Partial <CustomField>()) : Partial <CustomField> .Default()).ToString()); return(await _connection.RequestResourceAsync <CustomFieldsForTypeKeyFieldsPostRequest, CustomField>("POST", $"api/http/custom-fields/{typeKey}/fields{queryParameters.ToQueryString()}", new CustomFieldsForTypeKeyFieldsPostRequest { Name = name, Description = description, Type = type, Constraint = constraint, IsRequired = required, IsPrivate = @private, Access = access, DefaultValue = defaultValue, OpenEnumValuesModification = openEnumValuesModification, Scope = scope, }, cancellationToken)); }
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)); }
public CustomFieldsForTypeKeyEnumValuesForCustomFieldIdPostRequest(List <EnumValueData> valuesToAdd, ExtendedTypeScope scope) { ValuesToAdd = valuesToAdd; Scope = scope; }