Repository: micromdm/micromdm (go)

Issue:
Add suppprt for MaxUserDeferrals  in ScheduleOSUpdate
Apple's documentation for ScheduleOSUpdate
(https://developer.apple.com/documentation/devicemanagement/scheduleosupdatecommand/command/updatesitem) mentions the parameter MaxUserDeferrals which sounds interesting. I'd like to play with it, but mircomdm currently does not support it.

### What version of `micromdm` are you using?
1.9.0-beta

### What `micromdm` command did you run?
ScheduleOSUpdate

### What did you expect to see?
Support for the parameter MaxUserDeferrals.

### What did you see instead?
The parameter is currently not supported.

Pull request description:
Add fields to ScheduleOSUpdate command (Fixes #790)
This adds support for the MaxUserDeferrals and ProductVersion fields in the ScheduleOSUpdate command. It also adds a couple of tests.

Patch:
diff --git a/mdm/mdm/command.go b/mdm/mdm/command.go
index 5dd4e4d..30ba52a 100644
--- a/mdm/mdm/command.go
+++ b/mdm/mdm/command.go
@@ -276,8 +276,10 @@ type SetAutoAdminPassword struct {
 }
 
 type OSUpdate struct {
-	ProductKey    string `json:"product_key"`
-	InstallAction string `json:"install_action"`
+	ProductKey       string `plist:",omitempty" json:"product_key,omitempty"`
+	InstallAction    string `json:"install_action"`
+	MaxUserDeferrals *int64 `plist:",omitempty" json:"max_user_deferrals,omitempty"`
+	ProductVersion   string `plist:",omitempty" json:"product_version,omitempty"`
 }
 
 type ScheduleOSUpdate struct {
diff --git a/mdm/mdm/internal/mdmproto/mdm.pb.go b/mdm/mdm/internal/mdmproto/mdm.pb.go
index 7a1b850..1a58a1c 100644
--- a/mdm/mdm/internal/mdmproto/mdm.pb.go
+++ b/mdm/mdm/internal/mdmproto/mdm.pb.go
@@ -4215,9 +4215,10 @@ type Update struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	ProductKey     string `protobuf:"bytes,1,opt,name=product_key,json=productKey,proto3" json:"product_key,omitempty"`
-	ProductVersion string `protobuf:"bytes,2,opt,name=product_version,json=productVersion,proto3" json:"product_version,omitempty"`
-	InstallAction  string `protobuf:"bytes,3,opt,name=install_action,json=installAction,proto3" json:"install_action,omitempty"`
+	ProductKey       string `protobuf:"bytes,1,opt,name=product_key,json=productKey,proto3" json:"product_key,omitempty"`
+	ProductVersion   string `protobuf:"bytes,2,opt,name=product_version,json=productVersion,proto3" json:"product_version,omitempty"`
+	InstallAction    string `protobuf:"bytes,3,opt,name=install_action,json=installAction,proto3" json:"install_action,omitempty"`
+	MaxUserDeferrals int64  `protobuf:"varint,4,opt,name=max_user_deferrals,json=maxUserDeferrals,proto3" json:"max_user_deferrals,omitempty"`
 }
 
 func (x *Update) Reset() {
@@ -4273,6 +4274,13 @@ func (x *Update) GetInstallAction() string {
 	return ""
 }
 
+func (x *Update) GetMaxUserDeferrals() int64 {
+	if x != nil {
+		return x.MaxUserDeferrals
+	}
+	return 0
+}
+
 type ScheduleOSUpdateScan struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -5356,79 +5364,82 @@ var file_mdm_proto_rawDesc = []byte{
 	0x4f, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61,
 	0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x64, 0x6d, 0x70,
 	0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x07, 0x75, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x73, 0x22, 0x79, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1f,
-	0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4b, 0x65, 0x79, 0x12,
-	0x27, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,
-	0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
-	0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x74,
-	0x61, 0x6c, 0x6c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
-	0x2c, 0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x53, 0x55, 0x70, 0x64,
-	0x61, 0x74, 0x65, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65,
-	0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x4c, 0x0a,
-	0x12, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
-	0x6f, 0x6e, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x78,
-	0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01,
-	0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65,
-	0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x12,
-	0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x4b,
-	0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a,
-	0x10, 0x66, 0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63,
-	0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f,
-	0x63, 0x6b, 0x52, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c,
-	0x6f, 0x63, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69,
-	0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6e, 0x65,
-	0x77, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x1c,
-	0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e,
-	0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01,
-	0x28, 0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74,
-	0x69, 0x6f, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x9a,
-	0x01, 0x0a, 0x0f, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f,
-	0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c,
-	0x0a, 0x12, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78,
-	0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x72, 0x69, 0x76,
-	0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3d, 0x0a, 0x1b,
-	0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x6f,
-	0x72, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x18, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70,
-	0x6f, 0x72, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x3c, 0x0a, 0x11, 0x53,
-	0x65, 0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
-	0x12, 0x27, 0x0a, 0x0f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f,
-	0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x62, 0x6f, 0x6f, 0x74, 0x73,
-	0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x52, 0x65,
-	0x73, 0x75, 0x6c, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75,
-	0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x64, 0x69, 0x64, 0x12,
-	0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x55, 0x75,
-	0x69, 0x64, 0x12, 0x35, 0x0a, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x69,
-	0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f,
-	0x74, 0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x0a, 0x65,
-	0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x22, 0x53, 0x0a, 0x06, 0x53, 0x74, 0x61,
-	0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64,
-	0x67, 0x65, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01,
-	0x12, 0x16, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x61,
-	0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x64, 0x6c, 0x65,
-	0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x77, 0x10, 0x04, 0x22, 0xb9,
-	0x01, 0x0a, 0x0a, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x33, 0x0a,
-	0x15, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72,
-	0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6c, 0x6f,
-	0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
-	0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x16, 0x75, 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68,
-	0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x14, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x65, 0x73,
-	0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f,
-	0x72, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
-	0x65, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65,
-	0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
-	0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69,
-	0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64,
-	0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d,
-	0x64, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x64, 0x6d, 0x70,
-	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x61, 0x74, 0x65, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
+	0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4b, 0x65, 0x79,
+	0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73,
+	0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75,
+	0x63, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x73,
+	0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x66,
+	0x65, 0x72, 0x72, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6d, 0x61,
+	0x78, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x61, 0x6c, 0x73, 0x22, 0x2c,
+	0x0a, 0x14, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4f, 0x53, 0x55, 0x70, 0x64, 0x61,
+	0x74, 0x65, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x4c, 0x0a, 0x12,
+	0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
+	0x6e, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x65, 0x78, 0x74,
+	0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20,
+	0x03, 0x28, 0x09, 0x52, 0x15, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e,
+	0x73, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x12, 0x52,
+	0x6f, 0x74, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x65,
+	0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x10,
+	0x66, 0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63,
+	0x6b, 0x52, 0x0f, 0x66, 0x69, 0x6c, 0x65, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f,
+	0x63, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66,
+	0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6e, 0x65, 0x77,
+	0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x40, 0x0a, 0x1c, 0x72,
+	0x65, 0x70, 0x6c, 0x79, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+	0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69,
+	0x6f, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x9a, 0x01,
+	0x0a, 0x0f, 0x46, 0x69, 0x6c, 0x65, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x55, 0x6e, 0x6c, 0x6f, 0x63,
+	0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2c, 0x0a,
+	0x12, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70,
+	0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x70, 0x72, 0x69, 0x76, 0x61,
+	0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3d, 0x0a, 0x1b, 0x70,
+	0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x72,
+	0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x18, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x70, 0x6f,
+	0x72, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x3c, 0x0a, 0x11, 0x53, 0x65,
+	0x74, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
+	0x27, 0x0a, 0x0f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b,
+	0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74,
+	0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73,
+	0x75, 0x6c, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x64,
+	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x64, 0x69, 0x64, 0x12, 0x21,
+	0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x55, 0x75, 0x69,
+	0x64, 0x12, 0x35, 0x0a, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e,
+	0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x64, 0x6d, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x0a, 0x65, 0x72,
+	0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x22, 0x53, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74,
+	0x75, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67,
+	0x65, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12,
+	0x16, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+	0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x64, 0x6c, 0x65, 0x10,
+	0x03, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x4e, 0x6f, 0x77, 0x10, 0x04, 0x22, 0xb9, 0x01,
+	0x0a, 0x0a, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x33, 0x0a, 0x15,
+	0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
+	0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6c, 0x6f, 0x63,
+	0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
+	0x6e, 0x12, 0x34, 0x0a, 0x16, 0x75, 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x5f,
+	0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x14, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x44, 0x65, 0x73, 0x63,
+	0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72,
+	0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65,
+	0x72, 0x72, 0x6f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72,
+	0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
+	0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74,
+	0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64, 0x6d,
+	0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64, 0x6d, 0x2f, 0x6d, 0x64,
+	0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x64, 0x6d, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (
diff --git a/mdm/mdm/internal/mdmproto/mdm.proto b/mdm/mdm/internal/mdmproto/mdm.proto
index 3ebd035..207531b 100644
--- a/mdm/mdm/internal/mdmproto/mdm.proto
+++ b/mdm/mdm/internal/mdmproto/mdm.proto
@@ -399,6 +399,7 @@ message Update {
   string product_key = 1;
   string product_version = 2;
   string install_action = 3;
+  int64 max_user_deferrals = 4;
 }
 
 message ScheduleOSUpdateScan {
diff --git a/mdm/mdm/marshal_proto.go b/mdm/mdm/marshal_proto.go
index c128e83..5f5245f 100644
--- a/mdm/mdm/marshal_proto.go
+++ b/mdm/mdm/marshal_proto.go
@@ -365,8 +365,10 @@ func commandToProto(cmd *Command) (*mdmproto.Command, error) {
 		var updates []*mdmproto.Update
 		for _, u := range cmd.ScheduleOSUpdate.Updates {
 			updates = append(updates, &mdmproto.Update{
-				ProductKey:    u.ProductKey,
-				InstallAction: u.InstallAction,
+				ProductKey:       u.ProductKey,
+				InstallAction:    u.InstallAction,
+				MaxUserDeferrals: zeroInt64IfNil(u.MaxUserDeferrals),
+				ProductVersion:   u.ProductVersion,
 			})
 		}
 		cmdproto.Request = &mdmproto.Command_ScheduleOsUpdate{
diff --git a/mdm/mdm/unmarshal_proto.go b/mdm/mdm/unmarshal_proto.go
index e866869..64a6344 100644
--- a/mdm/mdm/unmarshal_proto.go
+++ b/mdm/mdm/unmarshal_proto.go
@@ -331,8 +331,10 @@ func protoToCommand(pb *mdmproto.Command) *Command {
 		var updates []OSUpdate
 		for _, up := range pbc.GetUpdates() {
 			updates = append(updates, OSUpdate{
-				ProductKey:    up.GetProductKey(),
-				InstallAction: up.GetInstallAction(),
+				ProductKey:       up.GetProductKey(),
+				InstallAction:    up.GetInstallAction(),
+				MaxUserDeferrals: nilIfZeroInt64(up.GetMaxUserDeferrals()),
+				ProductVersion:   up.GetProductVersion(),
 			})
 		}
 		cmd.ScheduleOSUpdate = &ScheduleOSUpdate{


Test patch:
diff --git a/mdm/mdm/mdm_command_test.go b/mdm/mdm/mdm_command_test.go
index c4cdf93..8d635e7 100644
--- a/mdm/mdm/mdm_command_test.go
+++ b/mdm/mdm/mdm_command_test.go
@@ -28,6 +28,7 @@ Not tested end to end but checked against pdf:
 */
 
 func TestMarshalCommand(t *testing.T) {
+	var deferrals int64 = 3
 	var tests = []struct {
 		Command Command
 	}{
@@ -110,6 +111,21 @@ func TestMarshalCommand(t *testing.T) {
 				},
 			},
 		},
+		{
+			Command: Command{
+				RequestType: "ScheduleOSUpdate",
+				ScheduleOSUpdate: &ScheduleOSUpdate{
+					Updates: []OSUpdate{
+						{
+							ProductKey:       "io.micromdm.micromdm",
+							InstallAction:    "InstallLater",
+							MaxUserDeferrals: &deferrals,
+							ProductVersion:   "1.0.0",
+						},
+					},
+				},
+			},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.Command.RequestType+"_json", func(t *testing.T) {
@@ -315,6 +331,31 @@ func TestEndToEnd(t *testing.T) {
 			},
 		},
 
+		{
+			name: "ScheduleOSUpdate",
+			requestBytes: []byte(
+				`{"request_type":"ScheduleOSUpdate","updates":[{"product_key":"io.micromdm.micromdm","install_action":"InstallLater","max_user_deferrals":3,"product_version":"1.0.0"}]}`,
+			),
+			testFn: func(t *testing.T, parts endToEndParts) {
+				needToSee := [][]byte{
+					[]byte(`Updates`),
+					[]byte(`ProductKey`),
+					[]byte(`io.micromdm.micromdm`),
+					[]byte(`InstallAction`),
+					[]byte(`InstallLater`),
+					[]byte(`MaxUserDeferrals`),
+					[]byte(`3`),
+					[]byte(`ProductVersion`),
+					[]byte(`1.0.0`),
+				}
+				for _, b := range needToSee {
+					if !bytes.Contains(parts.plistData, b) {
+						t.Error(fmt.Sprintf("marshaled plist does not contain required bytes: '%s'", string(b)))
+					}
+				}
+			},
+		},
+
 		{
 			name: "SetFirmwarePassword_NoNewPassword",
 			requestBytes: []byte(