         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)
-        }
+        try container.encodeIfPresent(sdp, forKey: .sdp)
+        try container.encodeIfPresent(metadata, forKey: .metadata)
+        try container.encodeIfPresent(notifyMetadata,
+                                      forKey: .signaling_notify_metadata)
+        try container.encodeIfPresent(multistreamEnabled,
+                                      forKey: .multistream)
+        try container.encodeIfPresent(planBEnabled, forKey: .plan_b)
         
         if videoEnabled {
             if videoCodec != .default || videoBitRate != nil {

                if videoCodec != .default {
                    try videoContainer.encode(videoCodec, forKey: .codec_type)
                }
                if let bitRate = videoBitRate {
                    try videoContainer.encode(bitRate, forKey: .bit_rate)
                }
            }
        } else {
            try container.encode(false, forKey: .video)

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