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

     1  // Code generated by protoc-gen-goten-object
     2  // File: edgelq/devices/proto/v1/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  	os_version "github.com/cloudwan/edgelq-sdk/devices/resources/v1/os_version"
    20  	project "github.com/cloudwan/edgelq-sdk/devices/resources/v1/project"
    21  	iam_service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account"
    22  	iam_service_account_key "github.com/cloudwan/edgelq-sdk/iam/resources/v1/service_account_key"
    23  	meta "github.com/cloudwan/goten-sdk/types/meta"
    24  )
    25  
    26  // ensure the imports are used
    27  var (
    28  	_ = new(fmt.Stringer)
    29  	_ = new(sort.Interface)
    30  
    31  	_ = new(proto.Message)
    32  	_ = googlefieldmaskpb.FieldMask{}
    33  
    34  	_ = new(gotenobject.FieldPath)
    35  )
    36  
    37  // make sure we're using proto imports
    38  var (
    39  	_ = &os_version.OsVersion{}
    40  	_ = &project.Project{}
    41  	_ = &iam_service_account.ServiceAccount{}
    42  	_ = &iam_service_account_key.ServiceAccountKey{}
    43  	_ = &meta.Meta{}
    44  )
    45  
    46  func (o *CustomizedImage) GotenObjectExt() {}
    47  
    48  func (o *CustomizedImage) MakeFullFieldMask() *CustomizedImage_FieldMask {
    49  	return FullCustomizedImage_FieldMask()
    50  }
    51  
    52  func (o *CustomizedImage) MakeRawFullFieldMask() gotenobject.FieldMask {
    53  	return FullCustomizedImage_FieldMask()
    54  }
    55  
    56  func (o *CustomizedImage) MakeDiffFieldMask(other *CustomizedImage) *CustomizedImage_FieldMask {
    57  	if o == nil && other == nil {
    58  		return &CustomizedImage_FieldMask{}
    59  	}
    60  	if o == nil || other == nil {
    61  		return FullCustomizedImage_FieldMask()
    62  	}
    63  
    64  	res := &CustomizedImage_FieldMask{}
    65  	if o.GetName().String() != other.GetName().String() {
    66  		res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorName})
    67  	}
    68  	{
    69  		subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata())
    70  		if subMask.IsFull() {
    71  			res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorMetadata})
    72  		} else {
    73  			for _, subpath := range subMask.Paths {
    74  				res.Paths = append(res.Paths, &CustomizedImage_FieldSubPath{selector: CustomizedImage_FieldPathSelectorMetadata, subPath: subpath})
    75  			}
    76  		}
    77  	}
    78  	{
    79  		subMask := o.GetSpec().MakeDiffFieldMask(other.GetSpec())
    80  		if subMask.IsFull() {
    81  			res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorSpec})
    82  		} else {
    83  			for _, subpath := range subMask.Paths {
    84  				res.Paths = append(res.Paths, &CustomizedImage_FieldSubPath{selector: CustomizedImage_FieldPathSelectorSpec, subPath: subpath})
    85  			}
    86  		}
    87  	}
    88  	{
    89  		subMask := o.GetStatus().MakeDiffFieldMask(other.GetStatus())
    90  		if subMask.IsFull() {
    91  			res.Paths = append(res.Paths, &CustomizedImage_FieldTerminalPath{selector: CustomizedImage_FieldPathSelectorStatus})
    92  		} else {
    93  			for _, subpath := range subMask.Paths {
    94  				res.Paths = append(res.Paths, &CustomizedImage_FieldSubPath{selector: CustomizedImage_FieldPathSelectorStatus, subPath: subpath})
    95  			}
    96  		}
    97  	}
    98  	return res
    99  }
   100  
   101  func (o *CustomizedImage) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
   102  	return o.MakeDiffFieldMask(other.(*CustomizedImage))
   103  }
   104  
   105  func (o *CustomizedImage) Clone() *CustomizedImage {
   106  	if o == nil {
   107  		return nil
   108  	}
   109  	result := &CustomizedImage{}
   110  	if o.Name == nil {
   111  		result.Name = nil
   112  	} else if data, err := o.Name.ProtoString(); err != nil {
   113  		panic(err)
   114  	} else {
   115  		result.Name = &Name{}
   116  		if err := result.Name.ParseProtoString(data); err != nil {
   117  			panic(err)
   118  		}
   119  	}
   120  	result.Metadata = o.Metadata.Clone()
   121  	result.Spec = o.Spec.Clone()
   122  	result.Status = o.Status.Clone()
   123  	return result
   124  }
   125  
   126  func (o *CustomizedImage) CloneRaw() gotenobject.GotenObjectExt {
   127  	return o.Clone()
   128  }
   129  
   130  func (o *CustomizedImage) Merge(source *CustomizedImage) {
   131  	if source.GetName() != nil {
   132  		if data, err := source.GetName().ProtoString(); err != nil {
   133  			panic(err)
   134  		} else {
   135  			o.Name = &Name{}
   136  			if err := o.Name.ParseProtoString(data); err != nil {
   137  				panic(err)
   138  			}
   139  		}
   140  	} else {
   141  		o.Name = nil
   142  	}
   143  	if source.GetMetadata() != nil {
   144  		if o.Metadata == nil {
   145  			o.Metadata = new(meta.Meta)
   146  		}
   147  		o.Metadata.Merge(source.GetMetadata())
   148  	}
   149  	if source.GetSpec() != nil {
   150  		if o.Spec == nil {
   151  			o.Spec = new(CustomizedImage_Spec)
   152  		}
   153  		o.Spec.Merge(source.GetSpec())
   154  	}
   155  	if source.GetStatus() != nil {
   156  		if o.Status == nil {
   157  			o.Status = new(CustomizedImage_Status)
   158  		}
   159  		o.Status.Merge(source.GetStatus())
   160  	}
   161  }
   162  
   163  func (o *CustomizedImage) MergeRaw(source gotenobject.GotenObjectExt) {
   164  	o.Merge(source.(*CustomizedImage))
   165  }
   166  
   167  func (o *CustomizedImage_Spec) GotenObjectExt() {}
   168  
   169  func (o *CustomizedImage_Spec) MakeFullFieldMask() *CustomizedImage_Spec_FieldMask {
   170  	return FullCustomizedImage_Spec_FieldMask()
   171  }
   172  
   173  func (o *CustomizedImage_Spec) MakeRawFullFieldMask() gotenobject.FieldMask {
   174  	return FullCustomizedImage_Spec_FieldMask()
   175  }
   176  
   177  func (o *CustomizedImage_Spec) MakeDiffFieldMask(other *CustomizedImage_Spec) *CustomizedImage_Spec_FieldMask {
   178  	if o == nil && other == nil {
   179  		return &CustomizedImage_Spec_FieldMask{}
   180  	}
   181  	if o == nil || other == nil {
   182  		return FullCustomizedImage_Spec_FieldMask()
   183  	}
   184  
   185  	res := &CustomizedImage_Spec_FieldMask{}
   186  	if o.GetVersion() != other.GetVersion() {
   187  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorVersion})
   188  	}
   189  	if o.GetDeviceType() != other.GetDeviceType() {
   190  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorDeviceType})
   191  	}
   192  	if o.GetOsVersion().String() != other.GetOsVersion().String() {
   193  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorOsVersion})
   194  	}
   195  	if o.GetProvisioningPolicy() != other.GetProvisioningPolicy() {
   196  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorProvisioningPolicy})
   197  	}
   198  	if o.GetServiceAccount().String() != other.GetServiceAccount().String() {
   199  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorServiceAccount})
   200  	}
   201  	if o.GetServiceAccountKey().String() != other.GetServiceAccountKey().String() {
   202  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorServiceAccountKey})
   203  	}
   204  	if o.GetPassword() != other.GetPassword() {
   205  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorPassword})
   206  	}
   207  	if o.GetEncryption() != other.GetEncryption() {
   208  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorEncryption})
   209  	}
   210  	if o.GetEncryptionPassword() != other.GetEncryptionPassword() {
   211  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorEncryptionPassword})
   212  	}
   213  	if o.GetDiskMapping() != other.GetDiskMapping() {
   214  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorDiskMapping})
   215  	}
   216  	if o.GetNetworkAgent() != other.GetNetworkAgent() {
   217  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorNetworkAgent})
   218  	}
   219  	if o.GetNtp() != other.GetNtp() {
   220  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorNtp})
   221  	}
   222  	if o.GetHttpProxy() != other.GetHttpProxy() {
   223  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorHttpProxy})
   224  	}
   225  	if o.GetHttpsProxy() != other.GetHttpsProxy() {
   226  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorHttpsProxy})
   227  	}
   228  	if o.GetNoProxy() != other.GetNoProxy() {
   229  		res.Paths = append(res.Paths, &CustomizedImageSpec_FieldTerminalPath{selector: CustomizedImageSpec_FieldPathSelectorNoProxy})
   230  	}
   231  	return res
   232  }
   233  
   234  func (o *CustomizedImage_Spec) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
   235  	return o.MakeDiffFieldMask(other.(*CustomizedImage_Spec))
   236  }
   237  
   238  func (o *CustomizedImage_Spec) Clone() *CustomizedImage_Spec {
   239  	if o == nil {
   240  		return nil
   241  	}
   242  	result := &CustomizedImage_Spec{}
   243  	result.Version = o.Version
   244  	result.DeviceType = o.DeviceType
   245  	if o.OsVersion == nil {
   246  		result.OsVersion = nil
   247  	} else if data, err := o.OsVersion.ProtoString(); err != nil {
   248  		panic(err)
   249  	} else {
   250  		result.OsVersion = &os_version.Reference{}
   251  		if err := result.OsVersion.ParseProtoString(data); err != nil {
   252  			panic(err)
   253  		}
   254  	}
   255  	result.ProvisioningPolicy = o.ProvisioningPolicy
   256  	if o.ServiceAccount == nil {
   257  		result.ServiceAccount = nil
   258  	} else if data, err := o.ServiceAccount.ProtoString(); err != nil {
   259  		panic(err)
   260  	} else {
   261  		result.ServiceAccount = &iam_service_account.Reference{}
   262  		if err := result.ServiceAccount.ParseProtoString(data); err != nil {
   263  			panic(err)
   264  		}
   265  	}
   266  	if o.ServiceAccountKey == nil {
   267  		result.ServiceAccountKey = nil
   268  	} else if data, err := o.ServiceAccountKey.ProtoString(); err != nil {
   269  		panic(err)
   270  	} else {
   271  		result.ServiceAccountKey = &iam_service_account_key.Reference{}
   272  		if err := result.ServiceAccountKey.ParseProtoString(data); err != nil {
   273  			panic(err)
   274  		}
   275  	}
   276  	result.Password = o.Password
   277  	result.Encryption = o.Encryption
   278  	result.EncryptionPassword = o.EncryptionPassword
   279  	result.DiskMapping = o.DiskMapping
   280  	result.NetworkAgent = o.NetworkAgent
   281  	result.Ntp = o.Ntp
   282  	result.HttpProxy = o.HttpProxy
   283  	result.HttpsProxy = o.HttpsProxy
   284  	result.NoProxy = o.NoProxy
   285  	return result
   286  }
   287  
   288  func (o *CustomizedImage_Spec) CloneRaw() gotenobject.GotenObjectExt {
   289  	return o.Clone()
   290  }
   291  
   292  func (o *CustomizedImage_Spec) Merge(source *CustomizedImage_Spec) {
   293  	o.Version = source.GetVersion()
   294  	o.DeviceType = source.GetDeviceType()
   295  	if source.GetOsVersion() != nil {
   296  		if data, err := source.GetOsVersion().ProtoString(); err != nil {
   297  			panic(err)
   298  		} else {
   299  			o.OsVersion = &os_version.Reference{}
   300  			if err := o.OsVersion.ParseProtoString(data); err != nil {
   301  				panic(err)
   302  			}
   303  		}
   304  	} else {
   305  		o.OsVersion = nil
   306  	}
   307  	o.ProvisioningPolicy = source.GetProvisioningPolicy()
   308  	if source.GetServiceAccount() != nil {
   309  		if data, err := source.GetServiceAccount().ProtoString(); err != nil {
   310  			panic(err)
   311  		} else {
   312  			o.ServiceAccount = &iam_service_account.Reference{}
   313  			if err := o.ServiceAccount.ParseProtoString(data); err != nil {
   314  				panic(err)
   315  			}
   316  		}
   317  	} else {
   318  		o.ServiceAccount = nil
   319  	}
   320  	if source.GetServiceAccountKey() != nil {
   321  		if data, err := source.GetServiceAccountKey().ProtoString(); err != nil {
   322  			panic(err)
   323  		} else {
   324  			o.ServiceAccountKey = &iam_service_account_key.Reference{}
   325  			if err := o.ServiceAccountKey.ParseProtoString(data); err != nil {
   326  				panic(err)
   327  			}
   328  		}
   329  	} else {
   330  		o.ServiceAccountKey = nil
   331  	}
   332  	o.Password = source.GetPassword()
   333  	o.Encryption = source.GetEncryption()
   334  	o.EncryptionPassword = source.GetEncryptionPassword()
   335  	o.DiskMapping = source.GetDiskMapping()
   336  	o.NetworkAgent = source.GetNetworkAgent()
   337  	o.Ntp = source.GetNtp()
   338  	o.HttpProxy = source.GetHttpProxy()
   339  	o.HttpsProxy = source.GetHttpsProxy()
   340  	o.NoProxy = source.GetNoProxy()
   341  }
   342  
   343  func (o *CustomizedImage_Spec) MergeRaw(source gotenobject.GotenObjectExt) {
   344  	o.Merge(source.(*CustomizedImage_Spec))
   345  }
   346  
   347  func (o *CustomizedImage_Status) GotenObjectExt() {}
   348  
   349  func (o *CustomizedImage_Status) MakeFullFieldMask() *CustomizedImage_Status_FieldMask {
   350  	return FullCustomizedImage_Status_FieldMask()
   351  }
   352  
   353  func (o *CustomizedImage_Status) MakeRawFullFieldMask() gotenobject.FieldMask {
   354  	return FullCustomizedImage_Status_FieldMask()
   355  }
   356  
   357  func (o *CustomizedImage_Status) MakeDiffFieldMask(other *CustomizedImage_Status) *CustomizedImage_Status_FieldMask {
   358  	if o == nil && other == nil {
   359  		return &CustomizedImage_Status_FieldMask{}
   360  	}
   361  	if o == nil || other == nil {
   362  		return FullCustomizedImage_Status_FieldMask()
   363  	}
   364  
   365  	res := &CustomizedImage_Status_FieldMask{}
   366  	if o.GetState() != other.GetState() {
   367  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorState})
   368  	}
   369  	if o.GetLog() != other.GetLog() {
   370  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorLog})
   371  	}
   372  	if o.GetFile() != other.GetFile() {
   373  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorFile})
   374  	}
   375  	if o.GetMd5Sum() != other.GetMd5Sum() {
   376  		res.Paths = append(res.Paths, &CustomizedImageStatus_FieldTerminalPath{selector: CustomizedImageStatus_FieldPathSelectorMd5Sum})
   377  	}
   378  	return res
   379  }
   380  
   381  func (o *CustomizedImage_Status) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
   382  	return o.MakeDiffFieldMask(other.(*CustomizedImage_Status))
   383  }
   384  
   385  func (o *CustomizedImage_Status) Clone() *CustomizedImage_Status {
   386  	if o == nil {
   387  		return nil
   388  	}
   389  	result := &CustomizedImage_Status{}
   390  	result.State = o.State
   391  	result.Log = o.Log
   392  	result.File = o.File
   393  	result.Md5Sum = o.Md5Sum
   394  	return result
   395  }
   396  
   397  func (o *CustomizedImage_Status) CloneRaw() gotenobject.GotenObjectExt {
   398  	return o.Clone()
   399  }
   400  
   401  func (o *CustomizedImage_Status) Merge(source *CustomizedImage_Status) {
   402  	o.State = source.GetState()
   403  	o.Log = source.GetLog()
   404  	o.File = source.GetFile()
   405  	o.Md5Sum = source.GetMd5Sum()
   406  }
   407  
   408  func (o *CustomizedImage_Status) MergeRaw(source gotenobject.GotenObjectExt) {
   409  	o.Merge(source.(*CustomizedImage_Status))
   410  }