File: cc_sec_transfer_acl.go

package info (click to toggle)
golang-github-mimuret-golang-iij-dpf 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: makefile: 55
file content (61 lines) | stat: -rw-r--r-- 2,052 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package common_configs

import (
	"github.com/mimuret/golang-iij-dpf/pkg/api"
	"github.com/mimuret/golang-iij-dpf/pkg/apis"
	"github.com/mimuret/golang-iij-dpf/pkg/types"
)

// for IDE
var _ ChildSpec = &CcSecTransferAcl{}

// +k8s:deepcopy-gen:interfaces=github.com/mimuret/golang-iij-dpf/pkg/api.Object
type CcSecTransferAcl struct {
	AttributeMeta
	ID      int64                       `read:"id" id:"2,required"`
	Network *types.IPNet                `read:"network" create:"network" update:"network"`
	TsigID  types.NullablePositiveInt64 `read:"tsig_id"  create:"tsig_id" update:"tsig_id"`
}

func (c *CcSecTransferAcl) SetPathParams(args ...interface{}) error {
	return apis.SetPathParams(args, &c.CommonConfigID, &c.ID)
}

func (c *CcSecTransferAcl) GetID() int64    { return c.ID }
func (c *CcSecTransferAcl) SetID(id int64)  { c.ID = id }
func (c *CcSecTransferAcl) GetName() string { return "cc_sec_transfer_acls" }
func (c *CcSecTransferAcl) GetPathMethod(action api.Action) (string, string) {
	return GetPathMethodForChildSpec(action, c)
}

// for IDE
var _ ListSpec = &CcSecTransferAclList{}

// +k8s:deepcopy-gen:interfaces=github.com/mimuret/golang-iij-dpf/pkg/api.Object
type CcSecTransferAclList struct {
	AttributeMeta
	Items []CcSecTransferAcl `read:"items"`
}

func (c *CcSecTransferAclList) SetPathParams(args ...interface{}) error {
	return apis.SetPathParams(args, &c.CommonConfigID)
}

func (c *CcSecTransferAclList) GetName() string         { return "cc_sec_transfer_acls" }
func (c *CcSecTransferAclList) GetItems() interface{}   { return &c.Items }
func (c *CcSecTransferAclList) Len() int                { return len(c.Items) }
func (c *CcSecTransferAclList) Index(i int) interface{} { return c.Items[i] }

func (c *CcSecTransferAclList) GetPathMethod(action api.Action) (string, string) {
	return GetPathMethodForListSpec(action, c)
}

func (c *CcSecTransferAclList) Init() {
	for i := range c.Items {
		c.Items[i].AttributeMeta = c.AttributeMeta
	}
}

func init() {
	register(&CcSecTransferAcl{}, &CcSecTransferAclList{})
}