Exemplo n.º 1
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("directoryServiceOptions");
     writer.WriteStringValue(DirectoryServiceOptions.ToString());
     if (Optional.IsDefined(ActiveDirectoryProperties))
     {
         writer.WritePropertyName("activeDirectoryProperties");
         writer.WriteObjectValue(ActiveDirectoryProperties);
     }
     writer.WriteEndObject();
 }
Exemplo n.º 2
0
        internal static AzureFilesIdentityBasedAuthentication DeserializeAzureFilesIdentityBasedAuthentication(JsonElement element)
        {
            DirectoryServiceOptions directoryServiceOptions = default;
            Optional <ActiveDirectoryProperties> activeDirectoryProperties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("directoryServiceOptions"))
                {
                    directoryServiceOptions = new DirectoryServiceOptions(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("activeDirectoryProperties"))
                {
                    activeDirectoryProperties = ActiveDirectoryProperties.DeserializeActiveDirectoryProperties(property.Value);
                    continue;
                }
            }
            return(new AzureFilesIdentityBasedAuthentication(directoryServiceOptions, activeDirectoryProperties.Value));
        }