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

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