/// <summary>
        /// Asynchronously Retrieve Custom Fields, with support for cancellation.
        /// </summary>
        /// <remarks>
        /// Retrieves a list of all custom fields associated with your company,
        /// with filters to narrow down the results.
        /// </remarks>
        /// <param name="filter">
        /// An instance of the <see cref="CustomFieldFilter"/> class, for narrowing down the results.
        /// </param>
        /// <param name="options">
        /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
        /// </param>
        /// <param name="cancellationToken">
        /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>
        /// An enumerable set of <see cref="CustomField"/> objects, along with an output
        /// instance of the <see cref="ResultsMeta"/> class containing additional data.
        /// </returns>
        public async Task <(IList <CustomField>, ResultsMeta)> GetCustomFieldsAsync(
            CustomFieldFilter filter,
            RequestOptions options,
            CancellationToken cancellationToken)
        {
            var context = new GetContext <CustomField>(EndpointName.CustomFields, filter, options);

            await ExecuteOperationAsync(context, cancellationToken).ConfigureAwait(false);

            return(context.Results.Items, context.ResultsMeta);
        }
 /// <summary>
 /// Asynchronously Retrieve Custom Fields, with support for cancellation.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all custom fields associated with your company,
 /// with filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="CustomFieldFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="cancellationToken">
 /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="CustomField"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <CustomField>, ResultsMeta)> GetCustomFieldsAsync(
     CustomFieldFilter filter,
     CancellationToken cancellationToken)
 {
     return(await GetCustomFieldsAsync(filter, null, cancellationToken).ConfigureAwait(false));
 }
 /// <summary>
 /// Asynchronously Retrieve Custom Fields.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all custom fields associated with your company,
 /// with filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="CustomFieldFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="options">
 /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="CustomField"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <CustomField>, ResultsMeta)> GetCustomFieldsAsync(
     CustomFieldFilter filter,
     RequestOptions options)
 {
     return(await GetCustomFieldsAsync(filter, options, default).ConfigureAwait(false));
 }
 /// <summary>
 /// Asynchronously Retrieve Custom Fields.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all custom fields associated with your company,
 /// with filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="CustomFieldFilter"/> class, for narrowing down the results.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="CustomField"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <CustomField>, ResultsMeta)> GetCustomFieldsAsync(
     CustomFieldFilter filter)
 {
     return(await GetCustomFieldsAsync(filter, null, default).ConfigureAwait(false));
 }
 /// <summary>
 /// Retrieve Custom Fields.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all custom fields associated with your company,
 /// with filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="CustomFieldFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="options">
 /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="CustomField"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public (IList <CustomField>, ResultsMeta) GetCustomFields(
     CustomFieldFilter filter,
     RequestOptions options)
 {
     return(AsyncUtil.RunSync(() => GetCustomFieldsAsync(filter, options)));
 }
 /// <summary>
 /// Retrieve Custom Fields.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all custom fields associated with your company,
 /// with filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="CustomFieldFilter"/> class, for narrowing down the results.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="CustomField"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public (IList <CustomField>, ResultsMeta) GetCustomFields(
     CustomFieldFilter filter)
 {
     return(AsyncUtil.RunSync(() => GetCustomFieldsAsync(filter)));
 }
Beispiel #7
0
 public void Apply(CustomFieldFilter filter) => _query             = _query.Where($"EXISTS(SELECT cf.event_id FROM epcis.custom_field cf WHERE cf.event_id = event.id AND cf.type = {filter.Field.Type.Id} AND cf.namespace = {_parameters.Add(filter.Field.Namespace)} AND cf.name = {_parameters.Add(filter.Field.Name)} AND cf.parent_id IS {(filter.IsInner ? "NOT" : "")} NULL AND cf.text_value = ANY({_parameters.Add(filter.Values)}))");
Beispiel #8
0
 public void Apply(CustomFieldFilter filter) => _filters.AddCondition(QueryFilters.CustomFields, $"type = {filter.Field.Type.Id} AND namespace = {_parameters.Add(filter.Field.Namespace)} AND name = {_parameters.Add(filter.Field.Name)} AND parent_id IS {(filter.IsInner ? "NOT" : string.Empty)} NULL AND text_value = ANY({_parameters.Add(filter.Values)})");