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