             try container.encode(false, forKey: .audio)
         }
         
-        if let num = maxNumberOfSpeakers {
-            try container.encode(num, forKey: .vad)
-        }
+        try container.encodeIfPresent(maxNumberOfSpeakers, forKey: .vad)
     }
     
 }

        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(role, forKey: .role)
        try container.encode(channelId, forKey: .channel_id)
        
        if let sdp = sdp {
            try container.encode(sdp, forKey: .sdp)
        }
        
        if let metadata = metadata {
            try container.encode(metadata, forKey: .metadata)
        }
        
        if let notifyMetadata = notifyMetadata {
            try container.encode(notifyMetadata, forKey: .signaling_notify_metadata)
        }
        
        if multistreamEnabled {
            try container.encode(true, forKey: .multistream)
        }
        
        if planBEnabled {
            try container.encode(planBEnabled, forKey: .plan_b)
        }
        
        if videoEnabled {
            if videoCodec != .default || videoBitRate != nil {

    public var sdp: String?
    
    /// マルチストリームの可否
    public var multistreamEnabled: Bool?
    
    /// Plan B の可否
    public var planBEnabled: Bool?
    
    /// スポットライト数
    public var spotlight: Int?
