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

     1  package model
     2  
     3  // TariffListDataType
     4  
     5  var _ Updater = (*TariffListDataType)(nil)
     6  
     7  func (r *TariffListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
     8  	var newData []TariffDataType
     9  	if newList != nil {
    10  		newData = newList.(*TariffListDataType).TariffData
    11  	}
    12  
    13  	data, success := UpdateList(remoteWrite, r.TariffData, newData, filterPartial, filterDelete)
    14  
    15  	if success && persist {
    16  		r.TariffData = data
    17  	}
    18  
    19  	return data, success
    20  }
    21  
    22  // TariffTierRelationListDataType
    23  
    24  var _ Updater = (*TariffTierRelationListDataType)(nil)
    25  
    26  func (r *TariffTierRelationListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
    27  	var newData []TariffTierRelationDataType
    28  	if newList != nil {
    29  		newData = newList.(*TariffTierRelationListDataType).TariffTierRelationData
    30  	}
    31  
    32  	data, success := UpdateList(remoteWrite, r.TariffTierRelationData, newData, filterPartial, filterDelete)
    33  
    34  	if success && persist {
    35  		r.TariffTierRelationData = data
    36  	}
    37  
    38  	return data, success
    39  }
    40  
    41  // TariffBoundaryRelationListDataType
    42  
    43  var _ Updater = (*TariffBoundaryRelationListDataType)(nil)
    44  
    45  func (r *TariffBoundaryRelationListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
    46  	var newData []TariffBoundaryRelationDataType
    47  	if newList != nil {
    48  		newData = newList.(*TariffBoundaryRelationListDataType).TariffBoundaryRelationData
    49  	}
    50  
    51  	data, success := UpdateList(remoteWrite, r.TariffBoundaryRelationData, newData, filterPartial, filterDelete)
    52  
    53  	if success && persist {
    54  		r.TariffBoundaryRelationData = data
    55  	}
    56  
    57  	return data, success
    58  }
    59  
    60  // TariffDescriptionListDataType
    61  
    62  var _ Updater = (*TariffDescriptionListDataType)(nil)
    63  
    64  func (r *TariffDescriptionListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
    65  	var newData []TariffDescriptionDataType
    66  	if newList != nil {
    67  		newData = newList.(*TariffDescriptionListDataType).TariffDescriptionData
    68  	}
    69  
    70  	data, success := UpdateList(remoteWrite, r.TariffDescriptionData, newData, filterPartial, filterDelete)
    71  
    72  	if success && persist {
    73  		r.TariffDescriptionData = data
    74  	}
    75  
    76  	return data, success
    77  }
    78  
    79  // TierBoundaryListDataType
    80  
    81  var _ Updater = (*TierBoundaryListDataType)(nil)
    82  
    83  func (r *TierBoundaryListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
    84  	var newData []TierBoundaryDataType
    85  	if newList != nil {
    86  		newData = newList.(*TierBoundaryListDataType).TierBoundaryData
    87  	}
    88  
    89  	data, success := UpdateList(remoteWrite, r.TierBoundaryData, newData, filterPartial, filterDelete)
    90  
    91  	if success && persist {
    92  		r.TierBoundaryData = data
    93  	}
    94  
    95  	return data, success
    96  }
    97  
    98  // TierBoundaryDescriptionListDataType
    99  
   100  var _ Updater = (*TierBoundaryDescriptionListDataType)(nil)
   101  
   102  func (r *TierBoundaryDescriptionListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   103  	var newData []TierBoundaryDescriptionDataType
   104  	if newList != nil {
   105  		newData = newList.(*TierBoundaryDescriptionListDataType).TierBoundaryDescriptionData
   106  	}
   107  
   108  	data, success := UpdateList(remoteWrite, r.TierBoundaryDescriptionData, newData, filterPartial, filterDelete)
   109  
   110  	if success && persist {
   111  		r.TierBoundaryDescriptionData = data
   112  	}
   113  
   114  	return data, success
   115  }
   116  
   117  // CommodityListDataType
   118  
   119  var _ Updater = (*CommodityListDataType)(nil)
   120  
   121  func (r *CommodityListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   122  	var newData []CommodityDataType
   123  	if newList != nil {
   124  		newData = newList.(*CommodityListDataType).CommodityData
   125  	}
   126  
   127  	data, success := UpdateList(remoteWrite, r.CommodityData, newData, filterPartial, filterDelete)
   128  
   129  	if success && persist {
   130  		r.CommodityData = data
   131  	}
   132  
   133  	return data, success
   134  }
   135  
   136  // TierListDataType
   137  
   138  var _ Updater = (*TierListDataType)(nil)
   139  
   140  func (r *TierListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   141  	var newData []TierDataType
   142  	if newList != nil {
   143  		newData = newList.(*TierListDataType).TierData
   144  	}
   145  
   146  	data, success := UpdateList(remoteWrite, r.TierData, newData, filterPartial, filterDelete)
   147  
   148  	if success && persist {
   149  		r.TierData = data
   150  	}
   151  
   152  	return data, success
   153  }
   154  
   155  // TierIncentiveRelationListDataType
   156  
   157  var _ Updater = (*TierIncentiveRelationListDataType)(nil)
   158  
   159  func (r *TierIncentiveRelationListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   160  	var newData []TierIncentiveRelationDataType
   161  	if newList != nil {
   162  		newData = newList.(*TierIncentiveRelationListDataType).TierIncentiveRelationData
   163  	}
   164  
   165  	data, success := UpdateList(remoteWrite, r.TierIncentiveRelationData, newData, filterPartial, filterDelete)
   166  
   167  	if success && persist {
   168  		r.TierIncentiveRelationData = data
   169  	}
   170  
   171  	return data, success
   172  }
   173  
   174  // TierDescriptionListDataType
   175  
   176  var _ Updater = (*TierDescriptionListDataType)(nil)
   177  
   178  func (r *TierDescriptionListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   179  	var newData []TierDescriptionDataType
   180  	if newList != nil {
   181  		newData = newList.(*TierDescriptionListDataType).TierDescriptionData
   182  	}
   183  
   184  	data, success := UpdateList(remoteWrite, r.TierDescriptionData, newData, filterPartial, filterDelete)
   185  
   186  	if success && persist {
   187  		r.TierDescriptionData = data
   188  	}
   189  
   190  	return data, success
   191  }
   192  
   193  // IncentiveListDataType
   194  
   195  var _ Updater = (*IncentiveListDataType)(nil)
   196  
   197  func (r *IncentiveListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   198  	var newData []IncentiveDataType
   199  	if newList != nil {
   200  		newData = newList.(*IncentiveListDataType).IncentiveData
   201  	}
   202  
   203  	data, success := UpdateList(remoteWrite, r.IncentiveData, newData, filterPartial, filterDelete)
   204  
   205  	if success && persist {
   206  		r.IncentiveData = data
   207  	}
   208  
   209  	return data, success
   210  }
   211  
   212  // IncentiveDescriptionListDataType
   213  
   214  var _ Updater = (*IncentiveDescriptionListDataType)(nil)
   215  
   216  func (r *IncentiveDescriptionListDataType) UpdateList(remoteWrite, persist bool, newList any, filterPartial, filterDelete *FilterType) (any, bool) {
   217  	var newData []IncentiveDescriptionDataType
   218  	if newList != nil {
   219  		newData = newList.(*IncentiveDescriptionListDataType).IncentiveDescriptionData
   220  	}
   221  
   222  	data, success := UpdateList(remoteWrite, r.IncentiveDescriptionData, newData, filterPartial, filterDelete)
   223  
   224  	if success && persist {
   225  		r.IncentiveDescriptionData = data
   226  	}
   227  
   228  	return data, success
   229  }