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"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    activeDirectoryProperties = ActiveDirectoryProperties.DeserializeActiveDirectoryProperties(property.Value);
                    continue;
                }
            }
            return(new AzureFilesIdentityBasedAuthentication(directoryServiceOptions, activeDirectoryProperties.Value));
        }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("directoryServiceOptions");
     writer.WriteStringValue(DirectoryServiceOptions.ToString());
     if (ActiveDirectoryProperties != null)
     {
         writer.WritePropertyName("activeDirectoryProperties");
         writer.WriteObjectValue(ActiveDirectoryProperties);
     }
     writer.WriteEndObject();
 }
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("directoryServiceOptions");
     writer.WriteStringValue(DirectoryServiceOptions.ToString());
     if (Optional.IsDefined(ActiveDirectoryProperties))
     {
         writer.WritePropertyName("activeDirectoryProperties");
         writer.WriteObjectValue(ActiveDirectoryProperties);
     }
     if (Optional.IsDefined(DefaultSharePermission))
     {
         writer.WritePropertyName("defaultSharePermission");
         writer.WriteStringValue(DefaultSharePermission.Value.ToString());
     }
     writer.WriteEndObject();
 }