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

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