Table of Contents

Class CustomNewtonsoftJsonContentSerializer

Namespace
Meraki.Api
Assembly
Meraki.Api.dll

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

options MerakiClientOptions

The Meraki client options

logger ILogger

The logger instance

Methods

FromHttpContentAsync<T>(HttpContent, CancellationToken)

Deserializes an object from HTTP content

public Task<T?> FromHttpContentAsync<T>(HttpContent content, CancellationToken cancellationToken = default)

Parameters

content HttpContent

The HTTP content to deserialize

cancellationToken CancellationToken

The cancellation token

Returns

Task<T>

The deserialized object

Type Parameters

T

The type to deserialize to

GetFieldNameForProperty(PropertyInfo)

gets the field name for property

public string? GetFieldNameForProperty(PropertyInfo propertyInfo)

Parameters

propertyInfo PropertyInfo

Returns

string

ToHttpContent<T>(T)

Serializes an object to HTTP content

public HttpContent ToHttpContent<T>(T item)

Parameters

item T

The object to serialize

Returns

HttpContent

The HTTP content containing the serialized object

Type Parameters

T

The type of the object to serialize