diff --git a/cmd/maestro/server/routes.go b/cmd/maestro/server/routes.go index 7b42c115..f263c4d2 100755 --- a/cmd/maestro/server/routes.go +++ b/cmd/maestro/server/routes.go @@ -79,9 +79,14 @@ func (s *apiServer) routes() *mux.Router { apiV1ResourceRouter.HandleFunc("/{id}", resourceHandler.Patch).Methods(http.MethodPatch) apiV1ResourceRouter.HandleFunc("/{id}", resourceHandler.Delete).Methods(http.MethodDelete) apiV1ResourceRouter.Use(authMiddleware.AuthenticateAccountJWT) - apiV1ResourceRouter.Use(authzMiddleware.AuthorizeApi) + apiV1ResourceBundleRouter := apiV1Router.PathPrefix("/resourcebundles").Subrouter() + apiV1ResourceBundleRouter.HandleFunc("", resourceHandler.ListBundle).Methods(http.MethodGet) + apiV1ResourceBundleRouter.HandleFunc("/{id}", resourceHandler.GetBundle).Methods(http.MethodGet) + apiV1ResourceBundleRouter.Use(authMiddleware.AuthenticateAccountJWT) + apiV1ResourceBundleRouter.Use(authzMiddleware.AuthorizeApi) + // /api/maestro/v1/consumers apiV1ConsumersRouter := apiV1Router.PathPrefix("/consumers").Subrouter() apiV1ConsumersRouter.HandleFunc("", consumerHandler.List).Methods(http.MethodGet) diff --git a/data/generated/openapi/openapi.go b/data/generated/openapi/openapi.go index 97c79a55..8cd61918 100755 --- a/data/generated/openapi/openapi.go +++ b/data/generated/openapi/openapi.go @@ -77,7 +77,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _openapiYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\x5f\x8f\xdb\xb8\x11\x7f\xf7\xa7\x18\xa0\x2d\x7c\x39\x78\x6d\xa7\x77\x05\x5a\x23\x39\x20\xb9\x5e\x8a\x3b\xe4\x92\x34\x9b\xb4\x0f\x45\xe1\xa5\xc9\x91\xc5\x8b\x44\x2a\x24\xb5\x59\xa7\xed\x77\x2f\x48\xea\xbf\x25\xad\x6c\xec\xc6\xca\xc2\x79\x89\x45\xcd\x0c\x67\xc8\x99\x1f\x87\x1c\x6a\x65\x82\x82\x24\x7c\x05\xdf\xcd\x97\xf3\xe5\x84\x8b\x40\xae\x26\x00\x86\x9b\x08\x57\x10\x13\xd4\x46\x49\xb8\x44\x75\xcd\x29\xc2\xb3\x37\x3f\x4f\x00\x18\x6a\xaa\x78\x62\xb8\x14\x5d\x24\xd7\xa8\xb4\x7b\xbd\x9c\x2f\xe7\x8f\x27\x1a\x95\x6d\xb1\x92\x2f\x20\x55\xd1\x0a\x42\x63\x92\xd5\x62\x11\x49\x4a\xa2\x50\x6a\xb3\xfa\xf3\x72\xb9\x9c\x00\x34\xa4\xd3\x54\x29\x14\x06\x98\x8c\x09\x17\x75\x76\xbd\x5a\x2c\x48\xc2\xe7\xd6\x04\x1d\xf2\xc0\xcc\xa9\x8c\xf7\x45\xfc\x4a\xb8\x80\x6f\x12\x25\x59\x4a\x6d\xcb\x23\xf0\xda\xb4\x0b\xd3\x86\x6c\xf1\x36\x91\x97\x86\x6c\xb9\xd8\xe6\x82\x12\x62\x42\x67\x9b\x95\xb0\xc8\x06\x64\x71\xfd\x78\xa1\x50\xcb\x54\x51\x74\x2f\x01\xb6\x68\xfc\x0f\x00\x9d\xc6\x31\x51\xbb\x15\xbc\x45\x93\x2a\xa1\x81\x40\xc4\xb5\x01\x19\x40\xc1\x94\x93\x22\x4d\x15\x37\xbb\x9c\xd5\xaa\xfd\x1c\x89\x42\xb5\x82\x7f\xfd\x3b\x6b\x54\xa8\x13\x29\x74\xde\x93\xfd\x37\xfd\xe3\x72\x39\x2d\x1f\x1b\x26\x3c\x83\x5f\x2e\x5f\xbf\x02\xa2\x14\xd9\x55\x7b\x05\xb9\xf9\x0d\xa9\xd1\x15\x3e\x2a\x85\x41\x61\xaa\xa2\x00\x48\x92\x44\x9c\x12\x2b\x6c\xf1\x9b\x96\xa2\xfe\x16\x40\xd3\x10\x63\xd2\x6c\x05\xf8\xbd\xc2\x60\x05\xd3\xdf\x2d\xa8\x8c\x13\x29\x50\x18\xbd\xf0\xb4\x7a\xf1\x36\xd3\xe1\x25\xd7\x66\x5a\xda\xf1\xfd\xf2\x71\x8f\x1d\xa9\x09\xc1\xc8\x0f\x28\x80\x6b\xe0\xe2\x9a\x44\x9c\x9d\x42\xf9\x9f\x94\x92\xaa\xa6\xf5\x77\xdd\x5a\xbf\x17\x24\x35\xa1\x54\xfc\x33\x32\x30\x12\x12\x54\x81\x54\x31\xc8\x04\x95\x53\x6b\x0c\x16\xfc\xa9\xcf\x7f\xde\x0b\xbc\x49\x90\x1a\x64\x80\x96\x0f\x24\x75\xb1\x7a\xfa\xb1\x4f\x88\x22\x31\x9a\x0c\x6e\xc0\xc5\x4b\x1b\x73\x49\xb7\x48\xc8\x16\xa7\x43\x89\x35\xff\x7c\x00\x31\x12\x45\xc3\xc1\xe4\x52\x31\x54\xcf\x77\x83\xe9\x03\x8e\x11\xd3\x9e\x3c\xb1\x28\xda\x84\x97\x1f\x15\x12\x83\x40\x40\xe0\xa7\x22\xc6\x0f\x03\x96\x8f\x29\x6a\xf3\x5c\xb2\x0a\x5d\xcd\x13\xf2\xa8\x05\x46\x0c\x29\x48\x2c\x1f\x57\xc8\x56\x60\x54\x8a\x93\x1e\x97\xe8\x77\x88\x76\x77\x18\x82\x22\xd3\x5e\x68\xec\x81\x14\x3f\x66\x27\x71\xe4\xa6\xee\x0e\x47\x7a\xa2\xf0\x1f\x16\xed\x9c\x0a\x3e\x0a\xf5\x78\xc2\xf0\x0c\xdc\x27\xb4\xe0\x2f\xdd\x16\x14\xe1\x4a\x22\x85\x84\xed\x00\x6f\xb8\x3e\xcd\x7a\x7f\xd0\x82\xf3\x4c\x40\xda\xb5\xe6\x00\xb5\x21\x6b\x33\x32\x13\x62\x13\xe6\x4e\x63\x52\x67\x2a\xb8\xf8\x0f\x67\xff\xeb\xce\x07\xff\x86\x06\x88\x28\xd3\xb1\xcd\x0e\x8a\xb0\xb8\x9f\x4c\xb0\x70\x88\x40\xa6\x82\xd5\x3a\xfc\xa2\x43\xd7\x8a\x7d\x67\x00\x39\x8d\x05\xdf\x77\x5b\xf0\x4a\x96\xde\xf9\x89\x9b\x10\x74\x82\x94\x07\x1c\x19\x70\xf6\xb5\xa0\xc9\x58\xd3\xd7\x84\x18\x1a\xee\x81\xc2\xfb\x84\xb9\x2c\x4e\xdc\x53\x0a\xe7\xe5\xb3\x72\x5e\x47\x96\xca\xbd\xb1\xa3\xf2\xd6\x9b\xd1\x9f\xd6\x0d\xc1\xb9\x34\xb3\x56\xa7\x94\xa2\xd6\x41\x1a\x45\xbb\xd1\x00\xde\x39\xd9\xfb\xc2\x5a\x9f\xb1\x7a\x14\x46\x3c\xc0\x8c\x75\x6f\x8d\x71\xc0\x63\xb3\xd4\x51\x64\xa8\x56\xdb\x08\x0d\xee\xad\x36\x7f\x75\xcd\x40\x8e\x5c\x6c\xda\x60\xb9\xc7\x45\xcb\xe3\x03\xd7\x6d\x07\x2c\x9f\x91\xf1\xcb\x6b\x7d\x46\xc6\x11\x18\x71\x18\xc2\xb8\x18\x1a\x11\xc2\x34\xcf\x62\x6f\x3d\xd0\xe4\xac\x6d\xf3\x4c\xa5\xd0\x69\x5c\x48\x19\x56\x47\x29\x98\xee\x75\xf7\xdc\xac\xa3\xe4\xbd\x9e\xb2\x8e\xf2\x63\xa6\xc3\xb9\x8e\x32\x0a\x1c\xfa\x2a\x37\xa2\x6d\x75\x94\x03\x2b\x29\x07\xd6\x52\x0e\xae\xa6\x1c\x5e\x4f\xb9\xf3\x8a\x4a\x1e\xed\x77\xbb\x1d\xcf\xe3\x77\x2c\xdb\xf0\x5c\x9f\xaf\xb1\xa2\xd2\xd4\xfd\x9c\x4a\x9e\x21\xfc\x18\x0b\x7a\xf6\xa7\x45\xb8\x7e\x65\xfb\xd3\xe1\x15\x95\x06\xcc\x9d\xc6\xa4\xce\xa4\x70\x58\x45\xa5\x48\xcc\xee\xbf\xa2\x52\x38\xc4\x89\x2b\x2a\xad\xd8\x77\x06\x90\x31\xee\x45\x0b\xef\x7c\x38\x7b\xd1\x91\xac\x9b\xb7\x55\x54\xee\x27\x85\xcb\x2b\x2a\x74\xa4\xa9\xdc\x9d\x54\x54\x0a\x9c\x1b\x4b\x45\xe5\x9c\xec\x8d\x41\xeb\x33\x56\x8f\xc2\x88\x07\x98\xb1\x76\x57\x54\x46\x91\xa1\xde\x5e\x51\x39\x6e\xb1\x39\xb0\xa2\x52\x1e\x1f\x9c\x2b\x2a\x67\x64\xbc\x5b\x0b\x1e\x00\x32\x1e\x59\x51\x19\x09\xc2\x1c\x71\xbb\x9d\xb3\xe9\xa4\x7c\x63\xd9\x72\xdc\xb9\xb4\xf2\x73\x60\xc9\x80\x27\x93\x6a\x76\x09\xfa\x2f\x63\x26\x15\xbd\x71\x05\x1b\x47\x96\x35\xfa\x87\x17\x52\xc5\xc4\xac\xe0\x97\x7f\xbe\x9b\xe4\x06\x66\x42\x5f\xbb\x2a\xc8\x5b\x0c\x50\xa1\xa0\x58\x97\xee\x4b\x24\x59\x53\xa2\xac\xab\x1b\x5e\xc5\x39\xce\xaa\xe3\xe4\x99\xb4\x51\x5c\x6c\x8b\xe6\x0f\x5c\xdc\x4e\x14\xda\x01\xea\x23\x7a\xc9\xcb\x93\xde\x81\xba\x0d\xea\x38\x21\x5b\xdc\x27\xe2\xc2\xe0\xb6\xe2\x49\x9a\x7f\x1e\x40\x65\xa4\x21\xd1\x6d\x64\xc5\xce\xa2\xb2\xa2\x58\x4d\x2b\x8f\x56\xa7\xca\xa3\xed\xbc\xf2\xe8\x7a\xa9\x3c\x73\x83\xb1\x0f\x5b\xe7\x84\xb9\x5c\x12\x45\xaf\x83\x7e\x0f\xcc\x9d\xb7\xe1\x02\xe5\xb7\x0d\x2d\x03\xdd\x3e\xd4\x36\xd2\x18\xd6\x43\xa6\x75\xb8\xad\xfd\x64\x2f\xe6\x3a\x48\x0b\x64\x5d\xd7\xdd\xac\x85\xc1\x99\x5e\xf5\x91\x03\xcc\xaf\x16\xe1\x0e\xb2\xd9\x8d\x7c\x9b\x62\xae\xd6\x58\x6b\x6f\x21\x1d\x0c\x28\xf9\xfd\x8b\x13\xcd\xac\x20\xf1\xb0\x99\xcd\xf1\x77\x3d\x98\x23\xff\x06\xb1\x85\xb6\x19\x5b\xe0\xcf\x3b\x91\xad\x89\x19\x24\x1b\x20\xc8\x40\xcf\xee\x7c\x2f\x0c\x8f\xab\xa5\xf6\x6c\x3f\x7c\x37\xc2\x62\x22\x78\x80\xba\x55\x54\x63\x88\xf3\x04\x74\x2d\xfd\x72\x36\x84\xc3\xeb\xba\xd6\x46\x11\x83\xdb\xdd\x20\x1e\x6d\x88\x49\x5b\x7d\xb3\x42\x5a\xfd\x9a\xef\xa1\xc4\x4d\xfd\xca\x66\xdb\xf5\xd4\x03\x57\x91\x16\x1f\x6d\xf7\xd0\x36\x2f\x68\x1d\x94\x4e\x0f\x68\xa5\xee\x99\xfd\x3d\xfa\x7c\x5f\xd1\x3a\x99\x47\x62\x45\xe7\xdc\x76\xcd\x6e\x1b\x62\xf4\x04\x56\x44\x36\x18\xed\x4d\x71\x47\x8f\xce\x28\xc6\xb8\x1d\x39\x12\xbd\xe9\xe8\xbf\xb7\xbf\x2e\x18\xe9\x61\xe9\x8f\xfe\x6e\x30\x39\x42\x64\xf5\x62\xc8\x51\xb3\x58\xbf\x51\x72\xf0\xd4\xb5\xc6\x5b\x57\x70\x76\x90\x1f\x72\x02\xd8\x76\xda\x79\x60\x80\xee\x3b\x50\x87\xcd\xb7\x3b\x4e\x63\xba\x9a\x99\x7c\x99\x85\x38\x0f\x2f\x6b\x46\x5c\xac\x20\x21\x26\xcc\x1e\x6b\xfb\x95\x77\x21\xda\xdd\x95\xfb\x80\x9b\x4a\xc5\x9a\x69\x60\xf5\x80\xb9\xb9\xf3\xd8\x73\x9f\x6a\xb6\xea\x75\xa8\xe4\x8a\x56\x8b\x8f\x29\xaa\x5d\x9b\x1a\x6f\xc8\x16\x41\xa4\xf1\x06\x55\xa9\x8b\xbf\x89\xf5\x29\x44\x51\x6b\xc0\x1b\x8a\xc8\x74\x65\x7b\x68\x7b\xa9\xe6\xa1\xed\x8a\x36\x11\x91\x61\x40\xd2\xc8\xac\xe0\x71\x09\x92\x5c\xf0\x38\x8d\xcb\xa6\x72\x1c\x02\x12\x69\x2f\xbf\x9a\x6d\x7b\x2b\x2b\x5d\xf7\x5a\xf9\x2b\xb9\xb1\xe2\xf7\x0c\xd5\x76\xc3\xae\xdc\x05\xb4\x23\x2d\xc8\xfe\xf4\x41\xcd\x86\x65\x9f\x0d\xee\x22\x4c\xc3\x0a\xd7\xd6\x61\x47\x9b\x90\x86\x75\xff\xbd\x28\x74\xb8\xcc\xa6\x46\xbb\xea\xaf\x17\x0c\x54\x71\x83\x8a\x93\xb9\x73\x3a\xbd\x13\x86\xdc\xd8\x31\x30\x21\xd7\xa5\x33\x03\x2f\x37\xf9\x9a\xc7\x3c\x22\xca\x8e\x8e\x69\xb0\x20\xac\x3f\x85\xa8\x70\x0d\x34\x22\xa9\x46\xdb\x4a\x04\x5c\xfe\xfd\xa5\x4b\x2e\x30\x46\x61\x66\xe5\x2a\xa5\xf3\x4a\xb4\x35\x55\xe7\x22\xec\xf6\x1a\x88\x31\x8a\x6f\x52\x83\x1a\x16\x40\x65\x94\xc6\xa2\x4e\x45\x28\x95\xa9\x30\x73\x28\xc4\xbd\x90\x0a\xf0\x86\xc4\x49\x84\x33\xe0\x02\xdc\x2d\xa1\x6c\x0e\x15\xc7\x6b\xb4\xa0\x58\xe5\xd5\xfe\x40\x83\x40\xaa\x51\x59\xe1\xa5\x89\x86\x28\x77\x3c\xe0\x08\xae\xe2\xdd\xd5\x6a\x52\xbc\xbc\xba\xba\xd2\x1f\xa3\x8a\x15\x9e\x19\x22\xfe\x01\x61\x1a\xef\xfe\x30\xad\x92\x96\x7c\xef\xf6\x07\x1d\x28\x11\x40\x22\x2d\x61\x83\xfe\x88\x01\x19\x48\x1b\x58\x51\xed\xcb\x9d\xf9\x11\x46\xea\x74\x53\xb8\x81\xf6\x80\x87\xae\x6a\x7d\x15\x48\xf9\x74\x43\xd4\xd5\xac\xd3\xa6\x2a\xef\xda\x63\xe5\xfc\x03\xee\xe0\x29\x4c\x03\x29\xa7\x40\x04\x6b\xa5\xb9\x26\x51\x8a\x96\x6a\x43\x54\xc7\x28\xfc\xec\xa7\xaf\xea\x59\x62\x6a\x2c\x48\x5f\x73\x86\x6c\x06\x52\x01\xf7\x34\x5e\x1a\xd7\x80\x71\x62\x76\x33\xdb\x56\x9e\x97\xed\xcd\xa5\x09\x89\x71\x2d\x76\x42\x20\x24\x1a\x12\x54\x31\xd7\x36\x11\xb3\x03\xa4\x11\xe1\x13\x8f\x22\xd8\x94\xf3\xec\xa3\x1b\xd9\x7c\x28\x96\x66\x37\xcf\xea\x21\x9a\x35\xde\x43\x8c\xfa\xd9\xdd\xec\xee\x3c\x4a\x73\xc1\xc3\x02\x75\x93\x9a\x83\x83\xb5\x11\xa6\x07\x3a\x70\x31\xab\xee\xb5\xf7\xdb\x3c\xd0\x06\x84\x22\xd1\xb4\xdd\xfb\x5e\xab\xe3\xfa\x84\x35\x11\x6c\x0d\x01\x57\xda\xc0\x70\x25\x66\x9e\xe3\x55\xaf\x4e\x77\x15\x11\x42\x02\xde\x24\x11\xa7\xdc\x78\x13\x3c\x80\x39\x8f\xcf\xc1\x65\xb0\xa3\xfb\x0b\x93\x75\x3f\xf7\x6d\x77\xe3\xe6\xa9\xd3\x47\xbb\xe2\x49\x1c\x93\x0b\x8d\xd6\x7e\x8b\x79\xf9\x45\x6f\xdf\x9b\x9d\xa5\x0d\xee\x05\x2a\xc0\x0b\xff\x5a\x06\x16\x88\x2e\xb4\x51\x29\x35\xa9\xb2\x12\x85\x4b\x9c\x5c\xe6\xa9\xed\x6c\xc0\x93\xe2\xed\x0f\xf3\x27\x4e\xec\x0f\x20\xa4\x71\xa7\x44\xa5\xc0\x27\xda\xe4\x44\xdf\x42\x8c\x44\x68\xe7\x15\x8e\xde\x09\x84\x42\x4c\xc1\xf3\x93\x77\xe4\x95\xf7\x6a\x42\x43\xb8\xac\xa0\xa2\xd5\x7d\x8b\x06\x38\x9b\xb9\xb3\xca\x19\x24\x11\x11\xdf\x70\xe6\x74\xfc\xc0\x05\x7b\xe4\x7e\x79\xf0\x84\x6f\x8a\xee\xf4\xa3\x9a\x77\x15\xbf\x25\x8d\x9d\xc0\x3a\xb4\x5f\x5c\x94\xae\xe3\xd9\x9f\x72\x36\x73\x1d\xda\xfe\xe6\x9c\xf9\xff\x6d\x87\xb3\x0c\xa8\xbf\xad\x73\xa1\xa1\xe1\x4b\xf7\xe6\x69\xed\xea\x42\xd9\x79\xaf\xc3\xfc\x3f\x00\x00\xff\xff\xe3\xa8\xf9\x43\x6e\x4a\x00\x00") +var _openapiYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\x5f\x8f\xdb\xb8\x11\x7f\xdf\x4f\x31\x40\x5b\xf8\x72\xf0\xda\x4e\xef\x0a\xb4\x46\x72\x40\x72\xbd\x14\x77\xc8\x25\x69\x36\x69\x1f\x8a\xc2\x4b\x93\x23\x8b\x89\x44\x2a\x24\xb5\xbb\x4e\xdb\xef\x5e\x90\xd4\x7f\x4b\x5a\xd9\xdd\x8d\x95\xad\xef\xe5\x56\xd4\x70\x38\x43\xfe\xe6\xc7\x11\x87\x8e\x4c\x50\x90\x84\x2f\xe1\xbb\xd9\x62\xb6\x38\xe3\x22\x90\xcb\x33\x00\xc3\x4d\x84\x4b\x88\x09\x6a\xa3\x24\x5c\xa0\xba\xe2\x14\xe1\xd9\x9b\x9f\xcf\x00\x18\x6a\xaa\x78\x62\xb8\x14\x5d\x22\x57\xa8\xb4\x7b\xbd\x98\x2d\x66\x8f\xcf\x34\x2a\xdb\x62\x35\x9f\x43\xaa\xa2\x25\x84\xc6\x24\xcb\xf9\x3c\x92\x94\x44\xa1\xd4\x66\xf9\xc7\xc5\x62\x71\x06\xd0\xd0\x4e\x53\xa5\x50\x18\x60\x32\x26\x5c\xd4\xbb\xeb\xe5\x7c\x4e\x12\x3e\xb3\x2e\xe8\x90\x07\x66\x46\x65\xbc\xab\xe2\x57\xc2\x05\x7c\x93\x28\xc9\x52\x6a\x5b\x1e\x81\xb7\xa6\x5d\x99\x36\x64\x83\xb7\xa9\xbc\x30\x64\xc3\xc5\x26\x57\x94\x10\x13\x3a\xdf\xac\x86\x79\x36\x21\xf3\xab\xc7\x73\x85\x5a\xa6\x8a\xa2\x7b\x09\xb0\x41\xe3\xff\x00\xd0\x69\x1c\x13\xb5\x5d\xc2\x5b\x34\xa9\x12\x1a\x08\x44\x5c\x1b\x90\x01\x14\x9d\x72\x51\xa4\xa9\xe2\x66\x9b\x77\xb5\x66\x3f\x47\xa2\x50\x2d\xe1\x1f\xff\xcc\x1a\x15\xea\x44\x0a\x9d\x8f\x64\xff\x9b\xfc\x7e\xb1\x98\x94\x8f\x0d\x17\x9e\xc1\x2f\x17\xaf\x5f\x01\x51\x8a\x6c\xab\xa3\x82\x5c\x7f\x40\x6a\x74\xa5\x1f\x95\xc2\xa0\x30\x55\x55\x00\x24\x49\x22\x4e\x89\x55\x36\xff\xa0\xa5\xa8\xbf\x05\xd0\x34\xc4\x98\x34\x5b\x01\x7e\xab\x30\x58\xc2\xe4\x37\x73\x2a\xe3\x44\x0a\x14\x46\xcf\xbd\xac\x9e\xbf\xcd\x6c\x78\xc9\xb5\x99\x94\x7e\x7c\xbf\x78\xdc\xe3\x47\x6a\x42\x30\xf2\x23\x0a\xe0\x1a\xb8\xb8\x22\x11\x67\xc7\x30\xfe\x27\xa5\xa4\xaa\x59\xfd\x5d\xb7\xd5\xef\x05\x49\x4d\x28\x15\xff\x8c\x0c\x8c\x84\x04\x55\x20\x55\x0c\x32\x41\xe5\xcc\x1a\x83\x07\x7f\xe8\xc3\xcf\x7b\x81\x37\x09\x52\x83\x0c\xd0\xf6\x03\x49\x5d\xac\x1e\x7f\xee\x13\xa2\x48\x8c\x26\xa3\x1b\x70\xf1\xd2\xd6\xb9\x94\x9b\x27\x64\x83\x93\xa1\xc2\x9a\x7f\xde\x43\x18\x89\xa2\xe1\x60\x71\xa9\x18\xaa\xe7\xdb\xc1\xf2\x01\xc7\x88\x69\x2f\x9e\x58\x16\x6d\xd2\xcb\x8f\x0a\x89\x41\x20\x20\xf0\xba\x88\xf1\xfd\x88\xe5\x53\x8a\xda\x3c\x97\xac\x22\x57\x43\x42\x1e\xb5\xc0\x88\x21\x85\x88\xed\xc7\x15\xb2\x25\x18\x95\xe2\x59\x0f\x24\xfa\x01\xd1\x0e\x87\x21\x2c\x32\xe9\xa5\xc6\x1e\x4a\xf1\x73\x76\x14\x20\x37\x6d\x77\x3c\xd2\x13\x85\x7f\xb3\x6c\xe7\x4c\xf0\x51\xa8\xc7\x13\x86\x27\xe2\x3e\xa2\x07\x7f\xea\xf6\xa0\x08\x57\x12\x29\x24\x6c\x0b\x78\xc3\xf5\x71\xf6\xfb\xbd\x36\x9c\x67\x02\xd2\xae\x3d\x07\xa8\x0d\x59\x9b\x91\x99\x10\x9b\x34\x77\x1c\x97\x3a\x53\xc1\xf9\xbf\x38\xfb\x4f\x77\x3e\xf8\x17\x34\x40\x44\x99\x8e\xad\xb7\x50\x84\xc5\xfd\x64\x82\x05\x20\x02\x99\x0a\x56\x1b\xf0\x8b\x4e\x5d\x2b\xf7\x9d\x08\xe4\x38\x1e\x7c\xdf\xed\xc1\x2b\x59\xa2\xf3\x9a\x9b\x10\x74\x82\x94\x07\x1c\x19\x70\xf6\xb5\xb0\xc9\x58\xd3\xd7\x84\x18\x1a\xee\x90\xc2\xfb\x84\xb9\x2c\x4e\xdc\x53\x0a\xe7\xf5\xb3\x72\x5d\x47\x96\xca\xbd\xb1\xb3\xf2\xd6\xbb\xd1\x9f\xd6\x0d\xe1\xb9\x34\xf3\x56\xa7\x94\xa2\xd6\x41\x1a\x45\xdb\xd1\x10\xde\x29\xd9\xfb\xc2\x56\x9f\xb8\x7a\x14\x4e\x3c\xc0\x8c\x75\x67\x8f\x71\xc4\x63\xb3\xd4\x51\x64\xa8\xd6\xda\x08\x0d\xee\xec\x36\x7f\x76\xcd\x40\x0e\xdc\x6c\xda\x68\xb9\x07\xa2\xe5\xf1\x81\x1b\xb6\x83\x96\x4f\xcc\xf8\xe5\xad\x3e\x31\xe3\x08\x9c\xd8\x8f\x61\x5c\x0c\x8d\x88\x61\x9a\x67\xb1\xb7\x1e\x68\x72\xd6\xf7\xf1\xbc\x4e\x05\x8b\x0e\xab\xa6\x64\x5d\xef\xf5\x4b\xba\xab\xa6\xe2\xc7\x1e\x43\x65\xe5\xb9\xb3\xe4\x54\x5f\x19\x05\x3f\x7d\x95\x1f\xa8\xff\xaf\xf5\x95\x26\x25\x51\x29\x74\x1a\x17\x93\x30\x8c\x8c\x8a\x4e\x5f\x94\x86\xf2\x51\x8f\x49\x40\x3f\x66\x36\x9c\xa8\xe7\x44\x3d\x77\x49\x3d\x7b\x92\xcf\x9e\xf4\xb3\x37\x01\xed\x4f\x41\x77\x5e\xe4\xcd\xa3\x7d\x3f\x8a\xb9\xed\x84\x30\x8f\xdf\xb1\x9c\x0c\xe6\xf6\x7c\x8d\x45\xde\xa6\xed\xa7\xaf\xdb\x13\x85\x1f\xe2\x41\xcf\x91\x59\x11\xae\x5f\xd9\x91\xd9\xf0\x22\x6f\x83\xe6\x8e\xe3\x52\x67\x52\x38\xac\xc8\x5b\x24\x66\xf7\x5f\xe4\x2d\x00\x71\xe4\x22\x6f\x2b\xf7\x9d\x08\x64\x8c\xc7\x63\x05\x3a\x1f\xce\xf1\xd8\x48\xf6\xcd\xdb\x8a\xbc\xf7\x93\xc2\xe5\x45\x5e\x3a\xd2\x54\xee\x4e\x8a\xbc\x05\xcf\x8d\xa5\xc8\x7b\x4a\xf6\xc6\x60\xf5\x89\xab\x47\xe1\xc4\x03\xcc\x58\xbb\x8b\xbc\xa3\xc8\x50\x6f\x2f\xf2\x1e\xb6\xd9\xec\x59\xe4\x2d\x8f\x0f\x4e\x45\xde\x13\x33\xde\xad\x07\x0f\x80\x19\x0f\x2c\xf2\x8e\x84\x61\x0e\x28\x08\x71\x36\x39\x2b\xdf\xd8\x6e\x39\xef\x5c\x58\xfd\x39\xb1\x64\xc4\x93\x69\x35\xdb\x04\xfd\x8f\xf5\xce\x2a\x76\xe3\x12\xd6\x4e\x2c\x6b\xf4\x0f\x2f\xa4\x8a\x89\x59\xc2\x2f\x7f\x7f\x77\x96\x3b\x98\x29\x7d\xed\xaa\x20\x6f\x31\x40\x85\x82\x62\x5d\xbb\x2f\x91\x64\x4d\x89\xb2\x50\x37\xbc\xca\x73\x9c\x55\xe7\xc9\x77\xd2\x46\x71\xb1\x29\x9a\x3f\x72\x71\xbb\x50\x68\x27\xa8\x4f\xe8\x25\x2f\x4f\x7a\x07\xda\x36\x68\xe0\x84\x6c\x70\x57\x88\x0b\x83\x9b\x0a\x92\x34\xff\x3c\x40\xca\x48\x43\xa2\xdb\xc4\x8a\x2f\x8b\xca\x8e\x62\x2d\xad\x3c\x5a\x9b\x2a\x8f\x76\xf0\xca\xa3\x1b\xa5\xf2\xcc\x0d\xc6\x3e\x6c\x1d\x08\x73\xbd\x24\x8a\x5e\x07\xfd\x08\xcc\xc1\xdb\x80\x40\x59\x0e\x6c\x99\xe8\xf6\xa9\xb6\x91\xc6\xb0\x1e\x32\xad\xd3\x6d\xfd\x27\x3b\x31\xd7\x21\x5a\x30\xeb\xaa\x0e\xb3\x96\x0e\xce\xf5\x2a\x46\xf6\x70\xbf\x5a\x84\xdb\xcb\x67\x37\xf3\x6d\x86\xb9\x5a\x63\xad\xbd\x45\x74\x30\xa1\xe4\xb7\x15\x8e\xb4\xb2\x82\xc4\xc3\x56\x36\xe7\xdf\xd5\xe0\x1e\xf9\xcf\xa2\x5b\x64\x9b\xb1\x05\xfe\xbc\x13\xd9\x8a\x98\x41\xba\x01\x82\x8c\xf4\xec\x97\xef\xb9\xe1\x71\xf5\xf6\x4f\xf6\x3d\x7c\x37\xca\x62\x22\x78\x80\xba\x55\x55\x63\x8a\xf3\x04\x74\x25\xfd\x76\x36\xa4\x87\xb7\x75\xa5\x8d\x22\x06\x37\xdb\x41\x7d\xb4\x21\x26\x6d\xc5\x66\x45\xb4\xfa\x03\xe3\x87\x12\x37\xf5\x5b\xe4\x6d\x37\xe6\xf7\xdc\x45\x5a\x30\xda\x8e\xd0\x36\x14\xb4\x4e\x4a\x27\x02\x5a\xa5\x7b\x56\xbf\x73\x41\xcb\x7b\x4d\x0f\x6d\x59\xbd\x67\x93\x16\x6f\x4f\xec\x38\x72\x76\xfc\x5f\xa0\x71\x67\x5c\x9a\x1b\xb3\xa2\x52\x04\x7c\x73\x0f\x36\x0d\x62\xde\xfc\x00\xa0\x15\xb4\x07\xc2\xb6\x13\xb8\x5d\xd0\x6d\x03\x6f\xcf\x1a\x47\x64\x8d\xd1\xd0\x59\x70\x4e\x31\xc6\xed\xc2\x90\xe8\x4d\xc7\xf8\xbd\xe3\x75\x21\xba\xa7\x4b\x3f\x10\xbb\x71\x7d\x80\xca\xea\x0d\xae\x83\x56\xb1\x7e\xf5\x6b\xef\xa5\xeb\x81\xe4\x2e\x7e\x3b\xc4\xf7\x39\xaa\x6f\x2b\x4b\xec\xb9\x93\xee\x02\xa8\xc3\xe7\xdb\x81\xd3\x58\xae\xe6\x27\x77\xf9\xb9\xe0\x10\x5e\x16\x77\xb9\x58\x42\x42\x4c\x98\x3d\xd6\x0e\x16\xde\x85\x08\x9c\xf9\x8b\xca\x54\xaa\xbc\x4b\x6b\x25\xa8\x79\x44\xb0\x03\x9f\xea\x67\xa5\xb7\xa1\xf2\x51\x67\xad\xf8\x94\xa2\xda\xb6\x99\xf1\x86\x6c\x10\x44\x1a\xaf\x51\x95\xb6\xf8\x2b\x93\xd7\x21\x8a\x5a\x03\xde\x50\x44\xa6\x2b\xe7\x38\x76\x94\xea\x07\x63\xbb\xa1\xcd\xed\x83\x61\x40\xd2\xc8\x2c\xe1\x71\x99\xcd\x70\xc1\xe3\x34\x2e\x9b\xca\x79\x08\x48\xa4\xbd\xfe\xea\x67\xb1\xf7\xb2\x32\x74\xaf\x97\xbf\x92\x1b\xab\x7e\xc7\x51\x0d\x46\x82\x72\x37\x45\x0f\xf4\x20\xfb\x67\x93\x6a\x3e\x2c\xfa\x7c\x70\x37\xd6\x1a\x5e\xb8\xb6\x0e\x3f\xda\x94\x34\xbc\xfb\xf7\x79\x61\xc3\x45\xb6\x34\xda\x5d\xd3\xf0\x8a\x81\x2a\x6e\x50\x71\x32\x73\xa0\xd3\x5b\x61\xc8\x8d\x9d\x03\x13\x72\x5d\x82\x19\x78\x79\x1a\xa7\x79\xcc\x23\xa2\xec\xec\x98\x46\x17\x84\xd5\x75\x88\x0a\x57\x40\x23\x92\x6a\xb4\xad\x44\xc0\xc5\x5f\x5f\xba\xbd\x08\x63\x14\x66\x5a\xa6\x93\x3a\xbf\x32\x62\x5d\xd5\xb9\x8a\x0f\x5a\x0a\x20\xc6\x28\xbe\x4e\x0d\x6a\x98\x03\x95\x51\x1a\x8b\xba\x14\xa1\x54\xa6\xc2\xcc\xa0\x50\xf7\x42\x2a\xc0\x1b\x12\x27\x11\x4e\x81\x0b\x70\xd7\xf9\xb2\x35\x54\x1c\xaf\xd0\x92\x62\xb5\xaf\xf6\x27\x8f\x04\x52\x8d\xca\x2a\x2f\x5d\x34\x44\xb9\x73\x3c\x27\x70\x19\x6f\x2f\x97\x67\xc5\xcb\xcb\xcb\x4b\xfd\x29\xaa\x78\xe1\x3b\x43\xc4\x3f\x22\x4c\xe2\xed\xef\x26\x55\xd1\xb2\xdf\xbb\xdd\x49\x07\x4a\x04\x90\x48\x4b\x58\xa3\x3f\x0b\x44\x06\xd2\x06\x56\x54\xfb\xd5\xef\xec\x00\x27\x75\xba\x2e\x60\xa0\x3d\xe1\xa1\xbb\x5e\x72\x19\x48\xf9\x74\x4d\xd4\xe5\xb4\xd3\xa7\x6a\xdf\x95\xe7\xca\xd9\x47\xdc\xc2\x53\x98\x04\x52\x4e\x80\x08\xd6\x2a\x73\x45\xa2\x14\xad\xd4\x9a\xa8\x8e\x59\xf8\xd9\x2f\x5f\x15\x59\x62\x62\x2c\x49\x5f\x71\x86\x6c\x0a\x52\x01\xf7\x32\x5e\x1b\xd7\x80\x71\x62\xb6\x53\xdb\x56\x1e\x6c\xef\xac\xa5\x09\x89\x71\x2d\x76\x41\x20\x24\x1a\x12\x54\x31\xd7\x36\x6f\xb5\x13\xa4\x11\xe1\x9a\x47\x11\xac\xcb\x75\xf6\xd1\x8d\x6c\x36\x94\x4b\xb3\x2b\xa2\xf5\x10\xcd\x1a\xef\x21\x46\xfd\xea\xae\xb7\x77\x1e\xa5\xb9\xe2\x61\x81\xba\x4e\xcd\xde\xc1\xda\x08\xd3\x3d\x01\x5c\xac\xaa\x7b\xed\x71\x9b\x07\xda\x80\x50\x24\x9a\xb6\xa3\xef\xb5\x3a\x6c\x4c\x58\x11\xc1\x56\x10\x70\xa5\x0d\x0c\x37\x62\xea\x7b\xbc\xea\xb5\xe9\xae\x22\x42\x48\xc0\x9b\x24\xe2\x94\x1b\xef\x82\x27\x30\x87\xf8\x9c\x5c\x06\x03\xdd\xdf\x6c\xae\xe3\xdc\xb7\xdd\x0d\xcc\x53\x67\x8f\x76\x55\xce\x38\x26\xe7\x1a\xad\xff\x96\xf3\xf2\x5f\x64\xf8\xd1\xec\x2a\xad\x71\x27\x50\x01\x5e\xf8\xd7\x32\xb0\x44\x74\xae\x8d\x4a\xa9\x49\x95\xd5\x28\x5c\xe2\xe4\x32\x4f\x6d\x57\x03\x9e\x14\x6f\x7f\x98\x3d\x71\x6a\x7f\x00\x21\x8d\x3b\xce\x2d\x15\x3e\xd1\x26\x17\xfa\x16\x62\x24\x42\x3b\x54\x38\x79\xa7\x10\x0a\x35\x45\x9f\x9f\x3c\x90\x97\x1e\xd5\x84\x86\x70\x51\x61\x45\x6b\xfb\x06\x0d\x70\x36\x75\x45\x85\x29\x24\x11\x11\xdf\x70\xe6\x6c\xfc\xc8\x05\x7b\xe4\xfe\xf2\xe4\x09\xdf\x14\xc3\xe9\x47\x35\x74\x15\x7f\x4b\x1a\x3b\x85\x75\x6a\x3f\x3f\x2f\xa1\xe3\xbb\x3f\xe5\x6c\xea\x06\xb4\xe3\xcd\x38\xf3\xff\xb7\x03\x4e\x33\xa2\xfe\xb6\xde\x0b\x0d\x0d\x5f\xba\x37\x4f\x6b\x77\x8c\xca\xc1\x7b\x01\xf3\xdf\x00\x00\x00\xff\xff\x62\xdc\xbd\x79\xaa\x52\x00\x00") func openapiYamlBytes() ([]byte, error) { return bindataRead( @@ -92,7 +92,7 @@ func openapiYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "openapi.yaml", size: 19054, mode: os.FileMode(493), modTime: time.Unix(1716477375, 0)} + info := bindataFileInfo{name: "openapi.yaml", size: 21162, mode: os.FileMode(493), modTime: time.Unix(1717043938, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 68509b21..cfa855a7 100755 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -224,6 +224,42 @@ paths: $ref: '#/components/schemas/Error' parameters: - $ref: '#/components/parameters/id' + /api/maestro/v1/resourcebundles: + get: + summary: Returns a list of resourcebundles + security: + - Bearer: [] + responses: + '200': + description: A JSON array of resourcebundle objects + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceBundleList' + '401': + description: Auth token is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '403': + description: Unauthorized to perform operation + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: Unexpected error occurred + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + parameters: + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/size' + - $ref: '#/components/parameters/search' + - $ref: '#/components/parameters/orderBy' + - $ref: '#/components/parameters/fields' /api/maestro/v1/consumers: get: summary: Returns a list of consumers @@ -535,6 +571,44 @@ components: type: object update_strategy: type: object + ResourceBundleList: + allOf: + - $ref: '#/components/schemas/List' + - type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/ResourceBundle' + ResourceBundle: + allOf: + - $ref: '#/components/schemas/ObjectReference' + - type: object + properties: + name: + type: string + consumer_name: + type: string + version: + type: integer + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + manifests: + type: array + items: + type: object + delete_option: + type: object + manifest_configs: + type: array + items: + type: object + status: + type: object Consumer: allOf: - $ref: '#/components/schemas/ObjectReference' diff --git a/pkg/api/openapi/.openapi-generator/FILES b/pkg/api/openapi/.openapi-generator/FILES index 81c6717b..e19f8922 100644 --- a/pkg/api/openapi/.openapi-generator/FILES +++ b/pkg/api/openapi/.openapi-generator/FILES @@ -20,6 +20,10 @@ docs/List.md docs/ObjectReference.md docs/Resource.md docs/ResourceAllOf.md +docs/ResourceBundle.md +docs/ResourceBundleAllOf.md +docs/ResourceBundleList.md +docs/ResourceBundleListAllOf.md docs/ResourceList.md docs/ResourceListAllOf.md docs/ResourcePatchRequest.md @@ -39,6 +43,10 @@ model_list.go model_object_reference.go model_resource.go model_resource_all_of.go +model_resource_bundle.go +model_resource_bundle_all_of.go +model_resource_bundle_list.go +model_resource_bundle_list_all_of.go model_resource_list.go model_resource_list_all_of.go model_resource_patch_request.go diff --git a/pkg/api/openapi/README.md b/pkg/api/openapi/README.md index 10bbace4..7cf631b9 100644 --- a/pkg/api/openapi/README.md +++ b/pkg/api/openapi/README.md @@ -82,6 +82,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**ApiMaestroV1ConsumersIdGet**](docs/DefaultApi.md#apimaestrov1consumersidget) | **Get** /api/maestro/v1/consumers/{id} | Get an consumer by id *DefaultApi* | [**ApiMaestroV1ConsumersIdPatch**](docs/DefaultApi.md#apimaestrov1consumersidpatch) | **Patch** /api/maestro/v1/consumers/{id} | Update an consumer *DefaultApi* | [**ApiMaestroV1ConsumersPost**](docs/DefaultApi.md#apimaestrov1consumerspost) | **Post** /api/maestro/v1/consumers | Create a new consumer +*DefaultApi* | [**ApiMaestroV1ResourcebundlesGet**](docs/DefaultApi.md#apimaestrov1resourcebundlesget) | **Get** /api/maestro/v1/resourcebundles | Returns a list of resourcebundles *DefaultApi* | [**ApiMaestroV1ResourcesGet**](docs/DefaultApi.md#apimaestrov1resourcesget) | **Get** /api/maestro/v1/resources | Returns a list of resources *DefaultApi* | [**ApiMaestroV1ResourcesIdDelete**](docs/DefaultApi.md#apimaestrov1resourcesiddelete) | **Delete** /api/maestro/v1/resources/{id} | Delete a resource *DefaultApi* | [**ApiMaestroV1ResourcesIdGet**](docs/DefaultApi.md#apimaestrov1resourcesidget) | **Get** /api/maestro/v1/resources/{id} | Get an resource by id @@ -104,6 +105,10 @@ Class | Method | HTTP request | Description - [ObjectReference](docs/ObjectReference.md) - [Resource](docs/Resource.md) - [ResourceAllOf](docs/ResourceAllOf.md) + - [ResourceBundle](docs/ResourceBundle.md) + - [ResourceBundleAllOf](docs/ResourceBundleAllOf.md) + - [ResourceBundleList](docs/ResourceBundleList.md) + - [ResourceBundleListAllOf](docs/ResourceBundleListAllOf.md) - [ResourceList](docs/ResourceList.md) - [ResourceListAllOf](docs/ResourceListAllOf.md) - [ResourcePatchRequest](docs/ResourcePatchRequest.md) diff --git a/pkg/api/openapi/api/openapi.yaml b/pkg/api/openapi/api/openapi.yaml index 903bc260..73284441 100644 --- a/pkg/api/openapi/api/openapi.yaml +++ b/pkg/api/openapi/api/openapi.yaml @@ -323,6 +323,116 @@ paths: security: - Bearer: [] summary: Update an resource + /api/maestro/v1/resourcebundles: + get: + parameters: + - description: Page number of record list when record list exceeds specified + page size + explode: true + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + style: form + - description: Maximum number of records to return + explode: true + in: query + name: size + required: false + schema: + default: 100 + minimum: 0 + type: integer + style: form + - description: "Specifies the search criteria. The syntax of this parameter\ + \ is\nsimilar to the syntax of the _where_ clause of an SQL statement,\n\ + using the names of the json attributes / column names of the account. \n\ + For example, in order to retrieve all the accounts with a username\nstarting\ + \ with `my`:\n\n```sql\nusername like 'my%'\n```\n\nThe search criteria\ + \ can also be applied on related resource.\nFor example, in order to retrieve\ + \ all the subscriptions labeled by `foo=bar`,\n\n```sql\nsubscription_labels.key\ + \ = 'foo' and subscription_labels.value = 'bar'\n```\n\nIf the parameter\ + \ isn't provided, or if the value is empty, then\nall the accounts that\ + \ the user has permission to see will be\nreturned." + explode: true + in: query + name: search + required: false + schema: + type: string + style: form + - description: |- + Specifies the order by criteria. The syntax of this parameter is + similar to the syntax of the _order by_ clause of an SQL statement, + but using the names of the json attributes / column of the account. + For example, in order to retrieve all accounts ordered by username: + + ```sql + username asc + ``` + + Or in order to retrieve all accounts ordered by username _and_ first name: + + ```sql + username asc, firstName asc + ``` + + If the parameter isn't provided, or if the value is empty, then + no explicit ordering will be applied. + explode: true + in: query + name: orderBy + required: false + schema: + type: string + style: form + - description: |- + Supplies a comma-separated list of fields to be returned. + Fields of sub-structures and of arrays use . notation. + .* means all field of a structure + Example: For each Subscription to get id, href, plan(id and kind) and labels (all fields) + + ``` + ocm get subscriptions --parameter fields=id,href,plan.id,plan.kind,labels.* --parameter fetchLabels=true + ``` + explode: true + in: query + name: fields + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceBundleList' + description: A JSON array of resourcebundle objects + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Auth token is invalid + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unauthorized to perform operation + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unexpected error occurred + security: + - Bearer: [] + summary: Returns a list of resourcebundles /api/maestro/v1/consumers: get: parameters: @@ -788,6 +898,14 @@ components: update_strategy: type: object type: object + ResourceBundleList: + allOf: + - $ref: '#/components/schemas/List' + - $ref: '#/components/schemas/ResourceBundleList_allOf' + ResourceBundle: + allOf: + - $ref: '#/components/schemas/ObjectReference' + - $ref: '#/components/schemas/ResourceBundle_allOf' Consumer: allOf: - $ref: '#/components/schemas/ObjectReference' @@ -856,6 +974,42 @@ components: type: array type: object example: null + ResourceBundleList_allOf: + properties: + items: + items: + $ref: '#/components/schemas/ResourceBundle' + type: array + type: object + example: null + ResourceBundle_allOf: + properties: + name: + type: string + consumer_name: + type: string + version: + type: integer + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + manifests: + items: + type: object + type: array + delete_option: + type: object + manifest_configs: + items: + type: object + type: array + status: + type: object + type: object + example: null Consumer_allOf: properties: name: diff --git a/pkg/api/openapi/api_default.go b/pkg/api/openapi/api_default.go index ed3e1b24..6060e2ee 100644 --- a/pkg/api/openapi/api_default.go +++ b/pkg/api/openapi/api_default.go @@ -834,6 +834,186 @@ func (a *DefaultApiService) ApiMaestroV1ConsumersPostExecute(r ApiApiMaestroV1Co return localVarReturnValue, localVarHTTPResponse, nil } +type ApiApiMaestroV1ResourcebundlesGetRequest struct { + ctx context.Context + ApiService *DefaultApiService + page *int32 + size *int32 + search *string + orderBy *string + fields *string +} + +// Page number of record list when record list exceeds specified page size +func (r ApiApiMaestroV1ResourcebundlesGetRequest) Page(page int32) ApiApiMaestroV1ResourcebundlesGetRequest { + r.page = &page + return r +} + +// Maximum number of records to return +func (r ApiApiMaestroV1ResourcebundlesGetRequest) Size(size int32) ApiApiMaestroV1ResourcebundlesGetRequest { + r.size = &size + return r +} + +// Specifies the search criteria. The syntax of this parameter is similar to the syntax of the _where_ clause of an SQL statement, using the names of the json attributes / column names of the account. For example, in order to retrieve all the accounts with a username starting with `my`: ```sql username like 'my%' ``` The search criteria can also be applied on related resource. For example, in order to retrieve all the subscriptions labeled by `foo=bar`, ```sql subscription_labels.key = 'foo' and subscription_labels.value = 'bar' ``` If the parameter isn't provided, or if the value is empty, then all the accounts that the user has permission to see will be returned. +func (r ApiApiMaestroV1ResourcebundlesGetRequest) Search(search string) ApiApiMaestroV1ResourcebundlesGetRequest { + r.search = &search + return r +} + +// Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the _order by_ clause of an SQL statement, but using the names of the json attributes / column of the account. For example, in order to retrieve all accounts ordered by username: ```sql username asc ``` Or in order to retrieve all accounts ordered by username _and_ first name: ```sql username asc, firstName asc ``` If the parameter isn't provided, or if the value is empty, then no explicit ordering will be applied. +func (r ApiApiMaestroV1ResourcebundlesGetRequest) OrderBy(orderBy string) ApiApiMaestroV1ResourcebundlesGetRequest { + r.orderBy = &orderBy + return r +} + +// Supplies a comma-separated list of fields to be returned. Fields of sub-structures and of arrays use <structure>.<field> notation. <stucture>.* means all field of a structure Example: For each Subscription to get id, href, plan(id and kind) and labels (all fields) ``` ocm get subscriptions --parameter fields=id,href,plan.id,plan.kind,labels.* --parameter fetchLabels=true ``` +func (r ApiApiMaestroV1ResourcebundlesGetRequest) Fields(fields string) ApiApiMaestroV1ResourcebundlesGetRequest { + r.fields = &fields + return r +} + +func (r ApiApiMaestroV1ResourcebundlesGetRequest) Execute() (*ResourceBundleList, *http.Response, error) { + return r.ApiService.ApiMaestroV1ResourcebundlesGetExecute(r) +} + +/* +ApiMaestroV1ResourcebundlesGet Returns a list of resourcebundles + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiApiMaestroV1ResourcebundlesGetRequest +*/ +func (a *DefaultApiService) ApiMaestroV1ResourcebundlesGet(ctx context.Context) ApiApiMaestroV1ResourcebundlesGetRequest { + return ApiApiMaestroV1ResourcebundlesGetRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ResourceBundleList +func (a *DefaultApiService) ApiMaestroV1ResourcebundlesGetExecute(r ApiApiMaestroV1ResourcebundlesGetRequest) (*ResourceBundleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ResourceBundleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ApiMaestroV1ResourcebundlesGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/maestro/v1/resourcebundles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.orderBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "orderBy", r.orderBy, "") + } + if r.fields != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", r.fields, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiApiMaestroV1ResourcesGetRequest struct { ctx context.Context ApiService *DefaultApiService diff --git a/pkg/api/openapi/docs/DefaultApi.md b/pkg/api/openapi/docs/DefaultApi.md index f5f27e79..c4a26372 100644 --- a/pkg/api/openapi/docs/DefaultApi.md +++ b/pkg/api/openapi/docs/DefaultApi.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**ApiMaestroV1ConsumersIdGet**](DefaultApi.md#ApiMaestroV1ConsumersIdGet) | **Get** /api/maestro/v1/consumers/{id} | Get an consumer by id [**ApiMaestroV1ConsumersIdPatch**](DefaultApi.md#ApiMaestroV1ConsumersIdPatch) | **Patch** /api/maestro/v1/consumers/{id} | Update an consumer [**ApiMaestroV1ConsumersPost**](DefaultApi.md#ApiMaestroV1ConsumersPost) | **Post** /api/maestro/v1/consumers | Create a new consumer +[**ApiMaestroV1ResourcebundlesGet**](DefaultApi.md#ApiMaestroV1ResourcebundlesGet) | **Get** /api/maestro/v1/resourcebundles | Returns a list of resourcebundles [**ApiMaestroV1ResourcesGet**](DefaultApi.md#ApiMaestroV1ResourcesGet) | **Get** /api/maestro/v1/resources | Returns a list of resources [**ApiMaestroV1ResourcesIdDelete**](DefaultApi.md#ApiMaestroV1ResourcesIdDelete) | **Delete** /api/maestro/v1/resources/{id} | Delete a resource [**ApiMaestroV1ResourcesIdGet**](DefaultApi.md#ApiMaestroV1ResourcesIdGet) | **Get** /api/maestro/v1/resources/{id} | Get an resource by id @@ -357,6 +358,78 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## ApiMaestroV1ResourcebundlesGet + +> ResourceBundleList ApiMaestroV1ResourcebundlesGet(ctx).Page(page).Size(size).Search(search).OrderBy(orderBy).Fields(fields).Execute() + +Returns a list of resourcebundles + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" +) + +func main() { + page := int32(56) // int32 | Page number of record list when record list exceeds specified page size (optional) (default to 1) + size := int32(56) // int32 | Maximum number of records to return (optional) (default to 100) + search := "search_example" // string | Specifies the search criteria. The syntax of this parameter is similar to the syntax of the _where_ clause of an SQL statement, using the names of the json attributes / column names of the account. For example, in order to retrieve all the accounts with a username starting with `my`: ```sql username like 'my%' ``` The search criteria can also be applied on related resource. For example, in order to retrieve all the subscriptions labeled by `foo=bar`, ```sql subscription_labels.key = 'foo' and subscription_labels.value = 'bar' ``` If the parameter isn't provided, or if the value is empty, then all the accounts that the user has permission to see will be returned. (optional) + orderBy := "orderBy_example" // string | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the _order by_ clause of an SQL statement, but using the names of the json attributes / column of the account. For example, in order to retrieve all accounts ordered by username: ```sql username asc ``` Or in order to retrieve all accounts ordered by username _and_ first name: ```sql username asc, firstName asc ``` If the parameter isn't provided, or if the value is empty, then no explicit ordering will be applied. (optional) + fields := "fields_example" // string | Supplies a comma-separated list of fields to be returned. Fields of sub-structures and of arrays use . notation. .* means all field of a structure Example: For each Subscription to get id, href, plan(id and kind) and labels (all fields) ``` ocm get subscriptions --parameter fields=id,href,plan.id,plan.kind,labels.* --parameter fetchLabels=true ``` (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultApi.ApiMaestroV1ResourcebundlesGet(context.Background()).Page(page).Size(size).Search(search).OrderBy(orderBy).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ApiMaestroV1ResourcebundlesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ApiMaestroV1ResourcebundlesGet`: ResourceBundleList + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ApiMaestroV1ResourcebundlesGet`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiApiMaestroV1ResourcebundlesGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number of record list when record list exceeds specified page size | [default to 1] + **size** | **int32** | Maximum number of records to return | [default to 100] + **search** | **string** | Specifies the search criteria. The syntax of this parameter is similar to the syntax of the _where_ clause of an SQL statement, using the names of the json attributes / column names of the account. For example, in order to retrieve all the accounts with a username starting with `my`: ```sql username like 'my%' ``` The search criteria can also be applied on related resource. For example, in order to retrieve all the subscriptions labeled by `foo=bar`, ```sql subscription_labels.key = 'foo' and subscription_labels.value = 'bar' ``` If the parameter isn't provided, or if the value is empty, then all the accounts that the user has permission to see will be returned. | + **orderBy** | **string** | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the _order by_ clause of an SQL statement, but using the names of the json attributes / column of the account. For example, in order to retrieve all accounts ordered by username: ```sql username asc ``` Or in order to retrieve all accounts ordered by username _and_ first name: ```sql username asc, firstName asc ``` If the parameter isn't provided, or if the value is empty, then no explicit ordering will be applied. | + **fields** | **string** | Supplies a comma-separated list of fields to be returned. Fields of sub-structures and of arrays use <structure>.<field> notation. <stucture>.* means all field of a structure Example: For each Subscription to get id, href, plan(id and kind) and labels (all fields) ``` ocm get subscriptions --parameter fields=id,href,plan.id,plan.kind,labels.* --parameter fetchLabels=true ``` | + +### Return type + +[**ResourceBundleList**](ResourceBundleList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## ApiMaestroV1ResourcesGet > ResourceList ApiMaestroV1ResourcesGet(ctx).Page(page).Size(size).Search(search).OrderBy(orderBy).Fields(fields).Execute() diff --git a/pkg/api/openapi/docs/ResourceBundle.md b/pkg/api/openapi/docs/ResourceBundle.md new file mode 100644 index 00000000..29ee9474 --- /dev/null +++ b/pkg/api/openapi/docs/ResourceBundle.md @@ -0,0 +1,342 @@ +# ResourceBundle + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Kind** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**ConsumerName** | Pointer to **string** | | [optional] +**Version** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Manifests** | Pointer to **[]map[string]interface{}** | | [optional] +**DeleteOption** | Pointer to **map[string]interface{}** | | [optional] +**ManifestConfigs** | Pointer to **[]map[string]interface{}** | | [optional] +**Status** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewResourceBundle + +`func NewResourceBundle() *ResourceBundle` + +NewResourceBundle instantiates a new ResourceBundle object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceBundleWithDefaults + +`func NewResourceBundleWithDefaults() *ResourceBundle` + +NewResourceBundleWithDefaults instantiates a new ResourceBundle object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ResourceBundle) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ResourceBundle) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ResourceBundle) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *ResourceBundle) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetKind + +`func (o *ResourceBundle) GetKind() string` + +GetKind returns the Kind field if non-nil, zero value otherwise. + +### GetKindOk + +`func (o *ResourceBundle) GetKindOk() (*string, bool)` + +GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKind + +`func (o *ResourceBundle) SetKind(v string)` + +SetKind sets Kind field to given value. + +### HasKind + +`func (o *ResourceBundle) HasKind() bool` + +HasKind returns a boolean if a field has been set. + +### GetHref + +`func (o *ResourceBundle) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *ResourceBundle) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *ResourceBundle) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *ResourceBundle) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetName + +`func (o *ResourceBundle) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ResourceBundle) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ResourceBundle) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ResourceBundle) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetConsumerName + +`func (o *ResourceBundle) GetConsumerName() string` + +GetConsumerName returns the ConsumerName field if non-nil, zero value otherwise. + +### GetConsumerNameOk + +`func (o *ResourceBundle) GetConsumerNameOk() (*string, bool)` + +GetConsumerNameOk returns a tuple with the ConsumerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConsumerName + +`func (o *ResourceBundle) SetConsumerName(v string)` + +SetConsumerName sets ConsumerName field to given value. + +### HasConsumerName + +`func (o *ResourceBundle) HasConsumerName() bool` + +HasConsumerName returns a boolean if a field has been set. + +### GetVersion + +`func (o *ResourceBundle) GetVersion() int32` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *ResourceBundle) GetVersionOk() (*int32, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *ResourceBundle) SetVersion(v int32)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *ResourceBundle) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *ResourceBundle) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ResourceBundle) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ResourceBundle) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *ResourceBundle) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *ResourceBundle) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *ResourceBundle) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *ResourceBundle) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *ResourceBundle) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetManifests + +`func (o *ResourceBundle) GetManifests() []map[string]interface{}` + +GetManifests returns the Manifests field if non-nil, zero value otherwise. + +### GetManifestsOk + +`func (o *ResourceBundle) GetManifestsOk() (*[]map[string]interface{}, bool)` + +GetManifestsOk returns a tuple with the Manifests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManifests + +`func (o *ResourceBundle) SetManifests(v []map[string]interface{})` + +SetManifests sets Manifests field to given value. + +### HasManifests + +`func (o *ResourceBundle) HasManifests() bool` + +HasManifests returns a boolean if a field has been set. + +### GetDeleteOption + +`func (o *ResourceBundle) GetDeleteOption() map[string]interface{}` + +GetDeleteOption returns the DeleteOption field if non-nil, zero value otherwise. + +### GetDeleteOptionOk + +`func (o *ResourceBundle) GetDeleteOptionOk() (*map[string]interface{}, bool)` + +GetDeleteOptionOk returns a tuple with the DeleteOption field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeleteOption + +`func (o *ResourceBundle) SetDeleteOption(v map[string]interface{})` + +SetDeleteOption sets DeleteOption field to given value. + +### HasDeleteOption + +`func (o *ResourceBundle) HasDeleteOption() bool` + +HasDeleteOption returns a boolean if a field has been set. + +### GetManifestConfigs + +`func (o *ResourceBundle) GetManifestConfigs() []map[string]interface{}` + +GetManifestConfigs returns the ManifestConfigs field if non-nil, zero value otherwise. + +### GetManifestConfigsOk + +`func (o *ResourceBundle) GetManifestConfigsOk() (*[]map[string]interface{}, bool)` + +GetManifestConfigsOk returns a tuple with the ManifestConfigs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManifestConfigs + +`func (o *ResourceBundle) SetManifestConfigs(v []map[string]interface{})` + +SetManifestConfigs sets ManifestConfigs field to given value. + +### HasManifestConfigs + +`func (o *ResourceBundle) HasManifestConfigs() bool` + +HasManifestConfigs returns a boolean if a field has been set. + +### GetStatus + +`func (o *ResourceBundle) GetStatus() map[string]interface{}` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ResourceBundle) GetStatusOk() (*map[string]interface{}, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ResourceBundle) SetStatus(v map[string]interface{})` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *ResourceBundle) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/api/openapi/docs/ResourceBundleAllOf.md b/pkg/api/openapi/docs/ResourceBundleAllOf.md new file mode 100644 index 00000000..127f8b4c --- /dev/null +++ b/pkg/api/openapi/docs/ResourceBundleAllOf.md @@ -0,0 +1,264 @@ +# ResourceBundleAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**ConsumerName** | Pointer to **string** | | [optional] +**Version** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Manifests** | Pointer to **[]map[string]interface{}** | | [optional] +**DeleteOption** | Pointer to **map[string]interface{}** | | [optional] +**ManifestConfigs** | Pointer to **[]map[string]interface{}** | | [optional] +**Status** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewResourceBundleAllOf + +`func NewResourceBundleAllOf() *ResourceBundleAllOf` + +NewResourceBundleAllOf instantiates a new ResourceBundleAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceBundleAllOfWithDefaults + +`func NewResourceBundleAllOfWithDefaults() *ResourceBundleAllOf` + +NewResourceBundleAllOfWithDefaults instantiates a new ResourceBundleAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ResourceBundleAllOf) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ResourceBundleAllOf) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ResourceBundleAllOf) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ResourceBundleAllOf) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetConsumerName + +`func (o *ResourceBundleAllOf) GetConsumerName() string` + +GetConsumerName returns the ConsumerName field if non-nil, zero value otherwise. + +### GetConsumerNameOk + +`func (o *ResourceBundleAllOf) GetConsumerNameOk() (*string, bool)` + +GetConsumerNameOk returns a tuple with the ConsumerName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConsumerName + +`func (o *ResourceBundleAllOf) SetConsumerName(v string)` + +SetConsumerName sets ConsumerName field to given value. + +### HasConsumerName + +`func (o *ResourceBundleAllOf) HasConsumerName() bool` + +HasConsumerName returns a boolean if a field has been set. + +### GetVersion + +`func (o *ResourceBundleAllOf) GetVersion() int32` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *ResourceBundleAllOf) GetVersionOk() (*int32, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *ResourceBundleAllOf) SetVersion(v int32)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *ResourceBundleAllOf) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *ResourceBundleAllOf) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *ResourceBundleAllOf) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *ResourceBundleAllOf) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *ResourceBundleAllOf) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *ResourceBundleAllOf) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *ResourceBundleAllOf) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *ResourceBundleAllOf) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *ResourceBundleAllOf) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetManifests + +`func (o *ResourceBundleAllOf) GetManifests() []map[string]interface{}` + +GetManifests returns the Manifests field if non-nil, zero value otherwise. + +### GetManifestsOk + +`func (o *ResourceBundleAllOf) GetManifestsOk() (*[]map[string]interface{}, bool)` + +GetManifestsOk returns a tuple with the Manifests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManifests + +`func (o *ResourceBundleAllOf) SetManifests(v []map[string]interface{})` + +SetManifests sets Manifests field to given value. + +### HasManifests + +`func (o *ResourceBundleAllOf) HasManifests() bool` + +HasManifests returns a boolean if a field has been set. + +### GetDeleteOption + +`func (o *ResourceBundleAllOf) GetDeleteOption() map[string]interface{}` + +GetDeleteOption returns the DeleteOption field if non-nil, zero value otherwise. + +### GetDeleteOptionOk + +`func (o *ResourceBundleAllOf) GetDeleteOptionOk() (*map[string]interface{}, bool)` + +GetDeleteOptionOk returns a tuple with the DeleteOption field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeleteOption + +`func (o *ResourceBundleAllOf) SetDeleteOption(v map[string]interface{})` + +SetDeleteOption sets DeleteOption field to given value. + +### HasDeleteOption + +`func (o *ResourceBundleAllOf) HasDeleteOption() bool` + +HasDeleteOption returns a boolean if a field has been set. + +### GetManifestConfigs + +`func (o *ResourceBundleAllOf) GetManifestConfigs() []map[string]interface{}` + +GetManifestConfigs returns the ManifestConfigs field if non-nil, zero value otherwise. + +### GetManifestConfigsOk + +`func (o *ResourceBundleAllOf) GetManifestConfigsOk() (*[]map[string]interface{}, bool)` + +GetManifestConfigsOk returns a tuple with the ManifestConfigs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManifestConfigs + +`func (o *ResourceBundleAllOf) SetManifestConfigs(v []map[string]interface{})` + +SetManifestConfigs sets ManifestConfigs field to given value. + +### HasManifestConfigs + +`func (o *ResourceBundleAllOf) HasManifestConfigs() bool` + +HasManifestConfigs returns a boolean if a field has been set. + +### GetStatus + +`func (o *ResourceBundleAllOf) GetStatus() map[string]interface{}` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *ResourceBundleAllOf) GetStatusOk() (*map[string]interface{}, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *ResourceBundleAllOf) SetStatus(v map[string]interface{})` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *ResourceBundleAllOf) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/api/openapi/docs/ResourceBundleList.md b/pkg/api/openapi/docs/ResourceBundleList.md new file mode 100644 index 00000000..9163ce34 --- /dev/null +++ b/pkg/api/openapi/docs/ResourceBundleList.md @@ -0,0 +1,135 @@ +# ResourceBundleList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | +**Page** | **int32** | | +**Size** | **int32** | | +**Total** | **int32** | | +**Items** | [**[]ResourceBundle**](ResourceBundle.md) | | + +## Methods + +### NewResourceBundleList + +`func NewResourceBundleList(kind string, page int32, size int32, total int32, items []ResourceBundle, ) *ResourceBundleList` + +NewResourceBundleList instantiates a new ResourceBundleList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceBundleListWithDefaults + +`func NewResourceBundleListWithDefaults() *ResourceBundleList` + +NewResourceBundleListWithDefaults instantiates a new ResourceBundleList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKind + +`func (o *ResourceBundleList) GetKind() string` + +GetKind returns the Kind field if non-nil, zero value otherwise. + +### GetKindOk + +`func (o *ResourceBundleList) GetKindOk() (*string, bool)` + +GetKindOk returns a tuple with the Kind field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKind + +`func (o *ResourceBundleList) SetKind(v string)` + +SetKind sets Kind field to given value. + + +### GetPage + +`func (o *ResourceBundleList) GetPage() int32` + +GetPage returns the Page field if non-nil, zero value otherwise. + +### GetPageOk + +`func (o *ResourceBundleList) GetPageOk() (*int32, bool)` + +GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPage + +`func (o *ResourceBundleList) SetPage(v int32)` + +SetPage sets Page field to given value. + + +### GetSize + +`func (o *ResourceBundleList) GetSize() int32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *ResourceBundleList) GetSizeOk() (*int32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *ResourceBundleList) SetSize(v int32)` + +SetSize sets Size field to given value. + + +### GetTotal + +`func (o *ResourceBundleList) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ResourceBundleList) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ResourceBundleList) SetTotal(v int32)` + +SetTotal sets Total field to given value. + + +### GetItems + +`func (o *ResourceBundleList) GetItems() []ResourceBundle` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ResourceBundleList) GetItemsOk() (*[]ResourceBundle, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ResourceBundleList) SetItems(v []ResourceBundle)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/api/openapi/docs/ResourceBundleListAllOf.md b/pkg/api/openapi/docs/ResourceBundleListAllOf.md new file mode 100644 index 00000000..0e4f556e --- /dev/null +++ b/pkg/api/openapi/docs/ResourceBundleListAllOf.md @@ -0,0 +1,56 @@ +# ResourceBundleListAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Items** | Pointer to [**[]ResourceBundle**](ResourceBundle.md) | | [optional] + +## Methods + +### NewResourceBundleListAllOf + +`func NewResourceBundleListAllOf() *ResourceBundleListAllOf` + +NewResourceBundleListAllOf instantiates a new ResourceBundleListAllOf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceBundleListAllOfWithDefaults + +`func NewResourceBundleListAllOfWithDefaults() *ResourceBundleListAllOf` + +NewResourceBundleListAllOfWithDefaults instantiates a new ResourceBundleListAllOf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItems + +`func (o *ResourceBundleListAllOf) GetItems() []ResourceBundle` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *ResourceBundleListAllOf) GetItemsOk() (*[]ResourceBundle, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *ResourceBundleListAllOf) SetItems(v []ResourceBundle)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *ResourceBundleListAllOf) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pkg/api/openapi/model_resource_bundle.go b/pkg/api/openapi/model_resource_bundle.go new file mode 100644 index 00000000..e363b5c5 --- /dev/null +++ b/pkg/api/openapi/model_resource_bundle.go @@ -0,0 +1,521 @@ +/* +maestro Service API + +maestro Service API + +API version: 0.0.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "time" +) + +// checks if the ResourceBundle type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourceBundle{} + +// ResourceBundle struct for ResourceBundle +type ResourceBundle struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Href *string `json:"href,omitempty"` + Name *string `json:"name,omitempty"` + ConsumerName *string `json:"consumer_name,omitempty"` + Version *int32 `json:"version,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Manifests []map[string]interface{} `json:"manifests,omitempty"` + DeleteOption map[string]interface{} `json:"delete_option,omitempty"` + ManifestConfigs []map[string]interface{} `json:"manifest_configs,omitempty"` + Status map[string]interface{} `json:"status,omitempty"` +} + +// NewResourceBundle instantiates a new ResourceBundle object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceBundle() *ResourceBundle { + this := ResourceBundle{} + return &this +} + +// NewResourceBundleWithDefaults instantiates a new ResourceBundle object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceBundleWithDefaults() *ResourceBundle { + this := ResourceBundle{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourceBundle) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ResourceBundle) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ResourceBundle) SetId(v string) { + o.Id = &v +} + +// GetKind returns the Kind field value if set, zero value otherwise. +func (o *ResourceBundle) GetKind() string { + if o == nil || IsNil(o.Kind) { + var ret string + return ret + } + return *o.Kind +} + +// GetKindOk returns a tuple with the Kind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetKindOk() (*string, bool) { + if o == nil || IsNil(o.Kind) { + return nil, false + } + return o.Kind, true +} + +// HasKind returns a boolean if a field has been set. +func (o *ResourceBundle) HasKind() bool { + if o != nil && !IsNil(o.Kind) { + return true + } + + return false +} + +// SetKind gets a reference to the given string and assigns it to the Kind field. +func (o *ResourceBundle) SetKind(v string) { + o.Kind = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *ResourceBundle) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *ResourceBundle) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *ResourceBundle) SetHref(v string) { + o.Href = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ResourceBundle) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ResourceBundle) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ResourceBundle) SetName(v string) { + o.Name = &v +} + +// GetConsumerName returns the ConsumerName field value if set, zero value otherwise. +func (o *ResourceBundle) GetConsumerName() string { + if o == nil || IsNil(o.ConsumerName) { + var ret string + return ret + } + return *o.ConsumerName +} + +// GetConsumerNameOk returns a tuple with the ConsumerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetConsumerNameOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerName) { + return nil, false + } + return o.ConsumerName, true +} + +// HasConsumerName returns a boolean if a field has been set. +func (o *ResourceBundle) HasConsumerName() bool { + if o != nil && !IsNil(o.ConsumerName) { + return true + } + + return false +} + +// SetConsumerName gets a reference to the given string and assigns it to the ConsumerName field. +func (o *ResourceBundle) SetConsumerName(v string) { + o.ConsumerName = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ResourceBundle) GetVersion() int32 { + if o == nil || IsNil(o.Version) { + var ret int32 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetVersionOk() (*int32, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ResourceBundle) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given int32 and assigns it to the Version field. +func (o *ResourceBundle) SetVersion(v int32) { + o.Version = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ResourceBundle) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ResourceBundle) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ResourceBundle) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ResourceBundle) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ResourceBundle) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ResourceBundle) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetManifests returns the Manifests field value if set, zero value otherwise. +func (o *ResourceBundle) GetManifests() []map[string]interface{} { + if o == nil || IsNil(o.Manifests) { + var ret []map[string]interface{} + return ret + } + return o.Manifests +} + +// GetManifestsOk returns a tuple with the Manifests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetManifestsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Manifests) { + return nil, false + } + return o.Manifests, true +} + +// HasManifests returns a boolean if a field has been set. +func (o *ResourceBundle) HasManifests() bool { + if o != nil && !IsNil(o.Manifests) { + return true + } + + return false +} + +// SetManifests gets a reference to the given []map[string]interface{} and assigns it to the Manifests field. +func (o *ResourceBundle) SetManifests(v []map[string]interface{}) { + o.Manifests = v +} + +// GetDeleteOption returns the DeleteOption field value if set, zero value otherwise. +func (o *ResourceBundle) GetDeleteOption() map[string]interface{} { + if o == nil || IsNil(o.DeleteOption) { + var ret map[string]interface{} + return ret + } + return o.DeleteOption +} + +// GetDeleteOptionOk returns a tuple with the DeleteOption field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetDeleteOptionOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.DeleteOption) { + return map[string]interface{}{}, false + } + return o.DeleteOption, true +} + +// HasDeleteOption returns a boolean if a field has been set. +func (o *ResourceBundle) HasDeleteOption() bool { + if o != nil && !IsNil(o.DeleteOption) { + return true + } + + return false +} + +// SetDeleteOption gets a reference to the given map[string]interface{} and assigns it to the DeleteOption field. +func (o *ResourceBundle) SetDeleteOption(v map[string]interface{}) { + o.DeleteOption = v +} + +// GetManifestConfigs returns the ManifestConfigs field value if set, zero value otherwise. +func (o *ResourceBundle) GetManifestConfigs() []map[string]interface{} { + if o == nil || IsNil(o.ManifestConfigs) { + var ret []map[string]interface{} + return ret + } + return o.ManifestConfigs +} + +// GetManifestConfigsOk returns a tuple with the ManifestConfigs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetManifestConfigsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.ManifestConfigs) { + return nil, false + } + return o.ManifestConfigs, true +} + +// HasManifestConfigs returns a boolean if a field has been set. +func (o *ResourceBundle) HasManifestConfigs() bool { + if o != nil && !IsNil(o.ManifestConfigs) { + return true + } + + return false +} + +// SetManifestConfigs gets a reference to the given []map[string]interface{} and assigns it to the ManifestConfigs field. +func (o *ResourceBundle) SetManifestConfigs(v []map[string]interface{}) { + o.ManifestConfigs = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ResourceBundle) GetStatus() map[string]interface{} { + if o == nil || IsNil(o.Status) { + var ret map[string]interface{} + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundle) GetStatusOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Status) { + return map[string]interface{}{}, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ResourceBundle) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given map[string]interface{} and assigns it to the Status field. +func (o *ResourceBundle) SetStatus(v map[string]interface{}) { + o.Status = v +} + +func (o ResourceBundle) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceBundle) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Kind) { + toSerialize["kind"] = o.Kind + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ConsumerName) { + toSerialize["consumer_name"] = o.ConsumerName + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Manifests) { + toSerialize["manifests"] = o.Manifests + } + if !IsNil(o.DeleteOption) { + toSerialize["delete_option"] = o.DeleteOption + } + if !IsNil(o.ManifestConfigs) { + toSerialize["manifest_configs"] = o.ManifestConfigs + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableResourceBundle struct { + value *ResourceBundle + isSet bool +} + +func (v NullableResourceBundle) Get() *ResourceBundle { + return v.value +} + +func (v *NullableResourceBundle) Set(val *ResourceBundle) { + v.value = val + v.isSet = true +} + +func (v NullableResourceBundle) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceBundle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceBundle(val *ResourceBundle) *NullableResourceBundle { + return &NullableResourceBundle{value: val, isSet: true} +} + +func (v NullableResourceBundle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceBundle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/api/openapi/model_resource_bundle_all_of.go b/pkg/api/openapi/model_resource_bundle_all_of.go new file mode 100644 index 00000000..88fc764a --- /dev/null +++ b/pkg/api/openapi/model_resource_bundle_all_of.go @@ -0,0 +1,413 @@ +/* +maestro Service API + +maestro Service API + +API version: 0.0.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "time" +) + +// checks if the ResourceBundleAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourceBundleAllOf{} + +// ResourceBundleAllOf struct for ResourceBundleAllOf +type ResourceBundleAllOf struct { + Name *string `json:"name,omitempty"` + ConsumerName *string `json:"consumer_name,omitempty"` + Version *int32 `json:"version,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Manifests []map[string]interface{} `json:"manifests,omitempty"` + DeleteOption map[string]interface{} `json:"delete_option,omitempty"` + ManifestConfigs []map[string]interface{} `json:"manifest_configs,omitempty"` + Status map[string]interface{} `json:"status,omitempty"` +} + +// NewResourceBundleAllOf instantiates a new ResourceBundleAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceBundleAllOf() *ResourceBundleAllOf { + this := ResourceBundleAllOf{} + return &this +} + +// NewResourceBundleAllOfWithDefaults instantiates a new ResourceBundleAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceBundleAllOfWithDefaults() *ResourceBundleAllOf { + this := ResourceBundleAllOf{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ResourceBundleAllOf) SetName(v string) { + o.Name = &v +} + +// GetConsumerName returns the ConsumerName field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetConsumerName() string { + if o == nil || IsNil(o.ConsumerName) { + var ret string + return ret + } + return *o.ConsumerName +} + +// GetConsumerNameOk returns a tuple with the ConsumerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetConsumerNameOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerName) { + return nil, false + } + return o.ConsumerName, true +} + +// HasConsumerName returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasConsumerName() bool { + if o != nil && !IsNil(o.ConsumerName) { + return true + } + + return false +} + +// SetConsumerName gets a reference to the given string and assigns it to the ConsumerName field. +func (o *ResourceBundleAllOf) SetConsumerName(v string) { + o.ConsumerName = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetVersion() int32 { + if o == nil || IsNil(o.Version) { + var ret int32 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetVersionOk() (*int32, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given int32 and assigns it to the Version field. +func (o *ResourceBundleAllOf) SetVersion(v int32) { + o.Version = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ResourceBundleAllOf) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ResourceBundleAllOf) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetManifests returns the Manifests field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetManifests() []map[string]interface{} { + if o == nil || IsNil(o.Manifests) { + var ret []map[string]interface{} + return ret + } + return o.Manifests +} + +// GetManifestsOk returns a tuple with the Manifests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetManifestsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Manifests) { + return nil, false + } + return o.Manifests, true +} + +// HasManifests returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasManifests() bool { + if o != nil && !IsNil(o.Manifests) { + return true + } + + return false +} + +// SetManifests gets a reference to the given []map[string]interface{} and assigns it to the Manifests field. +func (o *ResourceBundleAllOf) SetManifests(v []map[string]interface{}) { + o.Manifests = v +} + +// GetDeleteOption returns the DeleteOption field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetDeleteOption() map[string]interface{} { + if o == nil || IsNil(o.DeleteOption) { + var ret map[string]interface{} + return ret + } + return o.DeleteOption +} + +// GetDeleteOptionOk returns a tuple with the DeleteOption field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetDeleteOptionOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.DeleteOption) { + return map[string]interface{}{}, false + } + return o.DeleteOption, true +} + +// HasDeleteOption returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasDeleteOption() bool { + if o != nil && !IsNil(o.DeleteOption) { + return true + } + + return false +} + +// SetDeleteOption gets a reference to the given map[string]interface{} and assigns it to the DeleteOption field. +func (o *ResourceBundleAllOf) SetDeleteOption(v map[string]interface{}) { + o.DeleteOption = v +} + +// GetManifestConfigs returns the ManifestConfigs field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetManifestConfigs() []map[string]interface{} { + if o == nil || IsNil(o.ManifestConfigs) { + var ret []map[string]interface{} + return ret + } + return o.ManifestConfigs +} + +// GetManifestConfigsOk returns a tuple with the ManifestConfigs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetManifestConfigsOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.ManifestConfigs) { + return nil, false + } + return o.ManifestConfigs, true +} + +// HasManifestConfigs returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasManifestConfigs() bool { + if o != nil && !IsNil(o.ManifestConfigs) { + return true + } + + return false +} + +// SetManifestConfigs gets a reference to the given []map[string]interface{} and assigns it to the ManifestConfigs field. +func (o *ResourceBundleAllOf) SetManifestConfigs(v []map[string]interface{}) { + o.ManifestConfigs = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ResourceBundleAllOf) GetStatus() map[string]interface{} { + if o == nil || IsNil(o.Status) { + var ret map[string]interface{} + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleAllOf) GetStatusOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Status) { + return map[string]interface{}{}, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *ResourceBundleAllOf) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given map[string]interface{} and assigns it to the Status field. +func (o *ResourceBundleAllOf) SetStatus(v map[string]interface{}) { + o.Status = v +} + +func (o ResourceBundleAllOf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceBundleAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ConsumerName) { + toSerialize["consumer_name"] = o.ConsumerName + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Manifests) { + toSerialize["manifests"] = o.Manifests + } + if !IsNil(o.DeleteOption) { + toSerialize["delete_option"] = o.DeleteOption + } + if !IsNil(o.ManifestConfigs) { + toSerialize["manifest_configs"] = o.ManifestConfigs + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableResourceBundleAllOf struct { + value *ResourceBundleAllOf + isSet bool +} + +func (v NullableResourceBundleAllOf) Get() *ResourceBundleAllOf { + return v.value +} + +func (v *NullableResourceBundleAllOf) Set(val *ResourceBundleAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableResourceBundleAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceBundleAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceBundleAllOf(val *ResourceBundleAllOf) *NullableResourceBundleAllOf { + return &NullableResourceBundleAllOf{value: val, isSet: true} +} + +func (v NullableResourceBundleAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceBundleAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/api/openapi/model_resource_bundle_list.go b/pkg/api/openapi/model_resource_bundle_list.go new file mode 100644 index 00000000..dfa1cd29 --- /dev/null +++ b/pkg/api/openapi/model_resource_bundle_list.go @@ -0,0 +1,223 @@ +/* +maestro Service API + +maestro Service API + +API version: 0.0.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the ResourceBundleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourceBundleList{} + +// ResourceBundleList struct for ResourceBundleList +type ResourceBundleList struct { + Kind string `json:"kind"` + Page int32 `json:"page"` + Size int32 `json:"size"` + Total int32 `json:"total"` + Items []ResourceBundle `json:"items"` +} + +// NewResourceBundleList instantiates a new ResourceBundleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceBundleList(kind string, page int32, size int32, total int32, items []ResourceBundle) *ResourceBundleList { + this := ResourceBundleList{} + this.Kind = kind + this.Page = page + this.Size = size + this.Total = total + this.Items = items + return &this +} + +// NewResourceBundleListWithDefaults instantiates a new ResourceBundleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceBundleListWithDefaults() *ResourceBundleList { + this := ResourceBundleList{} + return &this +} + +// GetKind returns the Kind field value +func (o *ResourceBundleList) GetKind() string { + if o == nil { + var ret string + return ret + } + + return o.Kind +} + +// GetKindOk returns a tuple with the Kind field value +// and a boolean to check if the value has been set. +func (o *ResourceBundleList) GetKindOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Kind, true +} + +// SetKind sets field value +func (o *ResourceBundleList) SetKind(v string) { + o.Kind = v +} + +// GetPage returns the Page field value +func (o *ResourceBundleList) GetPage() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Page +} + +// GetPageOk returns a tuple with the Page field value +// and a boolean to check if the value has been set. +func (o *ResourceBundleList) GetPageOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Page, true +} + +// SetPage sets field value +func (o *ResourceBundleList) SetPage(v int32) { + o.Page = v +} + +// GetSize returns the Size field value +func (o *ResourceBundleList) GetSize() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ResourceBundleList) GetSizeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ResourceBundleList) SetSize(v int32) { + o.Size = v +} + +// GetTotal returns the Total field value +func (o *ResourceBundleList) GetTotal() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Total +} + +// GetTotalOk returns a tuple with the Total field value +// and a boolean to check if the value has been set. +func (o *ResourceBundleList) GetTotalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Total, true +} + +// SetTotal sets field value +func (o *ResourceBundleList) SetTotal(v int32) { + o.Total = v +} + +// GetItems returns the Items field value +func (o *ResourceBundleList) GetItems() []ResourceBundle { + if o == nil { + var ret []ResourceBundle + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ResourceBundleList) GetItemsOk() ([]ResourceBundle, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ResourceBundleList) SetItems(v []ResourceBundle) { + o.Items = v +} + +func (o ResourceBundleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceBundleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["kind"] = o.Kind + toSerialize["page"] = o.Page + toSerialize["size"] = o.Size + toSerialize["total"] = o.Total + toSerialize["items"] = o.Items + return toSerialize, nil +} + +type NullableResourceBundleList struct { + value *ResourceBundleList + isSet bool +} + +func (v NullableResourceBundleList) Get() *ResourceBundleList { + return v.value +} + +func (v *NullableResourceBundleList) Set(val *ResourceBundleList) { + v.value = val + v.isSet = true +} + +func (v NullableResourceBundleList) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceBundleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceBundleList(val *ResourceBundleList) *NullableResourceBundleList { + return &NullableResourceBundleList{value: val, isSet: true} +} + +func (v NullableResourceBundleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceBundleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/api/openapi/model_resource_bundle_list_all_of.go b/pkg/api/openapi/model_resource_bundle_list_all_of.go new file mode 100644 index 00000000..d8404785 --- /dev/null +++ b/pkg/api/openapi/model_resource_bundle_list_all_of.go @@ -0,0 +1,124 @@ +/* +maestro Service API + +maestro Service API + +API version: 0.0.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the ResourceBundleListAllOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourceBundleListAllOf{} + +// ResourceBundleListAllOf struct for ResourceBundleListAllOf +type ResourceBundleListAllOf struct { + Items []ResourceBundle `json:"items,omitempty"` +} + +// NewResourceBundleListAllOf instantiates a new ResourceBundleListAllOf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResourceBundleListAllOf() *ResourceBundleListAllOf { + this := ResourceBundleListAllOf{} + return &this +} + +// NewResourceBundleListAllOfWithDefaults instantiates a new ResourceBundleListAllOf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceBundleListAllOfWithDefaults() *ResourceBundleListAllOf { + this := ResourceBundleListAllOf{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ResourceBundleListAllOf) GetItems() []ResourceBundle { + if o == nil || IsNil(o.Items) { + var ret []ResourceBundle + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ResourceBundleListAllOf) GetItemsOk() ([]ResourceBundle, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ResourceBundleListAllOf) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []ResourceBundle and assigns it to the Items field. +func (o *ResourceBundleListAllOf) SetItems(v []ResourceBundle) { + o.Items = v +} + +func (o ResourceBundleListAllOf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourceBundleListAllOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableResourceBundleListAllOf struct { + value *ResourceBundleListAllOf + isSet bool +} + +func (v NullableResourceBundleListAllOf) Get() *ResourceBundleListAllOf { + return v.value +} + +func (v *NullableResourceBundleListAllOf) Set(val *ResourceBundleListAllOf) { + v.value = val + v.isSet = true +} + +func (v NullableResourceBundleListAllOf) IsSet() bool { + return v.isSet +} + +func (v *NullableResourceBundleListAllOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourceBundleListAllOf(val *ResourceBundleListAllOf) *NullableResourceBundleListAllOf { + return &NullableResourceBundleListAllOf{value: val, isSet: true} +} + +func (v NullableResourceBundleListAllOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourceBundleListAllOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/pkg/api/presenters/resource.go b/pkg/api/presenters/resource.go index 0197281f..ae047394 100755 --- a/pkg/api/presenters/resource.go +++ b/pkg/api/presenters/resource.go @@ -1,6 +1,8 @@ package presenters import ( + "encoding/json" + "gorm.io/datatypes" "github.com/openshift-online/maestro/pkg/api" @@ -60,3 +62,64 @@ func PresentResource(resource *api.Resource) (*openapi.Resource, error) { Status: status, }, nil } + +// PresentResourceBundle converts a resource from the API to the openapi representation. +func PresentResourceBundle(resource *api.Resource) (*openapi.ResourceBundle, error) { + manifestBundle, err := api.DecodeManifestBundle(resource.Manifest) + if err != nil { + return nil, err + } + status, err := api.DecodeStatus(resource.Status) + if err != nil { + return nil, err + } + reference := PresentReference(resource.ID, resource) + manifests := make([]map[string]interface{}, 0, len(manifestBundle.Manifests)) + for _, manifest := range manifestBundle.Manifests { + mbytes, err := json.Marshal(manifest) + if err != nil { + return nil, err + } + m := map[string]interface{}{} + if err := json.Unmarshal(mbytes, &m); err != nil { + return nil, err + } + manifests = append(manifests, m) + } + deleteOption := map[string]interface{}{} + if manifestBundle.DeleteOption != nil { + dbytes, err := json.Marshal(manifestBundle.DeleteOption) + if err != nil { + return nil, err + } + if err := json.Unmarshal(dbytes, &deleteOption); err != nil { + return nil, err + } + } + manifestConfigs := make([]map[string]interface{}, 0, len(manifestBundle.ManifestConfigs)) + for _, manifestConfig := range manifestBundle.ManifestConfigs { + mbytes, err := json.Marshal(manifestConfig) + if err != nil { + return nil, err + } + m := map[string]interface{}{} + if err := json.Unmarshal(mbytes, &m); err != nil { + return nil, err + } + manifestConfigs = append(manifestConfigs, m) + } + return &openapi.ResourceBundle{ + Id: reference.Id, + Kind: reference.Kind, + Href: reference.Href, + Name: openapi.PtrString(resource.Name), + ConsumerName: openapi.PtrString(resource.ConsumerName), + Version: openapi.PtrInt32(resource.Version), + CreatedAt: openapi.PtrTime(resource.CreatedAt), + UpdatedAt: openapi.PtrTime(resource.UpdatedAt), + Manifests: manifests, + DeleteOption: deleteOption, + ManifestConfigs: manifestConfigs, + Status: status, + }, nil +} diff --git a/pkg/api/resource_types.go b/pkg/api/resource_types.go index 52c67d5d..00adcc39 100755 --- a/pkg/api/resource_types.go +++ b/pkg/api/resource_types.go @@ -255,8 +255,8 @@ func DecodeDeleteOption(deleteOption datatypes.JSONMap) (map[string]interface{}, } // DecodeManifestBundle converts a CloudEvent JSONMap representation of a list of resource manifest -// into a list of resource manifest (map[string]interface{}). -func DecodeManifestBundle(manifest datatypes.JSONMap) ([]map[string]interface{}, error) { +// into manifest bundle payload. +func DecodeManifestBundle(manifest datatypes.JSONMap) (*workpayload.ManifestBundle, error) { if len(manifest) == 0 { return nil, nil } @@ -271,7 +271,22 @@ func DecodeManifestBundle(manifest datatypes.JSONMap) ([]map[string]interface{}, return nil, fmt.Errorf("failed to decode cloudevent payload as resource manifest bundle: %v", err) } - manifests := make([]map[string]interface{}, 0, len(eventPayload.Manifests)) + return eventPayload, nil +} + +// DecodeManifestBundleToObjects converts a CloudEvent JSONMap representation of a list of resource manifest +// into a list of resource object (map[string]interface{}). +func DecodeManifestBundleToObjects(manifest datatypes.JSONMap) ([]map[string]interface{}, error) { + if len(manifest) == 0 { + return nil, nil + } + + eventPayload, err := DecodeManifestBundle(manifest) + if err != nil { + return nil, err + } + + objects := make([]map[string]interface{}, 0, len(eventPayload.Manifests)) for _, m := range eventPayload.Manifests { if len(m.Raw) == 0 { return nil, fmt.Errorf("manifest in bundle is empty") @@ -281,10 +296,10 @@ func DecodeManifestBundle(manifest datatypes.JSONMap) ([]map[string]interface{}, if err := json.Unmarshal(m.Raw, obj); err != nil { return nil, fmt.Errorf("failed to unmarshal manifest in bundle: %v", err) } - manifests = append(manifests, *obj) + objects = append(objects, *obj) } - return manifests, nil + return objects, nil } // DecodeStatus converts a CloudEvent JSONMap representation of a resource status diff --git a/pkg/api/resource_types_test.go b/pkg/api/resource_types_test.go index a667ad93..9ff66534 100644 --- a/pkg/api/resource_types_test.go +++ b/pkg/api/resource_types_test.go @@ -122,20 +122,20 @@ func TestDecodeManifestBundle(t *testing.T) { } for _, c := range cases { t.Run(c.name, func(t *testing.T) { - gotManifests, err := DecodeManifestBundle(c.input) + gotObjects, err := DecodeManifestBundleToObjects(c.input) if err != nil { if err.Error() != c.expectedErrorMsg { t.Errorf("expected %#v but got: %#v", c.expectedErrorMsg, err) } return } - if len(gotManifests) != len(c.expected) { - t.Errorf("expected %d resource in manifest bundle but got: %d", len(c.expected), len(gotManifests)) + if len(gotObjects) != len(c.expected) { + t.Errorf("expected %d resource in manifest bundle but got: %d", len(c.expected), len(gotObjects)) return } for i, expected := range c.expected { - if !equality.Semantic.DeepDerivative(expected, gotManifests[i]) { - t.Errorf("expected %#v but got: %#v", expected, gotManifests[i]) + if !equality.Semantic.DeepDerivative(expected, gotObjects[i]) { + t.Errorf("expected %#v but got: %#v", expected, gotObjects[i]) } } }) diff --git a/pkg/dao/mocks/resource.go b/pkg/dao/mocks/resource.go index ca6a5f9d..870dc56a 100755 --- a/pkg/dao/mocks/resource.go +++ b/pkg/dao/mocks/resource.go @@ -30,6 +30,10 @@ func (d *resourceDaoMock) Get(ctx context.Context, id string) (*api.Resource, er return nil, gorm.ErrRecordNotFound } +func (d *resourceDaoMock) GetBundle(ctx context.Context, id string) (*api.Resource, error) { + return nil, gorm.ErrRecordNotFound +} + func (d *resourceDaoMock) Create(ctx context.Context, resource *api.Resource) (*api.Resource, error) { d.resources = append(d.resources, resource) return resource, nil @@ -70,3 +74,7 @@ func (d *resourceDaoMock) FindBySource(ctx context.Context, source string) (api. func (d *resourceDaoMock) All(ctx context.Context) (api.ResourceList, error) { return d.resources, nil } + +func (d *resourceDaoMock) AllBundle(ctx context.Context) (api.ResourceList, error) { + return api.ResourceList{}, nil +} diff --git a/pkg/dao/resource.go b/pkg/dao/resource.go index 7f06abd0..ea84c511 100755 --- a/pkg/dao/resource.go +++ b/pkg/dao/resource.go @@ -11,6 +11,7 @@ import ( type ResourceDao interface { Get(ctx context.Context, id string) (*api.Resource, error) + GetBundle(ctx context.Context, id string) (*api.Resource, error) Create(ctx context.Context, resource *api.Resource) (*api.Resource, error) Update(ctx context.Context, resource *api.Resource) (*api.Resource, error) Delete(ctx context.Context, id string) error @@ -18,6 +19,7 @@ type ResourceDao interface { FindBySource(ctx context.Context, source string) (api.ResourceList, error) FindByConsumerName(ctx context.Context, consumerName string) (api.ResourceList, error) All(ctx context.Context) (api.ResourceList, error) + AllBundle(ctx context.Context) (api.ResourceList, error) } var _ ResourceDao = &sqlResourceDao{} @@ -39,6 +41,15 @@ func (d *sqlResourceDao) Get(ctx context.Context, id string) (*api.Resource, err return &resource, nil } +func (d *sqlResourceDao) GetBundle(ctx context.Context, id string) (*api.Resource, error) { + g2 := (*d.sessionFactory).New(ctx) + var resource api.Resource + if err := g2.Take(&resource, "id = ? AND type = ?", id, api.ResourceTypeBundle).Error; err != nil { + return nil, err + } + return &resource, nil +} + func (d *sqlResourceDao) Create(ctx context.Context, resource *api.Resource) (*api.Resource, error) { g2 := (*d.sessionFactory).New(ctx) if err := g2.Omit(clause.Associations).Create(resource).Error; err != nil { @@ -101,3 +112,12 @@ func (d *sqlResourceDao) All(ctx context.Context) (api.ResourceList, error) { } return resources, nil } + +func (d *sqlResourceDao) AllBundle(ctx context.Context) (api.ResourceList, error) { + g2 := (*d.sessionFactory).New(ctx) + resources := api.ResourceList{} + if err := g2.Where("type = ?", api.ResourceTypeBundle).Find(&resources).Error; err != nil { + return nil, err + } + return resources, nil +} diff --git a/pkg/handlers/resource.go b/pkg/handlers/resource.go index fd18e05d..4847376b 100755 --- a/pkg/handlers/resource.go +++ b/pkg/handlers/resource.go @@ -181,3 +181,69 @@ func (h resourceHandler) Delete(w http.ResponseWriter, r *http.Request) { } handleDelete(w, r, cfg, http.StatusNoContent) } + +func (h resourceHandler) GetBundle(w http.ResponseWriter, r *http.Request) { + cfg := &handlerConfig{ + Action: func() (interface{}, *errors.ServiceError) { + id := mux.Vars(r)["id"] + ctx := r.Context() + resource, serviceErr := h.resource.GetBundle(ctx, id) + if serviceErr != nil { + return nil, serviceErr + } + + resBundle, err := presenters.PresentResourceBundle(resource) + if err != nil { + return nil, errors.GeneralError("failed to present resource bundle: %s", err) + } + return resBundle, nil + }, + } + + handleGet(w, r, cfg) +} + +func (h resourceHandler) ListBundle(w http.ResponseWriter, r *http.Request) { + cfg := &handlerConfig{ + Action: func() (interface{}, *errors.ServiceError) { + ctx := r.Context() + + listArgs := services.NewListArguments(r.URL.Query()) + if listArgs.Search == "" { + listArgs.Search = fmt.Sprintf("type='%s'", api.ResourceTypeBundle) + } else { + listArgs.Search = fmt.Sprintf("%s and type='%s'", listArgs.Search, api.ResourceTypeBundle) + } + var resources []api.Resource + paging, serviceErr := h.generic.List(ctx, "username", listArgs, &resources) + if serviceErr != nil { + return nil, serviceErr + } + resourceBundleList := openapi.ResourceBundleList{ + Kind: *presenters.ObjectKind(resources), + Page: int32(paging.Page), + Size: int32(paging.Size), + Total: int32(paging.Total), + Items: []openapi.ResourceBundle{}, + } + + for _, resource := range resources { + converted, err := presenters.PresentResourceBundle(&resource) + if err != nil { + return nil, errors.GeneralError("failed to present resource: %s", err) + } + resourceBundleList.Items = append(resourceBundleList.Items, *converted) + } + if listArgs.Fields != nil { + filteredItems, err := presenters.SliceFilter(listArgs.Fields, resourceBundleList.Items) + if err != nil { + return nil, err + } + return filteredItems, nil + } + return resourceBundleList, nil + }, + } + + handleList(w, r, cfg) +} diff --git a/pkg/services/resource.go b/pkg/services/resource.go index ce6a03af..efbca013 100755 --- a/pkg/services/resource.go +++ b/pkg/services/resource.go @@ -19,12 +19,14 @@ import ( type ResourceService interface { Get(ctx context.Context, id string) (*api.Resource, *errors.ServiceError) + GetBundle(ctx context.Context, id string) (*api.Resource, *errors.ServiceError) Create(ctx context.Context, resource *api.Resource) (*api.Resource, *errors.ServiceError) Update(ctx context.Context, resource *api.Resource) (*api.Resource, *errors.ServiceError) UpdateStatus(ctx context.Context, resource *api.Resource) (*api.Resource, bool, *errors.ServiceError) MarkAsDeleting(ctx context.Context, id string) *errors.ServiceError Delete(ctx context.Context, id string) *errors.ServiceError All(ctx context.Context) (api.ResourceList, *errors.ServiceError) + AllBundle(ctx context.Context) (api.ResourceList, *errors.ServiceError) FindByIDs(ctx context.Context, ids []string) (api.ResourceList, *errors.ServiceError) FindBySource(ctx context.Context, source string) (api.ResourceList, *errors.ServiceError) @@ -55,6 +57,14 @@ func (s *sqlResourceService) Get(ctx context.Context, id string) (*api.Resource, return resource, nil } +func (s *sqlResourceService) GetBundle(ctx context.Context, id string) (*api.Resource, *errors.ServiceError) { + resource, err := s.resourceDao.GetBundle(ctx, id) + if err != nil { + return nil, handleGetError("Resource Bundle", "id", id, err) + } + return resource, nil +} + func (s *sqlResourceService) Create(ctx context.Context, resource *api.Resource) (*api.Resource, *errors.ServiceError) { if resource.Name != "" { if err := ValidateResourceName(resource); err != nil { @@ -257,6 +267,14 @@ func (s *sqlResourceService) All(ctx context.Context) (api.ResourceList, *errors return resources, nil } +func (s *sqlResourceService) AllBundle(ctx context.Context) (api.ResourceList, *errors.ServiceError) { + resources, err := s.resourceDao.AllBundle(ctx) + if err != nil { + return nil, errors.GeneralError("Unable to get all resource bundles: %s", err) + } + return resources, nil +} + var _ cegeneric.Lister[*api.Resource] = &sqlResourceService{} func (s *sqlResourceService) List(listOpts cetypes.ListOptions) ([]*api.Resource, error) { diff --git a/pkg/services/validation.go b/pkg/services/validation.go index 3ee6bba2..254015c5 100644 --- a/pkg/services/validation.go +++ b/pkg/services/validation.go @@ -53,7 +53,7 @@ func ValidateManifest(resType api.ResourceType, manifest datatypes.JSONMap) erro } return ValidateObject(obj) case api.ResourceTypeBundle: - objs, err := api.DecodeManifestBundle(manifest) + objs, err := api.DecodeManifestBundleToObjects(manifest) if err != nil { return fmt.Errorf("failed to decode manifest bundle: %v", err) } @@ -118,11 +118,11 @@ func ValidateManifestUpdate(resType api.ResourceType, new, old datatypes.JSONMap } return ValidateObjectUpdate(newObj, oldObj) case api.ResourceTypeBundle: - newObjs, err := api.DecodeManifestBundle(new) + newObjs, err := api.DecodeManifestBundleToObjects(new) if err != nil { return fmt.Errorf("failed to decode new manifest bundle: %v", err) } - oldObjs, err := api.DecodeManifestBundle(old) + oldObjs, err := api.DecodeManifestBundleToObjects(old) if err != nil { return fmt.Errorf("failed to decode old manifest bundle: %v", err) }