Class DataModelSanitation
Collection of methods for cleaning and sanitizing objects used in requests to CDM Instances
Inherited Members
Namespace: Cognite.Extensions.DataModels
Assembly: Cognite.Extensions.dll
Syntax
public static class DataModelSanitation
Methods
| Edit this page View SourceCleanInstanceRequest<T>(IEnumerable<SourcedNodeWrite<T>>, SanitationMode)
Clean list of T objects, sanitizing each and removing any duplicates. The first encountered duplicate is kept.
Declaration
public static (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>) CleanInstanceRequest<T>(IEnumerable<SourcedNodeWrite<T>> instances, SanitationMode mode)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<SourcedNodeWrite<T>> | instances | T request to clean |
SanitationMode | mode | The type of sanitation to apply |
Returns
Type | Description |
---|---|
(IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>) | Cleaned create request and optional errors for duplicated ids and legacyNames |
Type Parameters
Name | Description |
---|---|
T |
Sanitize<T>(SourcedNodeWrite<T>)
Sanitize a T object so that it can be safely sent to CDF. Requests may still fail due to conflicts or missing ids.
Declaration
public static void Sanitize<T>(this SourcedNodeWrite<T> instance)
Parameters
Type | Name | Description |
---|---|---|
SourcedNodeWrite<T> | instance | Instance to sanitize |
Type Parameters
Name | Description |
---|---|
T |
Verify<T>(SourcedNodeWrite<T>)
Check that given T satisfies CDF limits.
Declaration
public static ResourceType? Verify<T>(this SourcedNodeWrite<T> instance)
Parameters
Type | Name | Description |
---|---|---|
SourcedNodeWrite<T> | instance | Instance to check |
Returns
Type | Description |
---|---|
ResourceType? | True if instance satisfies limits |
Type Parameters
Name | Description |
---|---|
T |