void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("tokenizer"); writer.WriteStringValue(TokenizerName.ToString()); if (TokenFilters != null && TokenFilters.Any()) { writer.WritePropertyName("tokenFilters"); writer.WriteStartArray(); foreach (var item in TokenFilters) { writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } if (CharFilters != null && CharFilters.Any()) { writer.WritePropertyName("charFilters"); writer.WriteStartArray(); foreach (var item in CharFilters) { writer.WriteStringValue(item); } writer.WriteEndArray(); } writer.WritePropertyName("@odata.type"); writer.WriteStringValue(ODataType); writer.WritePropertyName("name"); writer.WriteStringValue(Name); writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("text"); writer.WriteStringValue(Text); if (AnalyzerName != null) { writer.WritePropertyName("analyzer"); writer.WriteStringValue(AnalyzerName.Value.ToString()); } if (TokenizerName != null) { writer.WritePropertyName("tokenizer"); writer.WriteStringValue(TokenizerName.Value.ToString()); } if (TokenFilters != null && TokenFilters.Any()) { writer.WritePropertyName("tokenFilters"); writer.WriteStartArray(); foreach (var item in TokenFilters) { writer.WriteStringValue(item.ToString()); } writer.WriteEndArray(); } if (CharFilters != null && CharFilters.Any()) { writer.WritePropertyName("charFilters"); writer.WriteStartArray(); foreach (var item in CharFilters) { writer.WriteStringValue(item); } writer.WriteEndArray(); } writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("name"); writer.WriteStringValue(Name); if (Fields.Any()) { writer.WritePropertyName("fields"); writer.WriteStartArray(); foreach (var item in Fields) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } else { writer.WriteNull("fields"); } if (ScoringProfiles != null && ScoringProfiles.Any()) { writer.WritePropertyName("scoringProfiles"); writer.WriteStartArray(); foreach (var item in ScoringProfiles) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (DefaultScoringProfile != null) { writer.WritePropertyName("defaultScoringProfile"); writer.WriteStringValue(DefaultScoringProfile); } if (CorsOptions != null) { writer.WritePropertyName("corsOptions"); writer.WriteObjectValue(CorsOptions); } if (Suggesters != null && Suggesters.Any()) { writer.WritePropertyName("suggesters"); writer.WriteStartArray(); foreach (var item in Suggesters) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (Analyzers != null && Analyzers.Any()) { writer.WritePropertyName("analyzers"); writer.WriteStartArray(); foreach (var item in Analyzers) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (Tokenizers != null && Tokenizers.Any()) { writer.WritePropertyName("tokenizers"); writer.WriteStartArray(); foreach (var item in Tokenizers) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (TokenFilters != null && TokenFilters.Any()) { writer.WritePropertyName("tokenFilters"); writer.WriteStartArray(); foreach (var item in TokenFilters) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (CharFilters != null && CharFilters.Any()) { writer.WritePropertyName("charFilters"); writer.WriteStartArray(); foreach (var item in CharFilters) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } if (EncryptionKey != null) { writer.WritePropertyName("encryptionKey"); writer.WriteObjectValue(EncryptionKey); } if (Similarity != null) { writer.WritePropertyName("similarity"); writer.WriteObjectValue(Similarity); } if (_etag != null) { writer.WritePropertyName("@odata.etag"); writer.WriteStringValue(_etag); } writer.WriteEndObject(); }