From 19db76431672e02beecbe4d1c0b143bc816d9692 Mon Sep 17 00:00:00 2001 From: Daishan Peng Date: Fri, 8 Dec 2017 11:10:09 -0700 Subject: [PATCH] generate changes --- .../v3/zz_generated_deepcopy.go | 248 ++++++++++++++++++ .../zz_generated_dynamic_schema_controller.go | 187 +++++++++++++ ...erated_dynamic_schema_lifecycle_adapter.go | 39 +++ .../v3/zz_generated_k8s_client.go | 16 ++ client/management/v3/zz_generated_action.go | 12 + client/management/v3/zz_generated_client.go | 2 + .../v3/zz_generated_dynamic_schema.go | 119 +++++++++ .../v3/zz_generated_dynamic_schema_spec.go | 26 ++ .../v3/zz_generated_dynamic_schema_status.go | 10 + client/management/v3/zz_generated_field.go | 38 +++ client/management/v3/zz_generated_filter.go | 10 + client/management/v3/zz_generated_values.go | 16 ++ 12 files changed, 723 insertions(+) create mode 100644 apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go create mode 100644 apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go create mode 100644 client/management/v3/zz_generated_action.go create mode 100644 client/management/v3/zz_generated_dynamic_schema.go create mode 100644 client/management/v3/zz_generated_dynamic_schema_spec.go create mode 100644 client/management/v3/zz_generated_dynamic_schema_status.go create mode 100644 client/management/v3/zz_generated_field.go create mode 100644 client/management/v3/zz_generated_filter.go create mode 100644 client/management/v3/zz_generated_values.go diff --git a/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/apis/management.cattle.io/v3/zz_generated_deepcopy.go index ecd01999..49bad465 100644 --- a/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ b/apis/management.cattle.io/v3/zz_generated_deepcopy.go @@ -6,6 +6,22 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Action) DeepCopyInto(out *Action) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. +func (in *Action) DeepCopy() *Action { + if in == nil { + return nil + } + out := new(Action) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AmazonEC2Config) DeepCopyInto(out *AmazonEC2Config) { *out = *in @@ -514,6 +530,151 @@ func (in *DigitalOceanConfig) DeepCopy() *DigitalOceanConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicSchema) DeepCopyInto(out *DynamicSchema) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchema. +func (in *DynamicSchema) DeepCopy() *DynamicSchema { + if in == nil { + return nil + } + out := new(DynamicSchema) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DynamicSchema) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicSchemaList) DeepCopyInto(out *DynamicSchemaList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DynamicSchema, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchemaList. +func (in *DynamicSchemaList) DeepCopy() *DynamicSchemaList { + if in == nil { + return nil + } + out := new(DynamicSchemaList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DynamicSchemaList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicSchemaSpec) DeepCopyInto(out *DynamicSchemaSpec) { + *out = *in + if in.ResourceMethods != nil { + in, out := &in.ResourceMethods, &out.ResourceMethods + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ResourceFields != nil { + in, out := &in.ResourceFields, &out.ResourceFields + *out = make(map[string]Field, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.ResourceActions != nil { + in, out := &in.ResourceActions, &out.ResourceActions + *out = make(map[string]Action, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CollectionMethods != nil { + in, out := &in.CollectionMethods, &out.CollectionMethods + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.CollectionFields != nil { + in, out := &in.CollectionFields, &out.CollectionFields + *out = make(map[string]Field, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.CollectionActions != nil { + in, out := &in.CollectionActions, &out.CollectionActions + *out = make(map[string]Action, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CollectionFilters != nil { + in, out := &in.CollectionFilters, &out.CollectionFilters + *out = make(map[string]Filter, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.IncludeableLinks != nil { + in, out := &in.IncludeableLinks, &out.IncludeableLinks + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchemaSpec. +func (in *DynamicSchemaSpec) DeepCopy() *DynamicSchemaSpec { + if in == nil { + return nil + } + out := new(DynamicSchemaSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DynamicSchemaStatus) DeepCopyInto(out *DynamicSchemaStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DynamicSchemaStatus. +func (in *DynamicSchemaStatus) DeepCopy() *DynamicSchemaStatus { + if in == nil { + return nil + } + out := new(DynamicSchemaStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ETCDService) DeepCopyInto(out *ETCDService) { *out = *in @@ -531,6 +692,28 @@ func (in *ETCDService) DeepCopy() *ETCDService { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Field) DeepCopyInto(out *Field) { + *out = *in + in.Default.DeepCopyInto(&out.Default) + if in.Options != nil { + in, out := &in.Options, &out.Options + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Field. +func (in *Field) DeepCopy() *Field { + if in == nil { + return nil + } + out := new(Field) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *File) DeepCopyInto(out *File) { *out = *in @@ -547,6 +730,27 @@ func (in *File) DeepCopy() *File { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Filter) DeepCopyInto(out *Filter) { + *out = *in + if in.Modifiers != nil { + in, out := &in.Modifiers, &out.Modifiers + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. +func (in *Filter) DeepCopy() *Filter { + if in == nil { + return nil + } + out := new(Filter) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GoogleKubernetesEngineConfig) DeepCopyInto(out *GoogleKubernetesEngineConfig) { *out = *in @@ -833,6 +1037,29 @@ func (in *KubeproxyService) DeepCopy() *KubeproxyService { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ListOpts) DeepCopyInto(out *ListOpts) { + *out = *in + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListOpts. +func (in *ListOpts) DeepCopy() *ListOpts { + if in == nil { + return nil + } + out := new(ListOpts) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Machine) DeepCopyInto(out *Machine) { *out = *in @@ -2023,3 +2250,24 @@ func (in *UserList) DeepCopyObject() runtime.Object { return nil } } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Values) DeepCopyInto(out *Values) { + *out = *in + if in.StringSliceValue != nil { + in, out := &in.StringSliceValue, &out.StringSliceValue + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Values. +func (in *Values) DeepCopy() *Values { + if in == nil { + return nil + } + out := new(Values) + in.DeepCopyInto(out) + return out +} diff --git a/apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go b/apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go new file mode 100644 index 00000000..4a3e0771 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_dynamic_schema_controller.go @@ -0,0 +1,187 @@ +package v3 + +import ( + "context" + + "github.com/rancher/norman/clientbase" + "github.com/rancher/norman/controller" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + DynamicSchemaGroupVersionKind = schema.GroupVersionKind{ + Version: "v3", + Group: "management.cattle.io", + Kind: "DynamicSchema", + } + DynamicSchemaResource = metav1.APIResource{ + Name: "dynamicschemas", + SingularName: "dynamicschema", + Namespaced: false, + Kind: DynamicSchemaGroupVersionKind.Kind, + } +) + +type DynamicSchemaList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DynamicSchema +} + +type DynamicSchemaHandlerFunc func(key string, obj *DynamicSchema) error + +type DynamicSchemaLister interface { + List(namespace string, selector labels.Selector) (ret []*DynamicSchema, err error) + Get(namespace, name string) (*DynamicSchema, error) +} + +type DynamicSchemaController interface { + Informer() cache.SharedIndexInformer + Lister() DynamicSchemaLister + AddHandler(handler DynamicSchemaHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type DynamicSchemaInterface interface { + ObjectClient() *clientbase.ObjectClient + Create(*DynamicSchema) (*DynamicSchema, error) + Get(name string, opts metav1.GetOptions) (*DynamicSchema, error) + Update(*DynamicSchema) (*DynamicSchema, error) + Delete(name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*DynamicSchemaList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() DynamicSchemaController +} + +type dynamicSchemaLister struct { + controller *dynamicSchemaController +} + +func (l *dynamicSchemaLister) List(namespace string, selector labels.Selector) (ret []*DynamicSchema, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*DynamicSchema)) + }) + return +} + +func (l *dynamicSchemaLister) Get(namespace, name string) (*DynamicSchema, error) { + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: DynamicSchemaGroupVersionKind.Group, + Resource: "dynamicSchema", + }, name) + } + return obj.(*DynamicSchema), nil +} + +type dynamicSchemaController struct { + controller.GenericController +} + +func (c *dynamicSchemaController) Lister() DynamicSchemaLister { + return &dynamicSchemaLister{ + controller: c, + } +} + +func (c *dynamicSchemaController) AddHandler(handler DynamicSchemaHandlerFunc) { + c.GenericController.AddHandler(func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + return handler(key, obj.(*DynamicSchema)) + }) +} + +type dynamicSchemaFactory struct { +} + +func (c dynamicSchemaFactory) Object() runtime.Object { + return &DynamicSchema{} +} + +func (c dynamicSchemaFactory) List() runtime.Object { + return &DynamicSchemaList{} +} + +func (s *dynamicSchemaClient) Controller() DynamicSchemaController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.dynamicSchemaControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(DynamicSchemaGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &dynamicSchemaController{ + GenericController: genericController, + } + + s.client.dynamicSchemaControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type dynamicSchemaClient struct { + client *Client + ns string + objectClient *clientbase.ObjectClient + controller DynamicSchemaController +} + +func (s *dynamicSchemaClient) ObjectClient() *clientbase.ObjectClient { + return s.objectClient +} + +func (s *dynamicSchemaClient) Create(o *DynamicSchema) (*DynamicSchema, error) { + obj, err := s.objectClient.Create(o) + return obj.(*DynamicSchema), err +} + +func (s *dynamicSchemaClient) Get(name string, opts metav1.GetOptions) (*DynamicSchema, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*DynamicSchema), err +} + +func (s *dynamicSchemaClient) Update(o *DynamicSchema) (*DynamicSchema, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*DynamicSchema), err +} + +func (s *dynamicSchemaClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *dynamicSchemaClient) List(opts metav1.ListOptions) (*DynamicSchemaList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*DynamicSchemaList), err +} + +func (s *dynamicSchemaClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +func (s *dynamicSchemaClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} diff --git a/apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go new file mode 100644 index 00000000..1978a4b5 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_dynamic_schema_lifecycle_adapter.go @@ -0,0 +1,39 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type DynamicSchemaLifecycle interface { + Create(obj *DynamicSchema) error + Remove(obj *DynamicSchema) error + Updated(obj *DynamicSchema) error +} + +type dynamicSchemaLifecycleAdapter struct { + lifecycle DynamicSchemaLifecycle +} + +func (w *dynamicSchemaLifecycleAdapter) Create(obj runtime.Object) error { + return w.lifecycle.Create(obj.(*DynamicSchema)) +} + +func (w *dynamicSchemaLifecycleAdapter) Finalize(obj runtime.Object) error { + return w.lifecycle.Remove(obj.(*DynamicSchema)) +} + +func (w *dynamicSchemaLifecycleAdapter) Updated(obj runtime.Object) error { + return w.lifecycle.Updated(obj.(*DynamicSchema)) +} + +func NewDynamicSchemaLifecycleAdapter(name string, client DynamicSchemaInterface, l DynamicSchemaLifecycle) DynamicSchemaHandlerFunc { + adapter := &dynamicSchemaLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient()) + return func(key string, obj *DynamicSchema) error { + if obj == nil { + return syncFn(key, nil) + } + return syncFn(key, obj) + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_k8s_client.go b/apis/management.cattle.io/v3/zz_generated_k8s_client.go index a07a28f9..bd817f7f 100644 --- a/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ b/apis/management.cattle.io/v3/zz_generated_k8s_client.go @@ -31,6 +31,7 @@ type Interface interface { GroupsGetter GroupMembersGetter IdentitiesGetter + DynamicSchemasGetter } type Client struct { @@ -55,6 +56,7 @@ type Client struct { groupControllers map[string]GroupController groupMemberControllers map[string]GroupMemberController identityControllers map[string]IdentityController + dynamicSchemaControllers map[string]DynamicSchemaController } func NewForConfig(config rest.Config) (Interface, error) { @@ -88,6 +90,7 @@ func NewForConfig(config rest.Config) (Interface, error) { groupControllers: map[string]GroupController{}, groupMemberControllers: map[string]GroupMemberController{}, identityControllers: map[string]IdentityController{}, + dynamicSchemaControllers: map[string]DynamicSchemaController{}, }, nil } @@ -323,3 +326,16 @@ func (c *Client) Identities(namespace string) IdentityInterface { objectClient: objectClient, } } + +type DynamicSchemasGetter interface { + DynamicSchemas(namespace string) DynamicSchemaInterface +} + +func (c *Client) DynamicSchemas(namespace string) DynamicSchemaInterface { + objectClient := clientbase.NewObjectClient(namespace, c.restClient, &DynamicSchemaResource, DynamicSchemaGroupVersionKind, dynamicSchemaFactory{}) + return &dynamicSchemaClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/client/management/v3/zz_generated_action.go b/client/management/v3/zz_generated_action.go new file mode 100644 index 00000000..d981483c --- /dev/null +++ b/client/management/v3/zz_generated_action.go @@ -0,0 +1,12 @@ +package client + +const ( + ActionType = "action" + ActionFieldInput = "input" + ActionFieldOutput = "output" +) + +type Action struct { + Input string `json:"input,omitempty"` + Output string `json:"output,omitempty"` +} diff --git a/client/management/v3/zz_generated_client.go b/client/management/v3/zz_generated_client.go index 1d46d467..9b7d5da3 100644 --- a/client/management/v3/zz_generated_client.go +++ b/client/management/v3/zz_generated_client.go @@ -25,6 +25,7 @@ type Client struct { Group GroupOperations GroupMember GroupMemberOperations Identity IdentityOperations + DynamicSchema DynamicSchemaOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -55,6 +56,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.Group = newGroupClient(client) client.GroupMember = newGroupMemberClient(client) client.Identity = newIdentityClient(client) + client.DynamicSchema = newDynamicSchemaClient(client) return client, nil } diff --git a/client/management/v3/zz_generated_dynamic_schema.go b/client/management/v3/zz_generated_dynamic_schema.go new file mode 100644 index 00000000..84a504bc --- /dev/null +++ b/client/management/v3/zz_generated_dynamic_schema.go @@ -0,0 +1,119 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + DynamicSchemaType = "dynamicSchema" + DynamicSchemaFieldAnnotations = "annotations" + DynamicSchemaFieldCollectionActions = "collectionActions" + DynamicSchemaFieldCollectionFields = "collectionFields" + DynamicSchemaFieldCollectionFilters = "collectionFilters" + DynamicSchemaFieldCollectionMethods = "collectionMethods" + DynamicSchemaFieldCreated = "created" + DynamicSchemaFieldFinalizers = "finalizers" + DynamicSchemaFieldIncludeableLinks = "includeableLinks" + DynamicSchemaFieldLabels = "labels" + DynamicSchemaFieldName = "name" + DynamicSchemaFieldOwnerReferences = "ownerReferences" + DynamicSchemaFieldPluralName = "pluralName" + DynamicSchemaFieldRemoved = "removed" + DynamicSchemaFieldResourceActions = "resourceActions" + DynamicSchemaFieldResourceFields = "resourceFields" + DynamicSchemaFieldResourceMethods = "resourceMethods" + DynamicSchemaFieldResourcePath = "resourcePath" + DynamicSchemaFieldState = "state" + DynamicSchemaFieldStatus = "status" + DynamicSchemaFieldTransitioning = "transitioning" + DynamicSchemaFieldTransitioningMessage = "transitioningMessage" + DynamicSchemaFieldUuid = "uuid" +) + +type DynamicSchema struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty"` + CollectionActions map[string]Action `json:"collectionActions,omitempty"` + CollectionFields map[string]Field `json:"collectionFields,omitempty"` + CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"` + CollectionMethods []string `json:"collectionMethods,omitempty"` + Created string `json:"created,omitempty"` + Finalizers []string `json:"finalizers,omitempty"` + IncludeableLinks []string `json:"includeableLinks,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Name string `json:"name,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"` + PluralName string `json:"pluralName,omitempty"` + Removed string `json:"removed,omitempty"` + ResourceActions map[string]Action `json:"resourceActions,omitempty"` + ResourceFields map[string]Field `json:"resourceFields,omitempty"` + ResourceMethods []string `json:"resourceMethods,omitempty"` + ResourcePath string `json:"resourcePath,omitempty"` + State string `json:"state,omitempty"` + Status *DynamicSchemaStatus `json:"status,omitempty"` + Transitioning string `json:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty"` + Uuid string `json:"uuid,omitempty"` +} +type DynamicSchemaCollection struct { + types.Collection + Data []DynamicSchema `json:"data,omitempty"` + client *DynamicSchemaClient +} + +type DynamicSchemaClient struct { + apiClient *Client +} + +type DynamicSchemaOperations interface { + List(opts *types.ListOpts) (*DynamicSchemaCollection, error) + Create(opts *DynamicSchema) (*DynamicSchema, error) + Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) + ByID(id string) (*DynamicSchema, error) + Delete(container *DynamicSchema) error +} + +func newDynamicSchemaClient(apiClient *Client) *DynamicSchemaClient { + return &DynamicSchemaClient{ + apiClient: apiClient, + } +} + +func (c *DynamicSchemaClient) Create(container *DynamicSchema) (*DynamicSchema, error) { + resp := &DynamicSchema{} + err := c.apiClient.Ops.DoCreate(DynamicSchemaType, container, resp) + return resp, err +} + +func (c *DynamicSchemaClient) Update(existing *DynamicSchema, updates interface{}) (*DynamicSchema, error) { + resp := &DynamicSchema{} + err := c.apiClient.Ops.DoUpdate(DynamicSchemaType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DynamicSchemaClient) List(opts *types.ListOpts) (*DynamicSchemaCollection, error) { + resp := &DynamicSchemaCollection{} + err := c.apiClient.Ops.DoList(DynamicSchemaType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *DynamicSchemaCollection) Next() (*DynamicSchemaCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DynamicSchemaCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *DynamicSchemaClient) ByID(id string) (*DynamicSchema, error) { + resp := &DynamicSchema{} + err := c.apiClient.Ops.DoByID(DynamicSchemaType, id, resp) + return resp, err +} + +func (c *DynamicSchemaClient) Delete(container *DynamicSchema) error { + return c.apiClient.Ops.DoResourceDelete(DynamicSchemaType, &container.Resource) +} diff --git a/client/management/v3/zz_generated_dynamic_schema_spec.go b/client/management/v3/zz_generated_dynamic_schema_spec.go new file mode 100644 index 00000000..7233d8ca --- /dev/null +++ b/client/management/v3/zz_generated_dynamic_schema_spec.go @@ -0,0 +1,26 @@ +package client + +const ( + DynamicSchemaSpecType = "dynamicSchemaSpec" + DynamicSchemaSpecFieldCollectionActions = "collectionActions" + DynamicSchemaSpecFieldCollectionFields = "collectionFields" + DynamicSchemaSpecFieldCollectionFilters = "collectionFilters" + DynamicSchemaSpecFieldCollectionMethods = "collectionMethods" + DynamicSchemaSpecFieldIncludeableLinks = "includeableLinks" + DynamicSchemaSpecFieldPluralName = "pluralName" + DynamicSchemaSpecFieldResourceActions = "resourceActions" + DynamicSchemaSpecFieldResourceFields = "resourceFields" + DynamicSchemaSpecFieldResourceMethods = "resourceMethods" +) + +type DynamicSchemaSpec struct { + CollectionActions map[string]Action `json:"collectionActions,omitempty"` + CollectionFields map[string]Field `json:"collectionFields,omitempty"` + CollectionFilters map[string]Filter `json:"collectionFilters,omitempty"` + CollectionMethods []string `json:"collectionMethods,omitempty"` + IncludeableLinks []string `json:"includeableLinks,omitempty"` + PluralName string `json:"pluralName,omitempty"` + ResourceActions map[string]Action `json:"resourceActions,omitempty"` + ResourceFields map[string]Field `json:"resourceFields,omitempty"` + ResourceMethods []string `json:"resourceMethods,omitempty"` +} diff --git a/client/management/v3/zz_generated_dynamic_schema_status.go b/client/management/v3/zz_generated_dynamic_schema_status.go new file mode 100644 index 00000000..122679bf --- /dev/null +++ b/client/management/v3/zz_generated_dynamic_schema_status.go @@ -0,0 +1,10 @@ +package client + +const ( + DynamicSchemaStatusType = "dynamicSchemaStatus" + DynamicSchemaStatusFieldFake = "fake" +) + +type DynamicSchemaStatus struct { + Fake string `json:"fake,omitempty"` +} diff --git a/client/management/v3/zz_generated_field.go b/client/management/v3/zz_generated_field.go new file mode 100644 index 00000000..500c0558 --- /dev/null +++ b/client/management/v3/zz_generated_field.go @@ -0,0 +1,38 @@ +package client + +const ( + FieldType = "field" + FieldFieldCreate = "create" + FieldFieldDefault = "default" + FieldFieldDescription = "description" + FieldFieldInvalidChars = "invalidChars" + FieldFieldMax = "max" + FieldFieldMaxLength = "maxLength" + FieldFieldMin = "min" + FieldFieldMinLength = "minLength" + FieldFieldNullable = "nullable" + FieldFieldOptions = "options" + FieldFieldRequired = "required" + FieldFieldType = "type" + FieldFieldUnique = "unique" + FieldFieldUpdate = "update" + FieldFieldValidChars = "validChars" +) + +type Field struct { + Create *bool `json:"create,omitempty"` + Default *Values `json:"default,omitempty"` + Description string `json:"description,omitempty"` + InvalidChars string `json:"invalidChars,omitempty"` + Max *int64 `json:"max,omitempty"` + MaxLength *int64 `json:"maxLength,omitempty"` + Min *int64 `json:"min,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Nullable *bool `json:"nullable,omitempty"` + Options []string `json:"options,omitempty"` + Required *bool `json:"required,omitempty"` + Type string `json:"type,omitempty"` + Unique *bool `json:"unique,omitempty"` + Update *bool `json:"update,omitempty"` + ValidChars string `json:"validChars,omitempty"` +} diff --git a/client/management/v3/zz_generated_filter.go b/client/management/v3/zz_generated_filter.go new file mode 100644 index 00000000..ff00bc60 --- /dev/null +++ b/client/management/v3/zz_generated_filter.go @@ -0,0 +1,10 @@ +package client + +const ( + FilterType = "filter" + FilterFieldModifiers = "modifiers" +) + +type Filter struct { + Modifiers []string `json:"modifiers,omitempty"` +} diff --git a/client/management/v3/zz_generated_values.go b/client/management/v3/zz_generated_values.go new file mode 100644 index 00000000..5de95780 --- /dev/null +++ b/client/management/v3/zz_generated_values.go @@ -0,0 +1,16 @@ +package client + +const ( + ValuesType = "values" + ValuesFieldBoolValue = "boolValue" + ValuesFieldIntValue = "intValue" + ValuesFieldStringSliceValue = "stringSliceValue" + ValuesFieldStringValue = "stringValue" +) + +type Values struct { + BoolValue *bool `json:"boolValue,omitempty"` + IntValue *int64 `json:"intValue,omitempty"` + StringSliceValue []string `json:"stringSliceValue,omitempty"` + StringValue string `json:"stringValue,omitempty"` +}