github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1/tpm_attestation_cert/tpm_attestation_cert.pb.object_ext.go (about) 1 // Code generated by protoc-gen-goten-object 2 // File: edgelq/devices/proto/v1/tpm_attestation_cert.proto 3 // DO NOT EDIT!!! 4 5 package tpm_attestation_cert 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 project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project" 20 meta "github.com/cloudwan/goten-sdk/types/meta" 21 ) 22 23 // ensure the imports are used 24 var ( 25 _ = new(fmt.Stringer) 26 _ = new(sort.Interface) 27 28 _ = new(proto.Message) 29 _ = googlefieldmaskpb.FieldMask{} 30 31 _ = new(gotenobject.FieldPath) 32 ) 33 34 // make sure we're using proto imports 35 var ( 36 _ = &project.Project{} 37 _ = &meta.Meta{} 38 ) 39 40 func (o *TpmAttestationCert) GotenObjectExt() {} 41 42 func (o *TpmAttestationCert) MakeFullFieldMask() *TpmAttestationCert_FieldMask { 43 return FullTpmAttestationCert_FieldMask() 44 } 45 46 func (o *TpmAttestationCert) MakeRawFullFieldMask() gotenobject.FieldMask { 47 return FullTpmAttestationCert_FieldMask() 48 } 49 50 func (o *TpmAttestationCert) MakeDiffFieldMask(other *TpmAttestationCert) *TpmAttestationCert_FieldMask { 51 if o == nil && other == nil { 52 return &TpmAttestationCert_FieldMask{} 53 } 54 if o == nil || other == nil { 55 return FullTpmAttestationCert_FieldMask() 56 } 57 58 res := &TpmAttestationCert_FieldMask{} 59 if o.GetName().String() != other.GetName().String() { 60 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorName}) 61 } 62 { 63 subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata()) 64 if subMask.IsFull() { 65 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorMetadata}) 66 } else { 67 for _, subpath := range subMask.Paths { 68 res.Paths = append(res.Paths, &TpmAttestationCert_FieldSubPath{selector: TpmAttestationCert_FieldPathSelectorMetadata, subPath: subpath}) 69 } 70 } 71 } 72 if o.GetDisplayName() != other.GetDisplayName() { 73 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorDisplayName}) 74 } 75 if o.GetManufacturer() != other.GetManufacturer() { 76 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorManufacturer}) 77 } 78 if o.GetProductName() != other.GetProductName() { 79 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorProductName}) 80 } 81 if o.GetTpmManufacturerCaCert() != other.GetTpmManufacturerCaCert() { 82 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorTpmManufacturerCaCert}) 83 } 84 if o.GetIdevidIssuerCaCert() != other.GetIdevidIssuerCaCert() { 85 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorIdevidIssuerCaCert}) 86 } 87 if o.GetLdevidIssuerCaCert() != other.GetLdevidIssuerCaCert() { 88 res.Paths = append(res.Paths, &TpmAttestationCert_FieldTerminalPath{selector: TpmAttestationCert_FieldPathSelectorLdevidIssuerCaCert}) 89 } 90 return res 91 } 92 93 func (o *TpmAttestationCert) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask { 94 return o.MakeDiffFieldMask(other.(*TpmAttestationCert)) 95 } 96 97 func (o *TpmAttestationCert) Clone() *TpmAttestationCert { 98 if o == nil { 99 return nil 100 } 101 result := &TpmAttestationCert{} 102 if o.Name == nil { 103 result.Name = nil 104 } else if data, err := o.Name.ProtoString(); err != nil { 105 panic(err) 106 } else { 107 result.Name = &Name{} 108 if err := result.Name.ParseProtoString(data); err != nil { 109 panic(err) 110 } 111 } 112 result.Metadata = o.Metadata.Clone() 113 result.DisplayName = o.DisplayName 114 result.Manufacturer = o.Manufacturer 115 result.ProductName = o.ProductName 116 result.TpmManufacturerCaCert = o.TpmManufacturerCaCert 117 result.IdevidIssuerCaCert = o.IdevidIssuerCaCert 118 result.LdevidIssuerCaCert = o.LdevidIssuerCaCert 119 return result 120 } 121 122 func (o *TpmAttestationCert) CloneRaw() gotenobject.GotenObjectExt { 123 return o.Clone() 124 } 125 126 func (o *TpmAttestationCert) Merge(source *TpmAttestationCert) { 127 if source.GetName() != nil { 128 if data, err := source.GetName().ProtoString(); err != nil { 129 panic(err) 130 } else { 131 o.Name = &Name{} 132 if err := o.Name.ParseProtoString(data); err != nil { 133 panic(err) 134 } 135 } 136 } else { 137 o.Name = nil 138 } 139 if source.GetMetadata() != nil { 140 if o.Metadata == nil { 141 o.Metadata = new(meta.Meta) 142 } 143 o.Metadata.Merge(source.GetMetadata()) 144 } 145 o.DisplayName = source.GetDisplayName() 146 o.Manufacturer = source.GetManufacturer() 147 o.ProductName = source.GetProductName() 148 o.TpmManufacturerCaCert = source.GetTpmManufacturerCaCert() 149 o.IdevidIssuerCaCert = source.GetIdevidIssuerCaCert() 150 o.LdevidIssuerCaCert = source.GetLdevidIssuerCaCert() 151 } 152 153 func (o *TpmAttestationCert) MergeRaw(source gotenobject.GotenObjectExt) { 154 o.Merge(source.(*TpmAttestationCert)) 155 }