github.com/enbility/spine-go@v0.7.0/model/threshold_additions.go (about)

     1  package model
     2  
     3  // ThresholdListDataType
     4  
     5  var _ Updater = (*ThresholdListDataType)(nil)
     6  
     7  func (r *ThresholdListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
     8  	var newData []ThresholdDataType
     9  	if newList != nil {
    10  		newData = newList.(*ThresholdListDataType).ThresholdData
    11  	}
    12  
    13  	data, success := UpdateList(remoteWrite, r.ThresholdData, newData, filterPartial, filterDelete)
    14  
    15  	if success && persist {
    16  		r.ThresholdData = data
    17  	}
    18  
    19  	return data, success
    20  }
    21  
    22  // ThresholdConstraintsListDataType
    23  
    24  var _ Updater = (*ThresholdConstraintsListDataType)(nil)
    25  
    26  func (r *ThresholdConstraintsListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
    27  	var newData []ThresholdConstraintsDataType
    28  	if newList != nil {
    29  		newData = newList.(*ThresholdConstraintsListDataType).ThresholdConstraintsData
    30  	}
    31  
    32  	data, success := UpdateList(remoteWrite, r.ThresholdConstraintsData, newData, filterPartial, filterDelete)
    33  
    34  	if success && persist {
    35  		r.ThresholdConstraintsData = data
    36  	}
    37  
    38  	return data, success
    39  }
    40  
    41  // ThresholdDescriptionListDataType
    42  
    43  var _ Updater = (*ThresholdDescriptionListDataType)(nil)
    44  
    45  func (r *ThresholdDescriptionListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
    46  	var newData []ThresholdDescriptionDataType
    47  	if newList != nil {
    48  		newData = newList.(*ThresholdDescriptionListDataType).ThresholdDescriptionData
    49  	}
    50  
    51  	data, success := UpdateList(remoteWrite, r.ThresholdDescriptionData, newData, filterPartial, filterDelete)
    52  
    53  	if success && persist {
    54  		r.ThresholdDescriptionData = data
    55  	}
    56  
    57  	return data, success
    58  }