Class SbcPermissionsConverter
Class to (de-)serialize SBC permission flags
Inherited Members
Namespace: DuetAPI.Utility
Assembly: DuetAPI.dll
Syntax
public class SbcPermissionsConverter : JsonConverter<SbcPermissions>
Methods
CanConvert(Type)
Checks if the given type can be converted
Declaration
public override bool CanConvert(Type typeToConvert)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | typeToConvert | Type to convert |
Returns
| Type | Description |
|---|---|
| bool | Whether the type can be converted |
Overrides
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Read SBC permissions from JSON
Declaration
public override SbcPermissions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | JSON reader |
| Type | typeToConvert | Target type |
| JsonSerializerOptions | options | Serializer options |
Returns
| Type | Description |
|---|---|
| SbcPermissions | Deserialized permissions |
Overrides
Write(Utf8JsonWriter, SbcPermissions, JsonSerializerOptions)
Write SBC permissions to JSON
Declaration
public override void Write(Utf8JsonWriter writer, SbcPermissions value, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | JSON writer |
| SbcPermissions | value | Value |
| JsonSerializerOptions | options | Serializer options |