github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/notification_channel/notification_channel.pb.collections.go (about)

     1  // Code generated by protoc-gen-goten-resource
     2  // Resource: NotificationChannel
     3  // DO NOT EDIT!!!
     4  
     5  package notification_channel
     6  
     7  import (
     8  	gotenresource "github.com/cloudwan/goten-sdk/runtime/resource"
     9  )
    10  
    11  // proto imports
    12  import (
    13  	project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/project"
    14  	meta "github.com/cloudwan/goten-sdk/types/meta"
    15  	fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
    16  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
    17  )
    18  
    19  // ensure the imports are used
    20  var (
    21  	_ = new(gotenresource.ListQuery)
    22  )
    23  
    24  // make sure we're using proto imports
    25  var (
    26  	_ = &project.Project{}
    27  	_ = &fieldmaskpb.FieldMask{}
    28  	_ = &timestamppb.Timestamp{}
    29  	_ = &meta.Meta{}
    30  )
    31  
    32  type NotificationChannelList []*NotificationChannel
    33  
    34  func (l NotificationChannelList) Append(item gotenresource.Resource) gotenresource.ResourceList {
    35  	return append(l, item.(*NotificationChannel))
    36  }
    37  
    38  func (l NotificationChannelList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList {
    39  	return append(l, list.(NotificationChannelList)...)
    40  }
    41  
    42  func (l NotificationChannelList) Slice(first, second int) gotenresource.ResourceList {
    43  	if first > 0 && second > 0 {
    44  		return l[first:second]
    45  	} else if first > 0 {
    46  		return l[first:]
    47  	} else if second > 0 {
    48  		return l[:second]
    49  	}
    50  	return l[:]
    51  }
    52  
    53  func (l NotificationChannelList) At(idx int) gotenresource.Resource {
    54  	return l[idx]
    55  }
    56  
    57  func (l NotificationChannelList) Set(idx int, res gotenresource.Resource) {
    58  	l[idx] = res.(*NotificationChannel)
    59  }
    60  
    61  func (l NotificationChannelList) Length() int {
    62  	return len(l)
    63  }
    64  
    65  type NotificationChannelChangeList []*NotificationChannelChange
    66  
    67  func (l NotificationChannelChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList {
    68  	return append(l, item.(*NotificationChannelChange))
    69  }
    70  
    71  func (l NotificationChannelChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList {
    72  	return append(l, list.(NotificationChannelChangeList)...)
    73  }
    74  
    75  func (l NotificationChannelChangeList) Slice(first, second int) gotenresource.ResourceChangeList {
    76  	if first > 0 && second > 0 {
    77  		return l[first:second]
    78  	} else if first > 0 {
    79  		return l[first:]
    80  	} else if second > 0 {
    81  		return l[:second]
    82  	}
    83  	return l[:]
    84  }
    85  
    86  func (l NotificationChannelChangeList) At(idx int) gotenresource.ResourceChange {
    87  	return l[idx]
    88  }
    89  
    90  func (l NotificationChannelChangeList) Set(idx int, change gotenresource.ResourceChange) {
    91  	l[idx] = change.(*NotificationChannelChange)
    92  }
    93  
    94  func (l NotificationChannelChangeList) Length() int {
    95  	return len(l)
    96  }
    97  
    98  type NotificationChannelNameList []*Name
    99  
   100  func (l NotificationChannelNameList) Append(name gotenresource.Name) gotenresource.NameList {
   101  	return append(l, name.(*Name))
   102  }
   103  
   104  func (l NotificationChannelNameList) AppendList(list gotenresource.NameList) gotenresource.NameList {
   105  	return append(l, list.(NotificationChannelNameList)...)
   106  }
   107  
   108  func (l NotificationChannelNameList) Slice(first, second int) gotenresource.NameList {
   109  	if first > 0 && second > 0 {
   110  		return l[first:second]
   111  	} else if first > 0 {
   112  		return l[first:]
   113  	} else if second > 0 {
   114  		return l[:second]
   115  	}
   116  	return l[:]
   117  }
   118  
   119  func (l NotificationChannelNameList) At(idx int) gotenresource.Name {
   120  	return l[idx]
   121  }
   122  
   123  func (l NotificationChannelNameList) Set(idx int, name gotenresource.Name) {
   124  	l[idx] = name.(*Name)
   125  }
   126  
   127  func (l NotificationChannelNameList) Length() int {
   128  	return len(l)
   129  }
   130  
   131  type NotificationChannelReferenceList []*Reference
   132  
   133  func (l NotificationChannelReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList {
   134  	return append(l, ref.(*Reference))
   135  }
   136  
   137  func (l NotificationChannelReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList {
   138  	return append(l, list.(NotificationChannelReferenceList)...)
   139  }
   140  
   141  func (l NotificationChannelReferenceList) Slice(first, second int) gotenresource.ReferenceList {
   142  	if first > 0 && second > 0 {
   143  		return l[first:second]
   144  	} else if first > 0 {
   145  		return l[first:]
   146  	} else if second > 0 {
   147  		return l[:second]
   148  	}
   149  	return l[:]
   150  }
   151  
   152  func (l NotificationChannelReferenceList) At(idx int) gotenresource.Reference {
   153  	return l[idx]
   154  }
   155  
   156  func (l NotificationChannelReferenceList) Set(idx int, ref gotenresource.Reference) {
   157  	l[idx] = ref.(*Reference)
   158  }
   159  
   160  func (l NotificationChannelReferenceList) Length() int {
   161  	return len(l)
   162  }
   163  
   164  type NotificationChannelParentNameList []*ParentName
   165  
   166  func (l NotificationChannelParentNameList) Append(name gotenresource.Name) gotenresource.ParentNameList {
   167  	return append(l, name.(*ParentName))
   168  }
   169  
   170  func (l NotificationChannelParentNameList) AppendList(list gotenresource.ParentNameList) gotenresource.ParentNameList {
   171  	return append(l, list.(NotificationChannelParentNameList)...)
   172  }
   173  
   174  func (l NotificationChannelParentNameList) Slice(first, second int) gotenresource.ParentNameList {
   175  	if first > 0 && second > 0 {
   176  		return l[first:second]
   177  	} else if first > 0 {
   178  		return l[first:]
   179  	} else if second > 0 {
   180  		return l[:second]
   181  	}
   182  	return l[:]
   183  }
   184  
   185  func (l NotificationChannelParentNameList) At(idx int) gotenresource.Name {
   186  	return l[idx]
   187  }
   188  
   189  func (l NotificationChannelParentNameList) Set(idx int, name gotenresource.Name) {
   190  	l[idx] = name.(*ParentName)
   191  }
   192  
   193  func (l NotificationChannelParentNameList) Length() int {
   194  	return len(l)
   195  }
   196  
   197  type NotificationChannelParentReferenceList []*ParentReference
   198  
   199  func (l NotificationChannelParentReferenceList) Append(ref gotenresource.Reference) gotenresource.ParentReferenceList {
   200  	return append(l, ref.(*ParentReference))
   201  }
   202  
   203  func (l NotificationChannelParentReferenceList) AppendList(list gotenresource.ParentReferenceList) gotenresource.ParentReferenceList {
   204  	return append(l, list.(NotificationChannelParentReferenceList)...)
   205  }
   206  
   207  func (l NotificationChannelParentReferenceList) Slice(first, second int) gotenresource.ParentReferenceList {
   208  	if first > 0 && second > 0 {
   209  		return l[first:second]
   210  	} else if first > 0 {
   211  		return l[first:]
   212  	} else if second > 0 {
   213  		return l[:second]
   214  	}
   215  	return l[:]
   216  }
   217  
   218  func (l NotificationChannelParentReferenceList) At(idx int) gotenresource.Reference {
   219  	return l[idx]
   220  }
   221  
   222  func (l NotificationChannelParentReferenceList) Set(idx int, ref gotenresource.Reference) {
   223  	l[idx] = ref.(*ParentReference)
   224  }
   225  
   226  func (l NotificationChannelParentReferenceList) Length() int {
   227  	return len(l)
   228  }
   229  
   230  type NotificationChannelMap map[Name]*NotificationChannel
   231  
   232  func (m NotificationChannelMap) Get(name gotenresource.Name) gotenresource.Resource {
   233  	return m[*name.(*Name)]
   234  }
   235  
   236  func (m NotificationChannelMap) Set(res gotenresource.Resource) {
   237  	tRes := res.(*NotificationChannel)
   238  	m[*tRes.Name] = tRes
   239  }
   240  
   241  func (m NotificationChannelMap) Delete(name gotenresource.Name) {
   242  	delete(m, *name.(*Name))
   243  }
   244  
   245  func (m NotificationChannelMap) Length() int {
   246  	return len(m)
   247  }
   248  
   249  func (m NotificationChannelMap) ForEach(cb func(gotenresource.Name, gotenresource.Resource) bool) {
   250  	for name, res := range m {
   251  		if !cb(&name, res) {
   252  			break
   253  		}
   254  	}
   255  }
   256  
   257  type NotificationChannelChangeMap map[Name]*NotificationChannelChange
   258  
   259  func (m NotificationChannelChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange {
   260  	return m[*name.(*Name)]
   261  }
   262  
   263  func (m NotificationChannelChangeMap) Set(change gotenresource.ResourceChange) {
   264  	tChange := change.(*NotificationChannelChange)
   265  	m[*tChange.GetNotificationChannelName()] = tChange
   266  }
   267  
   268  func (m NotificationChannelChangeMap) Delete(name gotenresource.Name) {
   269  	delete(m, *name.(*Name))
   270  }
   271  
   272  func (m NotificationChannelChangeMap) Length() int {
   273  	return len(m)
   274  }
   275  
   276  func (m NotificationChannelChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) {
   277  	for name, res := range m {
   278  		if !cb(&name, res) {
   279  			break
   280  		}
   281  	}
   282  }