-
Notifications
You must be signed in to change notification settings - Fork 0
/
zz_generated_project_catalog.go
141 lines (123 loc) · 6.18 KB
/
zz_generated_project_catalog.go
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package client
import (
"github.com/rancher/norman/types"
)
const (
ProjectCatalogType = "projectCatalog"
ProjectCatalogFieldAnnotations = "annotations"
ProjectCatalogFieldBranch = "branch"
ProjectCatalogFieldCommit = "commit"
ProjectCatalogFieldConditions = "conditions"
ProjectCatalogFieldCreated = "created"
ProjectCatalogFieldCreatorID = "creatorId"
ProjectCatalogFieldDescription = "description"
ProjectCatalogFieldKind = "kind"
ProjectCatalogFieldLabels = "labels"
ProjectCatalogFieldLastRefreshTimestamp = "lastRefreshTimestamp"
ProjectCatalogFieldName = "name"
ProjectCatalogFieldNamespaceId = "namespaceId"
ProjectCatalogFieldOwnerReferences = "ownerReferences"
ProjectCatalogFieldPassword = "password"
ProjectCatalogFieldProjectID = "projectId"
ProjectCatalogFieldRemoved = "removed"
ProjectCatalogFieldState = "state"
ProjectCatalogFieldTransitioning = "transitioning"
ProjectCatalogFieldTransitioningMessage = "transitioningMessage"
ProjectCatalogFieldURL = "url"
ProjectCatalogFieldUUID = "uuid"
ProjectCatalogFieldUsername = "username"
)
type ProjectCatalog struct {
types.Resource
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
Branch string `json:"branch,omitempty" yaml:"branch,omitempty"`
Commit string `json:"commit,omitempty" yaml:"commit,omitempty"`
Conditions []CatalogCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"`
Created string `json:"created,omitempty" yaml:"created,omitempty"`
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty" yaml:"lastRefreshTimestamp,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
Password string `json:"password,omitempty" yaml:"password,omitempty"`
ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"`
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
State string `json:"state,omitempty" yaml:"state,omitempty"`
Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"`
TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
Username string `json:"username,omitempty" yaml:"username,omitempty"`
}
type ProjectCatalogCollection struct {
types.Collection
Data []ProjectCatalog `json:"data,omitempty"`
client *ProjectCatalogClient
}
type ProjectCatalogClient struct {
apiClient *Client
}
type ProjectCatalogOperations interface {
List(opts *types.ListOpts) (*ProjectCatalogCollection, error)
Create(opts *ProjectCatalog) (*ProjectCatalog, error)
Update(existing *ProjectCatalog, updates interface{}) (*ProjectCatalog, error)
Replace(existing *ProjectCatalog) (*ProjectCatalog, error)
ByID(id string) (*ProjectCatalog, error)
Delete(container *ProjectCatalog) error
ActionRefresh(resource *ProjectCatalog) error
CollectionActionRefresh(resource *ProjectCatalogCollection) error
}
func newProjectCatalogClient(apiClient *Client) *ProjectCatalogClient {
return &ProjectCatalogClient{
apiClient: apiClient,
}
}
func (c *ProjectCatalogClient) Create(container *ProjectCatalog) (*ProjectCatalog, error) {
resp := &ProjectCatalog{}
err := c.apiClient.Ops.DoCreate(ProjectCatalogType, container, resp)
return resp, err
}
func (c *ProjectCatalogClient) Update(existing *ProjectCatalog, updates interface{}) (*ProjectCatalog, error) {
resp := &ProjectCatalog{}
err := c.apiClient.Ops.DoUpdate(ProjectCatalogType, &existing.Resource, updates, resp)
return resp, err
}
func (c *ProjectCatalogClient) Replace(obj *ProjectCatalog) (*ProjectCatalog, error) {
resp := &ProjectCatalog{}
err := c.apiClient.Ops.DoReplace(ProjectCatalogType, &obj.Resource, obj, resp)
return resp, err
}
func (c *ProjectCatalogClient) List(opts *types.ListOpts) (*ProjectCatalogCollection, error) {
resp := &ProjectCatalogCollection{}
err := c.apiClient.Ops.DoList(ProjectCatalogType, opts, resp)
resp.client = c
return resp, err
}
func (cc *ProjectCatalogCollection) Next() (*ProjectCatalogCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &ProjectCatalogCollection{}
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *ProjectCatalogClient) ByID(id string) (*ProjectCatalog, error) {
resp := &ProjectCatalog{}
err := c.apiClient.Ops.DoByID(ProjectCatalogType, id, resp)
return resp, err
}
func (c *ProjectCatalogClient) Delete(container *ProjectCatalog) error {
return c.apiClient.Ops.DoResourceDelete(ProjectCatalogType, &container.Resource)
}
func (c *ProjectCatalogClient) ActionRefresh(resource *ProjectCatalog) error {
err := c.apiClient.Ops.DoAction(ProjectCatalogType, "refresh", &resource.Resource, nil, nil)
return err
}
func (c *ProjectCatalogClient) CollectionActionRefresh(resource *ProjectCatalogCollection) error {
err := c.apiClient.Ops.DoCollectionAction(ProjectCatalogType, "refresh", &resource.Collection, nil, nil)
return err
}