mirror of
https://github.com/rancher/types.git
synced 2025-09-15 22:39:05 +00:00
generated code
This commit is contained in:
committed by
Darren Shepherd
parent
fe7176121f
commit
c4a95c3c8b
@@ -78,3 +78,7 @@ type LocalCredential struct {
|
||||
type GithubCredential struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
type ChangePasswordInput struct {
|
||||
NewPassword string `json:"newPassword"`
|
||||
}
|
||||
|
@@ -154,6 +154,7 @@ func authnTypes(schemas *types.Schemas) *types.Schemas {
|
||||
MustImport(&Version, v3.LoginInput{}).
|
||||
MustImport(&Version, v3.LocalCredential{}).
|
||||
MustImport(&Version, v3.GithubCredential{}).
|
||||
MustImport(&Version, v3.ChangePasswordInput{}).
|
||||
MustImportAndCustomize(&Version, v3.Token{}, func(schema *types.Schema) {
|
||||
schema.CollectionActions = map[string]types.Action{
|
||||
"login": {
|
||||
|
@@ -55,6 +55,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*CatalogStatus).DeepCopyInto(out.(*CatalogStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&CatalogStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ChangePasswordInput).DeepCopyInto(out.(*ChangePasswordInput))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ChangePasswordInput{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Cluster).DeepCopyInto(out.(*Cluster))
|
||||
return nil
|
||||
@@ -594,6 +598,22 @@ func (in *CatalogStatus) DeepCopy() *CatalogStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ChangePasswordInput) DeepCopyInto(out *ChangePasswordInput) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangePasswordInput.
|
||||
func (in *ChangePasswordInput) DeepCopy() *ChangePasswordInput {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ChangePasswordInput)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Cluster) DeepCopyInto(out *Cluster) {
|
||||
*out = *in
|
||||
|
@@ -30,11 +30,11 @@ type Interface interface {
|
||||
CatalogsGetter
|
||||
TemplatesGetter
|
||||
TemplateVersionsGetter
|
||||
TokensGetter
|
||||
UsersGetter
|
||||
GroupsGetter
|
||||
GroupMembersGetter
|
||||
PrincipalsGetter
|
||||
TokensGetter
|
||||
UsersGetter
|
||||
DynamicSchemasGetter
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@ type Client struct {
|
||||
catalogControllers map[string]CatalogController
|
||||
templateControllers map[string]TemplateController
|
||||
templateVersionControllers map[string]TemplateVersionController
|
||||
tokenControllers map[string]TokenController
|
||||
userControllers map[string]UserController
|
||||
groupControllers map[string]GroupController
|
||||
groupMemberControllers map[string]GroupMemberController
|
||||
principalControllers map[string]PrincipalController
|
||||
tokenControllers map[string]TokenController
|
||||
userControllers map[string]UserController
|
||||
dynamicSchemaControllers map[string]DynamicSchemaController
|
||||
}
|
||||
|
||||
@@ -97,11 +97,11 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
catalogControllers: map[string]CatalogController{},
|
||||
templateControllers: map[string]TemplateController{},
|
||||
templateVersionControllers: map[string]TemplateVersionController{},
|
||||
tokenControllers: map[string]TokenController{},
|
||||
userControllers: map[string]UserController{},
|
||||
groupControllers: map[string]GroupController{},
|
||||
groupMemberControllers: map[string]GroupMemberController{},
|
||||
principalControllers: map[string]PrincipalController{},
|
||||
tokenControllers: map[string]TokenController{},
|
||||
userControllers: map[string]UserController{},
|
||||
dynamicSchemaControllers: map[string]DynamicSchemaController{},
|
||||
}, nil
|
||||
}
|
||||
@@ -326,32 +326,6 @@ func (c *Client) TemplateVersions(namespace string) TemplateVersionInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type TokensGetter interface {
|
||||
Tokens(namespace string) TokenInterface
|
||||
}
|
||||
|
||||
func (c *Client) Tokens(namespace string) TokenInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &TokenResource, TokenGroupVersionKind, tokenFactory{})
|
||||
return &tokenClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type UsersGetter interface {
|
||||
Users(namespace string) UserInterface
|
||||
}
|
||||
|
||||
func (c *Client) Users(namespace string) UserInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &UserResource, UserGroupVersionKind, userFactory{})
|
||||
return &userClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type GroupsGetter interface {
|
||||
Groups(namespace string) GroupInterface
|
||||
}
|
||||
@@ -391,6 +365,32 @@ func (c *Client) Principals(namespace string) PrincipalInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type TokensGetter interface {
|
||||
Tokens(namespace string) TokenInterface
|
||||
}
|
||||
|
||||
func (c *Client) Tokens(namespace string) TokenInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &TokenResource, TokenGroupVersionKind, tokenFactory{})
|
||||
return &tokenClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type UsersGetter interface {
|
||||
Users(namespace string) UserInterface
|
||||
}
|
||||
|
||||
func (c *Client) Users(namespace string) UserInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &UserResource, UserGroupVersionKind, userFactory{})
|
||||
return &userClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type DynamicSchemasGetter interface {
|
||||
DynamicSchemas(namespace string) DynamicSchemaInterface
|
||||
}
|
||||
|
@@ -65,16 +65,16 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&TemplateList{},
|
||||
&TemplateVersion{},
|
||||
&TemplateVersionList{},
|
||||
&Token{},
|
||||
&TokenList{},
|
||||
&User{},
|
||||
&UserList{},
|
||||
&Group{},
|
||||
&GroupList{},
|
||||
&GroupMember{},
|
||||
&GroupMemberList{},
|
||||
&Principal{},
|
||||
&PrincipalList{},
|
||||
&Token{},
|
||||
&TokenList{},
|
||||
&User{},
|
||||
&UserList{},
|
||||
&DynamicSchema{},
|
||||
&DynamicSchemaList{},
|
||||
)
|
||||
|
10
client/management/v3/zz_generated_change_password_input.go
Normal file
10
client/management/v3/zz_generated_change_password_input.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ChangePasswordInputType = "changePasswordInput"
|
||||
ChangePasswordInputFieldNewPassword = "newPassword"
|
||||
)
|
||||
|
||||
type ChangePasswordInput struct {
|
||||
NewPassword string `json:"newPassword,omitempty"`
|
||||
}
|
@@ -24,11 +24,11 @@ type Client struct {
|
||||
Catalog CatalogOperations
|
||||
Template TemplateOperations
|
||||
TemplateVersion TemplateVersionOperations
|
||||
Token TokenOperations
|
||||
User UserOperations
|
||||
Group GroupOperations
|
||||
GroupMember GroupMemberOperations
|
||||
Principal PrincipalOperations
|
||||
Token TokenOperations
|
||||
User UserOperations
|
||||
DynamicSchema DynamicSchemaOperations
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
client.Catalog = newCatalogClient(client)
|
||||
client.Template = newTemplateClient(client)
|
||||
client.TemplateVersion = newTemplateVersionClient(client)
|
||||
client.Token = newTokenClient(client)
|
||||
client.User = newUserClient(client)
|
||||
client.Group = newGroupClient(client)
|
||||
client.GroupMember = newGroupMemberClient(client)
|
||||
client.Principal = newPrincipalClient(client)
|
||||
client.Token = newTokenClient(client)
|
||||
client.User = newUserClient(client)
|
||||
client.DynamicSchema = newDynamicSchemaClient(client)
|
||||
|
||||
return client, nil
|
||||
|
@@ -55,6 +55,8 @@ type UserOperations interface {
|
||||
Update(existing *User, updates interface{}) (*User, error)
|
||||
ByID(id string) (*User, error)
|
||||
Delete(container *User) error
|
||||
|
||||
ActionChangepassword(*User, *ChangePasswordInput) (*User, error)
|
||||
}
|
||||
|
||||
func newUserClient(apiClient *Client) *UserClient {
|
||||
@@ -101,3 +103,12 @@ func (c *UserClient) ByID(id string) (*User, error) {
|
||||
func (c *UserClient) Delete(container *User) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(UserType, &container.Resource)
|
||||
}
|
||||
|
||||
func (c *UserClient) ActionChangepassword(resource *User, input *ChangePasswordInput) (*User, error) {
|
||||
|
||||
resp := &User{}
|
||||
|
||||
err := c.apiClient.Ops.DoAction(UserType, "changepassword", &resource.Resource, input, resp)
|
||||
|
||||
return resp, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user