Class CustomNewtonsoftJsonContentSerializer
A custom IHttpContentSerializer based on NewtonsoftJsonContentSerializer to handle retries after missing members are observed
public class CustomNewtonsoftJsonContentSerializer : IHttpContentSerializer
- Inheritance
-
CustomNewtonsoftJsonContentSerializer
- Implements
-
IHttpContentSerializer
- Inherited Members
Constructors
CustomNewtonsoftJsonContentSerializer(MerakiClientOptions, ILogger)
Initializes a new instance of the CustomNewtonsoftJsonContentSerializer class
public CustomNewtonsoftJsonContentSerializer(MerakiClientOptions options, ILogger logger)
Parameters
optionsMerakiClientOptionsThe Meraki client options
loggerILoggerThe logger instance
Methods
FromHttpContentAsync<T>(HttpContent, CancellationToken)
Deserializes an object from HTTP content
public Task<T?> FromHttpContentAsync<T>(HttpContent content, CancellationToken cancellationToken = default)
Parameters
contentHttpContentThe HTTP content to deserialize
cancellationTokenCancellationTokenThe cancellation token
Returns
- Task<T>
The deserialized object
Type Parameters
TThe type to deserialize to
GetFieldNameForProperty(PropertyInfo)
gets the field name for property
public string? GetFieldNameForProperty(PropertyInfo propertyInfo)
Parameters
propertyInfoPropertyInfo
Returns
ToHttpContent<T>(T)
Serializes an object to HTTP content
public HttpContent ToHttpContent<T>(T item)
Parameters
itemTThe object to serialize
Returns
- HttpContent
The HTTP content containing the serialized object
Type Parameters
TThe type of the object to serialize