github.com/cloudwan/edgelq-sdk@v1.15.4/devices/resources/v1alpha2/customized_image/customized_image.pb.object_ext.go (about)

     1  // Code generated by protoc-gen-goten-object
     2  // File: edgelq/devices/proto/v1alpha2/customized_image.proto
     3  // DO NOT EDIT!!!
     4  
     5  package customized_image
     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/v1alpha2/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 *CustomizedImage) GotenObjectExt() {}
    41  
    42  func (o *CustomizedImage) MakeFullFieldMask() *CustomizedImage_FieldMask {
    43  	return FullCustomizedImage_FieldMask()
    44  }
    45  
    46  func (o *CustomizedImage) MakeRawFullFieldMask() gotenobject.FieldMask {
    47  	return FullCustomizedImage_FieldMask()
    48  }
    49  
    50  func (o *CustomizedImage) MakeDiffFieldMask(other *CustomizedImage) *CustomizedImage_FieldMask {
    51  	if o == nil && other == nil {
    52  		return &CustomizedImage_FieldMask{}
    53  	}
    54  	if o == nil || other == nil {
    55  		return FullCustomizedImage_FieldMask()
    56  	}
    57  
    58  	res := &CustomizedImage_FieldMask{}
    59  	if o.GetName().String() != other.GetName().String() {
    60  		res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorName})
    61  	}
    62  	{
    63  		subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata())
    64  		if subMask.IsFull() {
    65  			res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorMetadata})
    66  		} else {
    67  			for _, subpath := range subMask.Paths {
    68  				res.Paths = append(res.Paths, &CustomizedImage_FieldSubPath{selector: CustomizedImage_FieldPathSelectorMetadata, subPath: subpath})
    69  			}
    70  		}
    71  	}
    72  	{
    73  		subMask := o.GetSpec().MakeDiffFieldMask(other.GetSpec())
    74  		if subMask.IsFull() {
    75  			res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorSpec})
    76  		} else {
    77  			for _, subpath := range subMask.Paths {
    78  				res.Paths = append(res.Paths, &CustomizedImage_FieldSubPath{selector: CustomizedImage_FieldPathSelectorSpec, subPath: subpath})
    79  			}
    80  		}
    81  	}
    82  	{
    83  		subMask := o.GetStatus().MakeDiffFieldMask(other.GetStatus())
    84  		if subMask.IsFull() {
    85  			res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorStatus})
    86  		} else {
    87  			for _, subpath := range subMask.Paths {
    88  				res.Paths = append(res.Paths, &CustomizedImage_FieldSubPath{selector: CustomizedImage_FieldPathSelectorStatus, subPath: subpath})
    89  			}
    90  		}
    91  	}
    92  	return res
    93  }
    94  
    95  func (o *CustomizedImage) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
    96  	return o.MakeDiffFieldMask(other.(*CustomizedImage))
    97  }
    98  
    99  func (o *CustomizedImage) Clone() *CustomizedImage {
   100  	if o == nil {
   101  		return nil
   102  	}
   103  	result := &CustomizedImage{}
   104  	if o.Name == nil {
   105  		result.Name = nil
   106  	} else if data, err := o.Name.ProtoString(); err != nil {
   107  		panic(err)
   108  	} else {
   109  		result.Name = &Name{}
   110  		if err := result.Name.ParseProtoString(data); err != nil {
   111  			panic(err)
   112  		}
   113  	}
   114  	result.Metadata = o.Metadata.Clone()
   115  	result.Spec = o.Spec.Clone()
   116  	result.Status = o.Status.Clone()
   117  	return result
   118  }
   119  
   120  func (o *CustomizedImage) CloneRaw() gotenobject.GotenObjectExt {
   121  	return o.Clone()
   122  }
   123  
   124  func (o *CustomizedImage) Merge(source *CustomizedImage) {
   125  	if source.GetName() != nil {
   126  		if data, err := source.GetName().ProtoString(); err != nil {
   127  			panic(err)
   128  		} else {
   129  			o.Name = &Name{}
   130  			if err := o.Name.ParseProtoString(data); err != nil {
   131  				panic(err)
   132  			}
   133  		}
   134  	} else {
   135  		o.Name = nil
   136  	}
   137  	if source.GetMetadata() != nil {
   138  		if o.Metadata == nil {
   139  			o.Metadata = new(meta.Meta)
   140  		}
   141  		o.Metadata.Merge(source.GetMetadata())
   142  	}
   143  	if source.GetSpec() != nil {
   144  		if o.Spec == nil {
   145  			o.Spec = new(CustomizedImage_Spec)
   146  		}
   147  		o.Spec.Merge(source.GetSpec())
   148  	}
   149  	if source.GetStatus() != nil {
   150  		if o.Status == nil {
   151  			o.Status = new(CustomizedImage_Status)
   152  		}
   153  		o.Status.Merge(source.GetStatus())
   154  	}
   155  }
   156  
   157  func (o *CustomizedImage) MergeRaw(source gotenobject.GotenObjectExt) {
   158  	o.Merge(source.(*CustomizedImage))
   159  }
   160  
   161  func (o *CustomizedImage_Spec) GotenObjectExt() {}
   162  
   163  func (o *CustomizedImage_Spec) MakeFullFieldMask() *CustomizedImage_Spec_FieldMask {
   164  	return FullCustomizedImage_Spec_FieldMask()
   165  }
   166  
   167  func (o *CustomizedImage_Spec) MakeRawFullFieldMask() gotenobject.FieldMask {
   168  	return FullCustomizedImage_Spec_FieldMask()
   169  }
   170  
   171  func (o *CustomizedImage_Spec) MakeDiffFieldMask(other *CustomizedImage_Spec) *CustomizedImage_Spec_FieldMask {
   172  	if o == nil && other == nil {
   173  		return &CustomizedImage_Spec_FieldMask{}
   174  	}
   175  	if o == nil || other == nil {
   176  		return FullCustomizedImage_Spec_FieldMask()
   177  	}
   178  
   179  	res := &CustomizedImage_Spec_FieldMask{}
   180  	if o.GetVersion() != other.GetVersion() {
   181  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorVersion})
   182  	}
   183  	if o.GetDeviceType() != other.GetDeviceType() {
   184  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorDeviceType})
   185  	}
   186  	if o.GetProvisioningPolicy() != other.GetProvisioningPolicy() {
   187  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorProvisioningPolicy})
   188  	}
   189  	if o.GetInstallAiAccelerator() != other.GetInstallAiAccelerator() {
   190  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorInstallAiAccelerator})
   191  	}
   192  	if o.GetPassword() != other.GetPassword() {
   193  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorPassword})
   194  	}
   195  	if o.GetEncryption() != other.GetEncryption() {
   196  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorEncryption})
   197  	}
   198  	if o.GetEncryptionPassword() != other.GetEncryptionPassword() {
   199  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorEncryptionPassword})
   200  	}
   201  	if o.GetDiskMapping() != other.GetDiskMapping() {
   202  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorDiskMapping})
   203  	}
   204  	if o.GetNetworkAgent() != other.GetNetworkAgent() {
   205  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorNetworkAgent})
   206  	}
   207  	if o.GetNtp() != other.GetNtp() {
   208  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorNtp})
   209  	}
   210  	if o.GetHttpProxy() != other.GetHttpProxy() {
   211  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorHttpProxy})
   212  	}
   213  	if o.GetHttpsProxy() != other.GetHttpsProxy() {
   214  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorHttpsProxy})
   215  	}
   216  	if o.GetNoProxy() != other.GetNoProxy() {
   217  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorNoProxy})
   218  	}
   219  	return res
   220  }
   221  
   222  func (o *CustomizedImage_Spec) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
   223  	return o.MakeDiffFieldMask(other.(*CustomizedImage_Spec))
   224  }
   225  
   226  func (o *CustomizedImage_Spec) Clone() *CustomizedImage_Spec {
   227  	if o == nil {
   228  		return nil
   229  	}
   230  	result := &CustomizedImage_Spec{}
   231  	result.Version = o.Version
   232  	result.DeviceType = o.DeviceType
   233  	result.ProvisioningPolicy = o.ProvisioningPolicy
   234  	result.InstallAiAccelerator = o.InstallAiAccelerator
   235  	result.Password = o.Password
   236  	result.Encryption = o.Encryption
   237  	result.EncryptionPassword = o.EncryptionPassword
   238  	result.DiskMapping = o.DiskMapping
   239  	result.NetworkAgent = o.NetworkAgent
   240  	result.Ntp = o.Ntp
   241  	result.HttpProxy = o.HttpProxy
   242  	result.HttpsProxy = o.HttpsProxy
   243  	result.NoProxy = o.NoProxy
   244  	return result
   245  }
   246  
   247  func (o *CustomizedImage_Spec) CloneRaw() gotenobject.GotenObjectExt {
   248  	return o.Clone()
   249  }
   250  
   251  func (o *CustomizedImage_Spec) Merge(source *CustomizedImage_Spec) {
   252  	o.Version = source.GetVersion()
   253  	o.DeviceType = source.GetDeviceType()
   254  	o.ProvisioningPolicy = source.GetProvisioningPolicy()
   255  	o.InstallAiAccelerator = source.GetInstallAiAccelerator()
   256  	o.Password = source.GetPassword()
   257  	o.Encryption = source.GetEncryption()
   258  	o.EncryptionPassword = source.GetEncryptionPassword()
   259  	o.DiskMapping = source.GetDiskMapping()
   260  	o.NetworkAgent = source.GetNetworkAgent()
   261  	o.Ntp = source.GetNtp()
   262  	o.HttpProxy = source.GetHttpProxy()
   263  	o.HttpsProxy = source.GetHttpsProxy()
   264  	o.NoProxy = source.GetNoProxy()
   265  }
   266  
   267  func (o *CustomizedImage_Spec) MergeRaw(source gotenobject.GotenObjectExt) {
   268  	o.Merge(source.(*CustomizedImage_Spec))
   269  }
   270  
   271  func (o *CustomizedImage_Status) GotenObjectExt() {}
   272  
   273  func (o *CustomizedImage_Status) MakeFullFieldMask() *CustomizedImage_Status_FieldMask {
   274  	return FullCustomizedImage_Status_FieldMask()
   275  }
   276  
   277  func (o *CustomizedImage_Status) MakeRawFullFieldMask() gotenobject.FieldMask {
   278  	return FullCustomizedImage_Status_FieldMask()
   279  }
   280  
   281  func (o *CustomizedImage_Status) MakeDiffFieldMask(other *CustomizedImage_Status) *CustomizedImage_Status_FieldMask {
   282  	if o == nil && other == nil {
   283  		return &CustomizedImage_Status_FieldMask{}
   284  	}
   285  	if o == nil || other == nil {
   286  		return FullCustomizedImage_Status_FieldMask()
   287  	}
   288  
   289  	res := &CustomizedImage_Status_FieldMask{}
   290  	if o.GetState() != other.GetState() {
   291  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorState})
   292  	}
   293  	if o.GetLog() != other.GetLog() {
   294  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorLog})
   295  	}
   296  	if o.GetFile() != other.GetFile() {
   297  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorFile})
   298  	}
   299  	return res
   300  }
   301  
   302  func (o *CustomizedImage_Status) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
   303  	return o.MakeDiffFieldMask(other.(*CustomizedImage_Status))
   304  }
   305  
   306  func (o *CustomizedImage_Status) Clone() *CustomizedImage_Status {
   307  	if o == nil {
   308  		return nil
   309  	}
   310  	result := &CustomizedImage_Status{}
   311  	result.State = o.State
   312  	result.Log = o.Log
   313  	result.File = o.File
   314  	return result
   315  }
   316  
   317  func (o *CustomizedImage_Status) CloneRaw() gotenobject.GotenObjectExt {
   318  	return o.Clone()
   319  }
   320  
   321  func (o *CustomizedImage_Status) Merge(source *CustomizedImage_Status) {
   322  	o.State = source.GetState()
   323  	o.Log = source.GetLog()
   324  	o.File = source.GetFile()
   325  }
   326  
   327  func (o *CustomizedImage_Status) MergeRaw(source gotenobject.GotenObjectExt) {
   328  	o.Merge(source.(*CustomizedImage_Status))
   329  }