add installapplication cmd proto

This commit is contained in:
Victor Vrantchan
2017-03-19 04:58:46 +00:00
parent 8c89ba43de
commit ebe96a2b67
3 changed files with 129 additions and 24 deletions

View File

@@ -47,6 +47,16 @@ func MarshalEvent(e *Event) ([]byte, error) {
payload.Command.InstallProfile = &commandproto.InstallProfile{
Payload: e.Payload.Command.InstallProfile.Payload,
}
case "InstallApplication":
cmd := e.Payload.Command.InstallApplication
payload.Command.InstallApplication = &commandproto.InstallApplication{
ItunesStoreId: int64(cmd.ITunesStoreID),
Identifier: cmd.Identifier,
ManifestUrl: cmd.ManifestURL,
ManagementFlags: int64(cmd.ManagementFlags),
NotManaged: cmd.NotManaged,
ChangeManagementState: cmd.ChangeManagementState,
}
}
return proto.Marshal(&commandproto.Event{
Id: e.ID,
@@ -88,6 +98,15 @@ func UnmarshalEvent(data []byte, e *Event) error {
e.Payload.Command.InstallProfile = mdm.InstallProfile{
Payload: pb.Payload.Command.InstallProfile.Payload,
}
case "InstallApplication":
cmd := pb.Payload.Command.GetInstallApplication()
e.Payload.Command.InstallApplication = mdm.InstallApplication{
ITunesStoreID: int(cmd.GetItunesStoreId()),
Identifier: cmd.GetIdentifier(),
ManifestURL: cmd.GetManifestUrl(),
ManagementFlags: int(cmd.GetManagementFlags()),
ChangeManagementState: cmd.GetChangeManagementState(),
}
}
return nil
}

View File

@@ -14,6 +14,7 @@ It has these top-level messages:
Command
DeviceInformation
InstallProfile
InstallApplication
*/
package commandproto
@@ -97,9 +98,10 @@ func (m *Payload) GetCommand() *Command {
}
type Command struct {
RequestType string `protobuf:"bytes,1,opt,name=request_type,json=requestType" json:"request_type,omitempty"`
DeviceInformation *DeviceInformation `protobuf:"bytes,2,opt,name=device_information,json=deviceInformation" json:"device_information,omitempty"`
InstallProfile *InstallProfile `protobuf:"bytes,3,opt,name=install_profile,json=installProfile" json:"install_profile,omitempty"`
RequestType string `protobuf:"bytes,1,opt,name=request_type,json=requestType" json:"request_type,omitempty"`
DeviceInformation *DeviceInformation `protobuf:"bytes,2,opt,name=device_information,json=deviceInformation" json:"device_information,omitempty"`
InstallProfile *InstallProfile `protobuf:"bytes,3,opt,name=install_profile,json=installProfile" json:"install_profile,omitempty"`
InstallApplication *InstallApplication `protobuf:"bytes,4,opt,name=install_application,json=installApplication" json:"install_application,omitempty"`
}
func (m *Command) Reset() { *m = Command{} }
@@ -128,6 +130,13 @@ func (m *Command) GetInstallProfile() *InstallProfile {
return nil
}
func (m *Command) GetInstallApplication() *InstallApplication {
if m != nil {
return m.InstallApplication
}
return nil
}
type DeviceInformation struct {
Queries []string `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"`
}
@@ -160,36 +169,103 @@ func (m *InstallProfile) GetPayload() []byte {
return nil
}
type InstallApplication struct {
ItunesStoreId int64 `protobuf:"varint,1,opt,name=itunes_store_id,json=itunesStoreId" json:"itunes_store_id,omitempty"`
Identifier string `protobuf:"bytes,2,opt,name=identifier" json:"identifier,omitempty"`
ManifestUrl string `protobuf:"bytes,3,opt,name=manifest_url,json=manifestUrl" json:"manifest_url,omitempty"`
ManagementFlags int64 `protobuf:"varint,4,opt,name=management_flags,json=managementFlags" json:"management_flags,omitempty"`
NotManaged bool `protobuf:"varint,5,opt,name=not_managed,json=notManaged" json:"not_managed,omitempty"`
ChangeManagementState string `protobuf:"bytes,6,opt,name=change_management_state,json=changeManagementState" json:"change_management_state,omitempty"`
}
func (m *InstallApplication) Reset() { *m = InstallApplication{} }
func (m *InstallApplication) String() string { return proto.CompactTextString(m) }
func (*InstallApplication) ProtoMessage() {}
func (*InstallApplication) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *InstallApplication) GetItunesStoreId() int64 {
if m != nil {
return m.ItunesStoreId
}
return 0
}
func (m *InstallApplication) GetIdentifier() string {
if m != nil {
return m.Identifier
}
return ""
}
func (m *InstallApplication) GetManifestUrl() string {
if m != nil {
return m.ManifestUrl
}
return ""
}
func (m *InstallApplication) GetManagementFlags() int64 {
if m != nil {
return m.ManagementFlags
}
return 0
}
func (m *InstallApplication) GetNotManaged() bool {
if m != nil {
return m.NotManaged
}
return false
}
func (m *InstallApplication) GetChangeManagementState() string {
if m != nil {
return m.ChangeManagementState
}
return ""
}
func init() {
proto.RegisterType((*Event)(nil), "commandproto.Event")
proto.RegisterType((*Payload)(nil), "commandproto.Payload")
proto.RegisterType((*Command)(nil), "commandproto.Command")
proto.RegisterType((*DeviceInformation)(nil), "commandproto.DeviceInformation")
proto.RegisterType((*InstallProfile)(nil), "commandproto.InstallProfile")
proto.RegisterType((*InstallApplication)(nil), "commandproto.InstallApplication")
}
func init() { proto.RegisterFile("command.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 307 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x91, 0x41, 0x4b, 0xc3, 0x30,
0x1c, 0xc5, 0xc9, 0x36, 0x2d, 0xfb, 0x6f, 0x4e, 0x16, 0x10, 0x72, 0x10, 0x56, 0x7b, 0x2a, 0x82,
0x13, 0xf4, 0x23, 0xe8, 0x0e, 0xbb, 0xc8, 0x08, 0xee, 0x28, 0xa5, 0x2e, 0x19, 0xfc, 0xa1, 0x6d,
0xba, 0x36, 0x19, 0xf4, 0xe0, 0xa7, 0xf3, 0x8b, 0x49, 0xd3, 0x64, 0x5a, 0x77, 0xeb, 0x7b, 0xfd,
0xf5, 0xbd, 0xd7, 0x04, 0xae, 0x76, 0x2a, 0xcf, 0xd3, 0x42, 0x2c, 0xcb, 0x4a, 0x69, 0x45, 0xa7,
0x4e, 0x5a, 0x15, 0x7d, 0xc1, 0xc5, 0xea, 0x28, 0x0b, 0x4d, 0x67, 0x30, 0x40, 0xc1, 0x48, 0x48,
0xe2, 0x31, 0x1f, 0xa0, 0xa0, 0x14, 0x46, 0x1a, 0x73, 0xc9, 0x06, 0x21, 0x89, 0x87, 0xdc, 0x3e,
0xd3, 0x47, 0x08, 0xca, 0xb4, 0xc9, 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d4, 0x4f, 0x24,
0x02, 0x00, 0x00,
// 468 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4f, 0x6f, 0xd3, 0x40,
0x10, 0xc5, 0x65, 0x3b, 0x6d, 0xc8, 0xa4, 0x4d, 0xe8, 0xa2, 0x0a, 0x1f, 0x10, 0x35, 0x3e, 0x20,
0x83, 0x44, 0x90, 0x40, 0xe2, 0x8e, 0xa0, 0x48, 0x39, 0x14, 0x95, 0x2d, 0x39, 0x22, 0x6b, 0xc9,
0xae, 0xc3, 0x48, 0xf6, 0xae, 0x6b, 0xaf, 0x23, 0xe5, 0xc0, 0x89, 0xef, 0xc0, 0xe7, 0x45, 0xfb,
0xc7, 0xf9, 0x43, 0x7a, 0xcb, 0xfc, 0xe6, 0xe5, 0xcd, 0xf3, 0xcc, 0xc2, 0xf9, 0x52, 0x55, 0x15,
0x93, 0x7c, 0x56, 0x37, 0x4a, 0x2b, 0x72, 0xe6, 0x4b, 0x5b, 0xa5, 0xbf, 0xe1, 0xe4, 0x7a, 0x2d,
0xa4, 0x26, 0x13, 0x08, 0x91, 0xc7, 0x41, 0x12, 0x64, 0x23, 0x1a, 0x22, 0x27, 0x04, 0x06, 0x1a,
0x2b, 0x11, 0x87, 0x49, 0x90, 0x45, 0xd4, 0xfe, 0x26, 0x6f, 0x61, 0x58, 0xb3, 0x4d, 0xa9, 0x18,
0x8f, 0xa3, 0x24, 0xc8, 0xc6, 0xef, 0x2e, 0x67, 0xfb, 0x66, 0xb3, 0x5b, 0xd7, 0xa4, 0xbd, 0x8a,
0x5c, 0xc1, 0x98, 0x8b, 0x35, 0x2e, 0x45, 0xde, 0x71, 0xe4, 0xf1, 0xc0, 0xba, 0x83, 0x43, 0x0b,
0x8e, 0x3c, 0xfd, 0x01, 0x43, 0xff, 0x27, 0xf2, 0x02, 0xfa, 0x64, 0x79, 0xd7, 0x6d, 0xa3, 0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0xa2, 0xb1, 0xbb, 0x1f, 0xd1, 0x3d, 0x62, 0xce, 0x58,
0x31, 0x89, 0x85, 0xb9, 0x63, 0xd7, 0x94, 0x76, 0xa1, 0x23, 0x3a, 0xee, 0xd9, 0xa2, 0x29, 0xc9,
0x2b, 0x78, 0x5c, 0x31, 0xc9, 0x56, 0xa2, 0x12, 0x52, 0xe7, 0x45, 0xc9, 0x56, 0xad, 0x5d, 0x56,
0x44, 0xa7, 0x3b, 0xfe, 0xc5, 0x60, 0xf3, 0x40, 0xa5, 0xd2, 0xb9, 0xc3, 0x3c, 0x3e, 0x49, 0x82,
0xec, 0x11, 0x05, 0xa9, 0xf4, 0x8d, 0x23, 0xe4, 0x03, 0x3c, 0x5d, 0xfe, 0x62, 0x72, 0x25, 0xf2,
0x3d, 0xcb, 0x56, 0x33, 0x2d, 0xe2, 0x53, 0x3b, 0xf9, 0xd2, 0xb5, 0x6f, 0xb6, 0xdd, 0x3b, 0xd3,
0xfc, 0x79, 0x6a, 0xcf, 0xf1, 0xfe, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xe7, 0xa3, 0x8e,
0x7d, 0x03, 0x00, 0x00,
}

View File

@@ -18,6 +18,7 @@ message Command {
string request_type = 1;
DeviceInformation device_information = 2;
InstallProfile install_profile = 3;
InstallApplication install_application = 4;
}
message DeviceInformation {
@@ -28,3 +29,12 @@ message InstallProfile {
bytes payload = 1;
}
message InstallApplication {
int64 itunes_store_id = 1;
string identifier = 2;
string manifest_url = 3;
int64 management_flags = 4;
bool not_managed = 5;
string change_management_state = 6;
}