github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1/os_image_profile/os_image_profile.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/devices/proto/v1/os_image_profile.proto 3 // DO NOT EDIT!!! 4 5 package os_image_profile 6 7 import ( 8 "fmt" 9 "sort" 10 11 "google.golang.org/protobuf/proto" 12 googlefieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 13 14 gotenobject "github.com/cloudwan/goten-sdk/runtime/object" 15 ) 16 17 // proto imports 18 import ( 19 device_type "github.com/cloudwan/edgelq-sdk/devices/resources/v1/device_type" 20 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project" 21 meta "github.com/cloudwan/goten-sdk/types/meta" 22 ) 23 24 // ensure the imports are used 25 var ( 26 _ = new(fmt.Stringer) 27 _ = new(sort.Interface) 28 29 _ = new(proto.Message) 30 _ = googlefieldmaskpb.FieldMask{} 31 32 _ = new(gotenobject.FieldPath) 33 ) 34 35 // make sure we're using proto imports 36 var ( 37 _ = &device_type.DeviceType{} 38 _ = &project.Project{} 39 _ = &meta.Meta{} 40 ) 41 42 func (o *OsImageProfile) GotenObjectExt() {} 43 44 func (o *OsImageProfile) MakeFullFieldMask() *OsImageProfile_FieldMask { 45 return FullOsImageProfile_FieldMask() 46 } 47 48 func (o *OsImageProfile) MakeRawFullFieldMask() gotenobject.FieldMask { 49 return FullOsImageProfile_FieldMask() 50 } 51 52 func (o *OsImageProfile) MakeDiffFieldMask(other *OsImageProfile) *OsImageProfile_FieldMask { 53 if o == nil && other == nil { 54 return &OsImageProfile_FieldMask{} 55 } 56 if o == nil || other == nil { 57 return FullOsImageProfile_FieldMask() 58 } 59 60 res := &OsImageProfile_FieldMask{} 61 if o.GetName().String() != other.GetName().String() { 62 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorName}) 63 } 64 { 65 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 66 if subMask.IsFull() { 67 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorMetadata}) 68 } else { 69 for _, subpath := range subMask.Paths { 70 res.Paths = append(res.Paths, &OsImageProfile_FieldSubPath{selector: OsImageProfile_FieldPathSelectorMetadata, subPath: subpath}) 71 } 72 } 73 } 74 if o.GetDisplayName() != other.GetDisplayName() { 75 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDisplayName}) 76 } 77 if o.GetDescription() != other.GetDescription() { 78 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDescription}) 79 } 80 if o.GetDeviceType().String() != other.GetDeviceType().String() { 81 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDeviceType}) 82 } 83 if o.GetInstallAiAccelerator() != other.GetInstallAiAccelerator() { 84 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorInstallAiAccelerator}) 85 } 86 if o.GetEncryption() != other.GetEncryption() { 87 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorEncryption}) 88 } 89 if o.GetDiskMapping() != other.GetDiskMapping() { 90 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDiskMapping}) 91 } 92 if o.GetNetworkAgent() != other.GetNetworkAgent() { 93 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorNetworkAgent}) 94 } 95 if o.GetNtp() != other.GetNtp() { 96 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorNtp}) 97 } 98 if o.GetHttpProxy() != other.GetHttpProxy() { 99 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorHttpProxy}) 100 } 101 if o.GetHttpsProxy() != other.GetHttpsProxy() { 102 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorHttpsProxy}) 103 } 104 if o.GetNoProxy() != other.GetNoProxy() { 105 res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorNoProxy}) 106 } 107 return res 108 } 109 110 func (o *OsImageProfile) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 111 return o.MakeDiffFieldMask(other.(*OsImageProfile)) 112 } 113 114 func (o *OsImageProfile) Clone() *OsImageProfile { 115 if o == nil { 116 return nil 117 } 118 result := &OsImageProfile{} 119 if o.Name == nil { 120 result.Name = nil 121 } else if data, err := o.Name.ProtoString(); err != nil { 122 panic(err) 123 } else { 124 result.Name = &Name{} 125 if err := result.Name.ParseProtoString(data); err != nil { 126 panic(err) 127 } 128 } 129 result.Metadata = o.Metadata.Clone() 130 result.DisplayName = o.DisplayName 131 result.Description = o.Description 132 if o.DeviceType == nil { 133 result.DeviceType = nil 134 } else if data, err := o.DeviceType.ProtoString(); err != nil { 135 panic(err) 136 } else { 137 result.DeviceType = &device_type.Reference{} 138 if err := result.DeviceType.ParseProtoString(data); err != nil { 139 panic(err) 140 } 141 } 142 result.InstallAiAccelerator = o.InstallAiAccelerator 143 result.Encryption = o.Encryption 144 result.DiskMapping = o.DiskMapping 145 result.NetworkAgent = o.NetworkAgent 146 result.Ntp = o.Ntp 147 result.HttpProxy = o.HttpProxy 148 result.HttpsProxy = o.HttpsProxy 149 result.NoProxy = o.NoProxy 150 return result 151 } 152 153 func (o *OsImageProfile) CloneRaw() gotenobject.GotenObjectExt { 154 return o.Clone() 155 } 156 157 func (o *OsImageProfile) Merge(source *OsImageProfile) { 158 if source.GetName() != nil { 159 if data, err := source.GetName().ProtoString(); err != nil { 160 panic(err) 161 } else { 162 o.Name = &Name{} 163 if err := o.Name.ParseProtoString(data); err != nil { 164 panic(err) 165 } 166 } 167 } else { 168 o.Name = nil 169 } 170 if source.GetMetadata() != nil { 171 if o.Metadata == nil { 172 o.Metadata = new(meta.Meta) 173 } 174 o.Metadata.Merge(source.GetMetadata()) 175 } 176 o.DisplayName = source.GetDisplayName() 177 o.Description = source.GetDescription() 178 if source.GetDeviceType() != nil { 179 if data, err := source.GetDeviceType().ProtoString(); err != nil { 180 panic(err) 181 } else { 182 o.DeviceType = &device_type.Reference{} 183 if err := o.DeviceType.ParseProtoString(data); err != nil { 184 panic(err) 185 } 186 } 187 } else { 188 o.DeviceType = nil 189 } 190 o.InstallAiAccelerator = source.GetInstallAiAccelerator() 191 o.Encryption = source.GetEncryption() 192 o.DiskMapping = source.GetDiskMapping() 193 o.NetworkAgent = source.GetNetworkAgent() 194 o.Ntp = source.GetNtp() 195 o.HttpProxy = source.GetHttpProxy() 196 o.HttpsProxy = source.GetHttpsProxy() 197 o.NoProxy = source.GetNoProxy() 198 } 199 200 func (o *OsImageProfile) MergeRaw(source gotenobject.GotenObjectExt) { 201 o.Merge(source.(*OsImageProfile)) 202 }