diff --git a/backend/api/spec.yaml b/backend/api/spec.yaml index 532696dd3..d63dcd6d7 100644 --- a/backend/api/spec.yaml +++ b/backend/api/spec.yaml @@ -43,6 +43,10 @@ paths: responses: "200": description: login token response + content: + application/json: + schema: + $ref: "#/components/schemas/loginToken" "500": description: internal server error "501": @@ -190,7 +194,7 @@ paths: "500": description: Create App error response - /api/apps/{appID}: + /api/apps/{appIDorProductID}: get: description: get app operationId: getApp @@ -200,7 +204,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -224,7 +228,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -255,7 +259,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -265,7 +269,7 @@ paths: "500": description: Delete App error response - /api/apps/{appID}/groups: + /api/apps/{appIDorProductID}/groups: get: description: paginate groups of an app operationId: paginateGroups @@ -275,7 +279,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -311,7 +315,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -334,7 +338,7 @@ paths: "500": description: Create Group error response - /api/apps/{appID}/groups/{groupID}: + /api/apps/{appIDorProductID}/groups/{groupID}: get: description: get group given its groupID and appID operationId: getGroup @@ -344,7 +348,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -373,7 +377,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -411,7 +415,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -428,7 +432,7 @@ paths: "500": description: Delete Group error response - /api/apps/{appID}/groups/{groupID}/version_timeline: + /api/apps/{appIDorProductID}/groups/{groupID}/version_timeline: get: description: get version timeline of a group given its groupID and appID operationId: getGroupVersionTimeline @@ -438,7 +442,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -463,7 +467,7 @@ paths: description: Group not found response "500": description: Version Timeline of group error response - /api/apps/{appID}/groups/{groupID}/status_timeline: + /api/apps/{appIDorProductID}/groups/{groupID}/status_timeline: get: description: get status timeline of a group given its groupID and appID operationId: getGroupStatusTimeline @@ -473,7 +477,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -499,7 +503,7 @@ paths: "500": description: Status Timeline of group error response - /api/apps/{appID}/groups/{groupID}/instances_stats: + /api/apps/{appIDorProductID}/groups/{groupID}/instances_stats: get: description: get instance stats of a group given its groupID and appID operationId: getGroupInstanceStats @@ -509,7 +513,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -534,7 +538,7 @@ paths: description: Group not found response "500": description: Instance Stats of group error response - /api/apps/{appID}/groups/{groupID}/version_breakdown: + /api/apps/{appIDorProductID}/groups/{groupID}/version_breakdown: get: description: get version breakdown of a group given its groupID and appID operationId: getGroupVersionBreakdown @@ -544,7 +548,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -564,7 +568,7 @@ paths: description: Group not found response "500": description: Version Breakdown of group error response - /api/apps/{appID}/channels: + /api/apps/{appIDorProductID}/channels: get: description: paginate channels of an app operationId: paginateChannels @@ -574,7 +578,7 @@ paths: - githubCookieAuth: [] parameters: - in : path - name: appID + name: appIDorProductID required: true schema: type: string @@ -610,7 +614,7 @@ paths: - githubCookieAuth: [] parameters: - in : path - name: appID + name: appIDorProductID required: true schema: type: string @@ -632,7 +636,7 @@ paths: description: Bad request response "500": description: Create channel error response - /api/apps/{appID}/channels/{channelID}: + /api/apps/{appIDorProductID}/channels/{channelID}: get: description: get channel by id operationId: getChannel @@ -642,7 +646,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -671,7 +675,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -709,7 +713,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -723,7 +727,7 @@ paths: description: Delete channel success response "500": description: Delete channel error response - /api/apps/{appID}/packages: + /api/apps/{appIDorProductID}/packages: get: description: paginate packages of an app operationId: paginatePackages @@ -733,7 +737,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -771,7 +775,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -793,7 +797,7 @@ paths: description: Create Package bad request response "500": description: Create package error response - /api/apps/{appID}/packages/{packageID}: + /api/apps/{appIDorProductID}/packages/{packageID}: get: description: get package given its packageID and appID operationId: getPackage @@ -803,7 +807,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -832,7 +836,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -868,7 +872,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -884,7 +888,7 @@ paths: description: Package not found response "500": description: Delete package error response - /api/apps/{appID}/groups/{groupID}/instances: + /api/apps/{appIDorProductID}/groups/{groupID}/instances: get: description: get instances of a group given its groupID and appID operationId: getGroupInstances @@ -894,7 +898,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -959,7 +963,7 @@ paths: $ref: "#/components/schemas/instancePage" "500": description: Get Instances of a Group error response - /api/apps/{appID}/groups/{groupID}/instancescount: + /api/apps/{appIDorProductID}/groups/{groupID}/instancescount: get: description: get instance count of a group given its groupID and appID operationId: getGroupInstancesCount @@ -969,7 +973,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -992,7 +996,7 @@ paths: $ref: "#/components/schemas/instanceCount" "500": description: Get Instance count of a Group error response - /api/apps/{appID}/groups/{groupID}/instances/{instanceID}: + /api/apps/{appIDorProductID}/groups/{groupID}/instances/{instanceID}: get: description: get instance of a group given its groupID and appID operationId: getInstance @@ -1002,7 +1006,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -1027,7 +1031,7 @@ paths: description: Instance not found response "500": description: Get instance error response - /api/apps/{appID}/groups/{groupID}/instances/{instanceID}/status_history: + /api/apps/{appIDorProductID}/groups/{groupID}/instances/{instanceID}/status_history: get: description: get instance status_history. operationId: getInstanceStatusHistory @@ -1037,7 +1041,7 @@ paths: - githubCookieAuth: [] parameters: - in: path - name: appID + name: appIDorProductID required: true schema: type: string @@ -1109,7 +1113,7 @@ paths: - githubCookieAuth: [] parameters: - in: query - name: appID + name: appIDorProductID required: false schema: type: string @@ -1349,20 +1353,43 @@ components: properties: accessManagementUrl: type: string + x-oapi-codegen-extra-tags: + json: "access_management_url" logoutUrl: type: string + x-oapi-codegen-extra-tags: + json: "logout_url" nebraskaVersion: type: string + x-oapi-codegen-extra-tags: + json: "nebraska_version" logo: type: string + x-oapi-codegen-extra-tags: + json: "logo" title: type: string + x-oapi-codegen-extra-tags: + json: "title" headerStyle: type: string + x-oapi-codegen-extra-tags: + json: "header_style" loginUrl: type: string + x-oapi-codegen-extra-tags: + json: "login_url" authMode: type: string + x-oapi-codegen-extra-tags: + json: "auth_mode" + loginToken: + type: object + required: + - "token" + properties: + token: + type: string flatcarAction: type: object required: diff --git a/backend/pkg/api/applications.go b/backend/pkg/api/applications.go index a87630530..10e0b852e 100644 --- a/backend/pkg/api/applications.go +++ b/backend/pkg/api/applications.go @@ -186,12 +186,8 @@ func (api *API) UpdateApp(app *Application) error { // DeleteApp removes the application identified by the id provided. func (api *API) DeleteApp(appID string) error { - realAppID, err := api.GetAppID(appID) - if err != nil { - return err - } - query, _, err := goqu.Delete("application").Where(goqu.C("id").Eq(realAppID)).ToSQL() + query, _, err := goqu.Delete("application").Where(goqu.C("id").Eq(appID)).ToSQL() if err != nil { return err } @@ -213,14 +209,10 @@ func (api *API) DeleteApp(appID string) error { // GetApp returns the application identified by the id provided. func (api *API) GetApp(appID string) (*Application, error) { - realAppID, err := api.GetAppID(appID) - if err != nil { - return nil, err - } var app Application query, _, err := goqu.From("application"). - Where(goqu.C("id").Eq(realAppID)).ToSQL() + Where(goqu.C("id").Eq(appID)).ToSQL() if err != nil { return nil, err } diff --git a/backend/pkg/api/applications_test.go b/backend/pkg/api/applications_test.go index 763b7de49..46f21e780 100644 --- a/backend/pkg/api/applications_test.go +++ b/backend/pkg/api/applications_test.go @@ -178,7 +178,10 @@ func TestGetApp(t *testing.T) { assert.NoError(t, err) assert.Equal(t, tApp1.Name, app.Name) - app, err = a.GetApp(*tApp1.ProductID.Ptr()) + appID, err := a.GetAppID(*tApp1.ProductID.Ptr()) + assert.NoError(t, err) + + app, err = a.GetApp(appID) assert.NoError(t, err) assert.Equal(t, tApp1.ProductID, app.ProductID) diff --git a/backend/pkg/api/bindata.go b/backend/pkg/api/bindata.go index e8dc18bc4..19ebca380 100644 --- a/backend/pkg/api/bindata.go +++ b/backend/pkg/api/bindata.go @@ -1,7 +1,7 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: // db/drop_all_tables.sql (781B) -// db/sample_data.sql (16.109kB) +// db/sample_data.sql (16.141kB) // db/migrations/0001_initial.sql (7.125kB) // db/migrations/0002_event_data.sql (729B) // db/migrations/0003_longer_team_names.sql (142B) @@ -106,7 +106,7 @@ func dbDrop_all_tablesSql() (*asset, error) { return a, nil } -var _dbSample_dataSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x5b\x5d\x73\xd3\xb8\xd7\xbf\xe7\x53\x68\xe6\x7f\x11\x18\xaa\x54\xef\x2f\xdd\xd9\x0b\x5a\x28\xb0\x5b\x58\xba\x85\x65\xd8\x9b\x8e\x5e\x8e\x1b\x53\xc7\x0e\xb6\x93\xd0\x7e\xfa\x67\xec\xa4\xa9\x4b\xe9\x53\x27\xa5\x4b\x77\xc3\x90\x3a\xb2\x8f\x74\x7e\x3f\x1d\x1d\x9d\x23\xc9\x18\xa3\xd7\x79\x5a\xa7\x2e\x43\xd1\xd5\xee\xd1\x23\x8c\xd1\xf3\xb2\x98\xb4\xbf\x90\x8b\x11\x22\x4a\x73\x34\x4e\x4f\x4a\x57\xa7\x45\x8e\xca\x62\x5a\xa7\x39\x54\xed\x93\xab\xfb\x84\x10\x75\x9c\x2e\x2a\x3a\x76\x93\x49\x96\x86\xf6\xf1\x61\xf5\x25\x7b\x14\x21\x83\x1a\x50\x52\x16\x63\x74\x52\x16\xd3\x49\xf5\xcb\x95\xb2\x30\x72\x79\x0e\xd9\xd5\xc2\x89\x0b\xa7\xee\x04\xae\x16\x76\x6a\xfe\xe5\x9a\x02\xf2\x38\x42\xe2\xa6\x59\x7d\x5c\x83\x1b\x1f\xa7\xf1\x5a\xe3\x4d\xf9\x42\xee\xf9\xe2\xc9\xb6\x04\xb9\x3c\xa2\x69\x05\x25\x7a\xec\xe2\x38\xcd\xb7\xdb\xef\x27\x8f\xd2\xbc\x82\xb2\x46\x69\x5e\x17\x8b\xe7\x1e\xa7\x71\x0b\xe5\x6e\x0c\x4f\xd0\xcc\x65\x53\xa8\xd0\xe3\x41\x34\x96\x0b\x16\x03\xb6\x8c\x0a\x2c\x04\x8d\xd8\x09\x97\x60\x1f\xa3\xe1\xda\x71\xcf\xb8\x1d\x6c\xa1\xc1\x52\xb5\xc1\x93\x5f\xae\xd4\xdb\x34\x5b\xa1\xc7\xcd\x9f\xa6\xe2\x2d\x54\x41\x28\xa1\xde\x42\x4b\x08\x9d\x96\x5a\xad\x9a\xaa\x8c\xe7\x94\x59\x16\x85\xd6\x46\x1a\x16\x08\xc8\xc4\x59\xe5\x00\xa4\xa4\x3c\xa1\x6d\x73\x7d\xd4\x7a\xb2\xe0\x62\xaf\x28\xe1\x8f\xa3\x2e\xb7\x57\x54\xec\x94\x5f\x32\xb0\x85\x22\x54\xa1\x4c\x27\x4d\xf1\xf7\xb4\x05\xab\x98\xa1\x4e\xe1\x48\x5d\x82\x85\x8f\x80\xad\x23\x0e\x5b\xed\xb5\x02\xa9\x62\x90\xba\x51\x74\xd1\x78\x73\x75\x90\xe6\xd3\xaf\x28\x29\x4a\x34\x76\x55\x95\xce\x00\x55\x50\xce\xa0\x44\x11\x26\x59\x71\x36\x86\xbc\xae\xd6\x81\xd6\xc5\xb0\x34\xa6\x4b\xf5\x98\x77\x22\x58\x23\xb0\x04\xeb\xb1\xa0\x14\xb0\xd7\x81\x63\xcf\xc1\x53\x91\x68\xc7\x54\xc3\x23\xdd\x42\x03\xad\xd4\x90\x0f\x49\xd3\xf4\xa8\xae\x27\xd5\xce\xf6\xf6\x74\x12\x5d\x0d\xc3\x12\x32\x70\x15\x0c\x93\xcc\xd5\xc1\x95\x38\x6b\x10\x0c\x73\xa8\xb7\xdd\x38\x2a\x81\xa7\x55\xb9\xbd\x94\xde\x6e\xc4\x97\xcf\x1d\x4f\xca\x22\x4e\x43\xc3\xdc\xf1\xb2\xa6\x93\xf3\xc1\x16\x7a\xfb\xe1\xe0\x60\x0b\x0d\xa8\x14\x56\x69\x21\x4d\x23\x92\x89\xdf\xe7\xfa\x19\xec\x1e\x94\x7f\xbd\x7e\x6e\x7f\xf3\xc9\xd9\x9b\xe2\x37\xd8\x95\x67\xbf\x9f\xfc\xda\xdc\x67\x84\x5a\x4c\x0c\x66\x04\x11\xb2\x43\xd9\x0e\xd7\x43\xc9\xb8\xe5\xad\x74\xcf\x4e\xa0\xb7\xb1\xc5\xb9\xf6\x3c\xd1\x80\x93\x84\x59\x2c\x34\x18\xec\x88\x64\x38\x21\x86\x8b\xc8\xa4\x8f\x5e\x76\xd8\x12\x77\x62\x4b\xac\xc9\x96\x24\xd4\x58\xca\x5a\x91\xf2\xf4\xd4\x3d\xdd\xdd\x3e\x7f\x3f\xd3\x7f\xbc\xfb\x78\x92\xc6\x4f\x4f\x4f\xc5\x51\xfe\xfc\xe8\x3a\x5b\x6a\x87\xca\x1d\x66\x87\x94\x18\xa6\xd4\x8f\x64\x2b\x30\xc7\x15\xa7\x0c\x7b\x6b\x2c\x16\x84\x03\x76\x5e\x6a\x4c\x54\x20\x52\x3a\x0d\x2e\xb0\x25\x5b\x86\x98\x21\xd9\x98\xad\xa5\xf4\x3a\x6c\x69\xad\xa9\x16\x54\x34\x22\xfe\x0b\x4f\x0e\xff\x7c\xf5\xce\x7c\xdd\xe5\x7f\xee\x7f\xf8\xbc\x17\x9f\x25\x7c\x7e\xf8\x69\x8f\xbd\xf8\x8e\x6d\x11\xbb\x43\xd4\xd0\x70\x6b\x8d\xfd\x91\x6c\x09\x2e\x0d\x31\x96\xe1\xe0\xa2\xc1\x42\x19\x87\x1d\xf1\x1e\x83\xb7\x91\x00\xb1\x10\x9c\xb8\x60\x8b\xca\xbb\xb0\xb5\x90\x5e\x8b\x2d\xa3\x04\x97\xba\xc5\x7b\xfa\x56\xb8\x71\xf1\xfb\xa7\xbf\xfe\xfe\xf0\x92\x7d\x2c\x8e\xe2\xe1\x2b\xfa\xee\xd5\xbb\xf3\x52\x3e\xbb\xca\x96\x44\x94\xef\x48\xb9\xc3\xc8\xb0\x61\x9a\xfe\x50\xb6\x98\x11\x91\x59\xe9\xb1\xa4\x26\xc1\x22\x2a\x8d\xad\xb5\x80\xad\xb0\xca\x44\x02\x10\x2d\xb9\x60\x8b\xd9\xbb\xb0\xb5\x90\x5e\x87\x2d\xa3\x98\x90\x72\x61\x5b\x2c\x1b\x15\x1f\x66\xb3\xbc\xf8\xc4\xa5\x9d\xa4\x6c\x3f\x77\x47\xdb\x5f\xab\x93\x3a\xed\x8e\x44\x8b\x29\x41\x8c\xef\x50\xba\x43\xc9\xd0\x30\x69\x8d\xbc\x03\x5b\xcb\x38\xa2\x33\x09\x11\x45\x94\x70\xb1\x99\x25\x04\x16\x96\x08\x6c\x9d\x02\x9c\x44\xa1\xa4\xb4\x3c\x52\xdf\xfa\x8d\xaa\x76\x3e\x83\xe6\xea\x7f\x54\x78\x1b\x55\xb7\x43\xa9\x45\x44\x36\xe6\xcf\xc5\x90\x29\xca\x04\x5d\x43\xc5\xde\xae\xf3\x36\x28\x94\x19\x6f\x02\xb3\x58\x12\xd9\x0c\x13\xc1\xb1\x01\xa5\xb1\xa3\x8e\x00\x0f\x4a\xd0\xd0\x1a\x9a\x87\xda\xb5\x40\x92\xa0\x13\xce\x6f\x06\x22\x38\x17\x3f\x03\x88\x33\xda\x11\xde\xf4\x49\x33\xfd\x0a\xed\x28\x36\x31\x08\xcc\x25\xd1\xde\x81\xa5\x00\x2d\xc1\x2e\x9b\x8c\x16\x48\x68\xe2\xbd\xf9\x7f\xba\x44\x6a\xb9\x16\x92\xbe\x63\xe8\x1b\x24\x8b\xc8\xf5\x12\x88\x75\x2c\x82\xd7\x04\x73\xed\x01\x0b\xc2\x14\x36\x92\x27\xd8\x27\x31\x2a\xcf\x85\xf6\xbe\x35\xa9\xa3\x95\x71\xed\x17\x25\xba\x1c\x43\x28\x64\xd3\xaa\x86\xb2\x09\x6a\x12\x97\x55\xb0\x85\xea\x72\xba\xfa\x5e\x16\x0d\x5e\x4c\xcb\x62\x02\xdb\xbb\x50\x66\x8b\xf0\x8f\x4a\x34\x4e\xf3\x69\x0d\x8d\x20\xdb\x42\x03\x45\x3a\x05\x37\x70\x64\x89\x62\xeb\x70\xb4\xe6\xc8\xb9\x85\x2a\x9e\x00\x25\xc2\x12\x1c\xa3\xe6\x58\x78\x61\xb1\xd7\xcc\x61\x66\x5c\xa0\xd6\x85\x24\xc4\xd0\xd4\xb6\xbb\x34\xde\x77\x65\x31\x2e\x6a\x88\xa8\x35\x02\xb4\xf4\x57\xd5\x16\x6a\x0c\xca\xd5\x61\x84\xfc\xf4\xa4\x42\xd5\x04\x42\x9a\xa4\xa1\x29\x3e\x2b\xa6\x25\x0a\x45\x9e\xa4\x27\xd3\x45\xa6\x32\xb8\xca\xe7\x3d\xb0\xaa\x39\x13\x6b\x59\xde\x5a\x83\xf8\x16\x4e\xa5\x37\x94\x28\x43\x30\x70\xe5\xb0\x30\xda\x36\xf1\x86\xc3\x22\xb1\xc6\x82\x21\xde\xd8\xb6\xae\x67\x17\xe3\xe8\x7d\xe9\xc2\x69\x85\xc2\xb4\x2c\x21\xaf\x51\x84\x19\x64\xc5\xa4\x09\xab\xd1\xbc\x28\x4f\xdb\x2c\x28\xad\x2e\xc8\x8e\x28\x29\xe1\xcb\x14\xf2\x3a\x3b\xbb\x8b\x81\x36\x33\x11\xef\x41\xa5\xb0\x74\x2d\xbf\xba\x9e\x1b\xf9\x86\xcb\x8b\x09\xcd\x2d\x06\xe2\x8a\x53\xcf\x3c\x55\xc0\x00\x4b\x9d\x18\x2c\xb4\x96\xd8\x30\x9d\x60\x93\x10\x4f\xa9\x03\xeb\x63\x6b\xf5\x93\xa2\xaa\xd3\xbc\xaa\x5d\x96\x35\x3f\xdb\xf0\xc0\xec\xed\x9a\xfa\x0d\x90\x37\xe6\xf9\xd9\xdf\xf2\xcf\xbf\xe7\xe7\xcf\x0f\xce\xde\xc7\xd3\x57\x9f\xff\xd8\xfe\x74\x92\xfc\xfe\x57\xce\xfe\x3c\xf9\xf0\xa6\x38\x0d\xbf\x5e\xf2\x79\x85\xd6\xc1\xa0\xf3\xff\xbb\x81\x3d\x67\xcc\xb4\xa8\x7a\xa5\x2f\x3d\x41\x47\xe9\x58\xf0\x09\xc7\x8d\x41\x61\x01\x26\x60\x63\xc0\x60\x15\x13\x4b\x93\xc0\x94\x08\xea\x06\xd0\x87\x1f\x5e\xe6\xe3\x77\x92\x8e\x26\xfa\xfc\xec\xe9\xd3\xa7\x85\x4c\x76\x5f\xcf\x5f\x64\xaf\xf3\xf7\xcf\xc6\x95\xde\xce\x3f\xe7\xa7\x5f\xa7\x75\xbe\x7d\xf8\x7a\x6d\xd0\xab\xf8\x9c\xaa\x45\x50\xd0\x6b\x02\xea\x89\x99\x59\x1b\xa4\x88\x14\x73\x2e\x04\x16\x0e\x2c\x36\x2e\x32\x2c\x83\xe2\x51\xaa\xa8\xc2\x22\x8c\xf9\x0e\xe6\xa3\xbd\x99\xb1\x2f\x3f\x9d\x7f\xd5\xaf\xbf\x3e\x7d\x9f\x7d\xfe\xe2\xdf\x56\x51\x17\xb9\x92\x45\xf1\xf1\xcb\xee\x79\xd8\x2b\x0f\xf6\x0f\xc4\x7c\x6f\x74\xb8\x41\x47\x2f\xa2\x6c\xcb\xb4\x68\xf3\xcf\x7e\xb9\x44\x4f\xd0\x5a\x98\x98\xc8\x24\x60\xca\x9c\xc4\x22\xba\x88\x9d\xa6\x80\x85\x92\x21\x50\xa5\x0c\x11\xe6\x06\xd0\xf6\xd5\x87\x4a\xcc\x47\xe9\x79\x72\x36\xf3\x62\x7c\x92\x3d\xfd\xe8\xde\xba\x8f\xfc\xaf\x83\xc3\x4f\xf3\xea\x23\x7d\xf9\xea\xed\xab\xdf\xde\x4e\xc2\xfe\x89\x58\x0f\x74\x27\x58\x36\x4c\x32\xd1\x0e\xaf\x5e\x29\x41\x4f\xd0\x36\x44\xa1\x45\x90\x18\x12\xc7\x1b\x67\x61\x9b\xc9\x9e\x61\x69\x62\xf4\x46\x32\x88\xe6\xa6\x9e\xa6\x47\xf6\xfc\x70\xef\xe0\xe5\xe7\x31\x24\x9f\xf2\x17\xdb\x6e\x3f\x4c\xf6\x3e\x1f\xd0\xb7\xd5\xc9\xf4\xd5\xe8\xf0\xe5\x67\xf2\x61\x6f\x2c\x13\xf2\xc6\x9a\x35\x40\x5f\x8d\x79\x2d\xe5\x5a\x9b\xde\x51\xc9\x72\xc5\xe6\xc8\x8d\x27\x19\x5c\x59\x99\xa1\x3f\x60\xcd\xc6\x2b\x21\x0d\x21\x12\x9b\x44\x10\x2c\x14\xd3\xd8\x73\xee\xb1\x07\x4d\x9c\xa6\x26\x08\xb3\x88\x68\xae\x35\xdf\x94\xfe\x36\xad\x6a\xe4\xf2\x2b\x6d\xd7\x05\xaa\x46\xc5\x1c\xd5\x23\x40\xc1\x4d\x9c\x4f\xb3\xb4\x4e\xa1\x42\x45\x82\xde\x82\x2f\x5d\x75\xea\xee\xba\xa6\xd3\xe2\xab\xcf\x26\xb0\x85\xa6\x65\xb6\x85\x92\x34\x83\x05\xdc\x19\x94\x55\x0b\xb5\xa3\xd2\x71\xf3\xb4\x2b\xc3\xa8\x83\x5b\x52\x2b\x1b\x2f\x88\x65\x62\x18\xa6\x14\x24\xb6\x51\x13\x9c\x40\x92\x18\x6a\x43\x0c\x36\x19\x6c\x21\xd1\xc9\xa4\xe6\xf3\xf9\xf0\x34\xcd\x67\x45\x76\x3a\x4c\x8b\x36\x4b\xaa\xa1\xaa\x8f\xe9\x90\x0c\x5b\x1b\x5e\x5d\xf4\x24\xf5\xa6\xcc\xef\xee\xe8\x28\x53\x56\x27\x4e\x34\xe8\xf8\xdd\xd1\xf1\x0b\x74\xfc\x41\xa0\x33\x84\x08\xdf\xb8\x09\x99\x58\x7d\x77\x74\xe2\x02\x9d\x78\x10\xe8\xdc\xf2\xd3\xa0\x33\x77\x47\x27\x2f\xd0\xc9\x3b\xa0\xbb\xc8\xe8\x3a\x7e\x25\x14\x59\x51\x5e\x07\xb3\xe4\xe1\x7b\xc0\x7c\x02\x9c\x79\xd1\x00\x33\xe1\x66\x60\x83\x37\xae\x49\x91\xda\x34\x90\x90\xbd\x3d\x42\xd6\x50\xbc\xaf\x6d\xdc\x0b\xc0\xe0\x59\x04\x70\xe6\x96\x51\xd7\xc9\x0e\xff\x47\x88\xb5\xfb\xfb\xeb\x00\xec\x39\xb4\xef\x05\x60\x5c\x7e\x6e\x03\xb8\xef\xd2\x2c\xcd\x4f\x5a\x84\xcf\x9e\xad\x8b\xb0\xe7\x00\xb8\x2d\x57\xf7\xc1\x39\x65\x7c\xb8\xc5\xc3\x37\x89\x67\x44\x2f\xf6\x18\x9a\x56\x78\x0e\x55\x8d\xd9\x45\xe9\x32\x67\x5f\x6c\x49\x54\x5b\xa8\xb9\x8b\x42\xe1\xaa\xfa\x9f\x4c\xdf\xfb\xd2\xd6\xd7\xfa\x7a\xf1\x72\x0b\xb7\x9a\x68\xc1\x94\x70\x98\x11\x4d\xb0\xf0\x46\x60\xab\x20\x62\xe3\x98\xb2\xd1\x3b\x49\x18\xfd\x96\x5b\x70\x55\x8d\xe9\x4d\xdc\x36\x77\xff\xfd\xdc\xf6\xe2\xe5\x36\xbb\xa5\x94\x18\xca\xdd\x6d\x76\x7b\xe8\xf0\x73\x98\xb5\x57\xcf\xda\x44\xbe\x9b\xdd\xaf\x78\x3d\x3a\x8b\x39\xdc\x29\x9b\xbf\x2f\x4e\xfb\x4e\x07\xbd\xf8\xb8\x85\xd3\xb0\xfc\xdc\xc6\xe9\xd2\x71\xa1\x4b\x6e\x57\x25\xff\x4a\x8e\xfb\x3a\xec\x5e\xfc\x7c\xc3\x71\x9b\x39\xe5\x61\x19\xf2\xa4\x93\xce\x3c\x71\x71\xab\x1d\xed\x94\x0c\x9b\x7f\xd7\xec\xbe\x87\x3c\xeb\xc8\x5f\x4b\x79\x7b\xc8\xf3\x8e\x3c\xdf\x40\x5e\x74\xe4\xaf\x65\x9f\x3d\xe4\x65\x47\xfe\xda\x3a\x45\x0f\x79\xd5\x91\x57\x1b\xc8\xeb\x8e\xbc\xde\x40\xde\x74\xe4\xcd\x06\xf2\xb6\x23\x7f\x2d\x97\xeb\x63\x3f\xa4\x6b\x40\x64\x93\x1a\xae\x98\xe0\x26\x36\x48\xbb\x46\x48\x6f\xb4\xc2\xee\x01\x98\x4e\x1e\xb6\xcc\x99\x96\x27\x41\xda\xa8\x7d\x75\xbd\xba\x58\x6c\xa6\xad\x7e\x5e\x1d\x3e\xbd\xdd\xe9\x06\xd3\xfa\x7d\x2a\xbf\xde\x5c\x70\x2f\xca\xb3\x8d\x95\x5f\x27\xcf\x7d\x70\xcc\xaf\x93\xc6\x6e\x14\xb1\xdc\xa7\xf2\xeb\x64\xa9\xf7\xa4\xfc\xe6\x66\xa3\x7e\xbe\xf2\xb4\xab\x3c\x5f\x47\x79\xfd\xf3\x95\x17\x1b\x33\x6f\xd6\x1a\xb0\x1b\x44\x94\x6b\xda\xbc\x5e\x47\x79\xfb\xf3\x95\xbf\x62\xf3\x6c\xad\x49\x6a\xad\xe5\x99\xfb\xd1\x7e\x73\xa3\xa7\xeb\xcd\xb1\x0f\x4d\xfb\xf5\x92\xd8\x0d\x82\x7c\x17\xea\x74\x96\xd6\x67\x2b\x8d\x57\x4a\xe4\xc5\xfc\xf1\x13\xe4\x6a\x54\xa7\x63\x40\xe7\x45\x0e\x68\x30\xad\xc3\x00\xe1\x46\x12\xca\x99\xcb\xd0\x80\xa3\x51\x31\x2d\x97\x7b\xc2\x62\x83\x45\xe4\xde\x2b\x0d\x7d\x33\xf4\xcb\xd8\xea\xc7\x22\x55\x2b\xa4\xb2\xed\xc4\xff\x2e\x52\xca\x56\x50\xf9\x62\xaf\xff\xbf\x0b\xd5\xac\xa0\x8a\xff\xb8\xfd\x32\xb1\x82\xca\x16\xeb\x11\x0f\x17\xea\xca\xa5\x56\xb5\xab\xa7\xd5\xf1\x28\xad\xea\xa2\xfc\x0e\xf2\x6e\x8f\xf5\x62\xe1\xb2\xbf\x7f\x42\x40\x7a\x1b\x1a\xb9\x21\x1a\xd4\x5d\x69\x7a\x80\xb8\xd4\xba\xb8\xec\x43\xee\x25\xbd\x21\x1a\x24\x1e\x78\x37\xb1\xbb\x03\x43\x94\xa0\x0a\x42\x91\xc7\x07\x8a\x51\x74\x76\xf1\xfb\x05\x38\xea\x21\xdb\xa2\xdc\x14\xce\xbf\xc5\x65\xf4\x07\xa6\x1f\x72\x3f\xe9\x4d\xe1\xfc\x6b\x9c\xc6\x5d\x90\xfd\x2c\xaf\x01\x33\xc8\x6b\xf4\x78\x52\xc2\x2c\x2d\xa6\xd5\xf1\xea\x00\x07\x94\x65\x51\x1e\x87\x22\xc2\xd6\x25\x13\xed\x76\xf9\x37\x5b\xe9\x6d\x0d\xc7\xf5\xd9\x04\xda\x43\x57\x15\x64\x10\xea\xcb\xc3\x61\x1b\xa5\x71\x50\x0f\xd3\xb8\x78\xb5\xf1\xb2\x7a\x04\x35\x9a\x8f\xa0\x6c\x2e\x86\x6d\xc1\xaf\x88\xb7\x1b\x56\x50\x0f\x4b\xa8\xa6\x59\x8d\x7e\x45\xe4\xc6\x93\x64\xec\x07\x9c\x24\xd3\x86\x44\x65\x05\xc1\xd6\x09\xb3\x38\x43\x6e\x4c\x4c\xb0\x95\xde\x29\xee\x3d\xd8\xe0\x07\xdf\x3d\x49\x86\x5a\xfc\xcf\xf2\xa2\x1e\x41\x89\xaa\x6b\xf7\xb7\x50\x02\x90\xa1\xa4\x04\x40\x75\x81\x4a\x18\x17\x33\x40\xe3\xc5\x0e\xd7\x4f\x3d\x45\x06\x89\xa7\x46\x05\x8b\xa3\x0c\x1e\x8b\x98\x30\x6c\xb9\x61\x38\x08\xc3\x28\x88\x18\x82\xf0\x9d\xb3\x3a\x3b\xdb\xdb\x59\x11\x5c\x36\x2a\xaa\x7a\xc7\x10\xb2\x78\xd5\x26\xc2\xb8\x38\x9e\xd1\x8b\x17\x77\x56\x17\x3d\x09\xbd\xbf\x93\x48\xde\x31\xe3\x12\x61\xb0\x97\xde\x62\xa1\x08\x60\x2b\x94\xc3\xe0\x9d\x25\x2a\x80\x8e\x2e\x59\x03\x1d\xbd\x40\x47\xef\x80\xee\x87\x9c\x63\x71\x3a\x98\x60\x9d\xc0\x91\x39\x8e\x85\x96\x11\x7b\x50\x02\x5b\x4a\x93\xc4\x44\x05\xd6\xb6\xab\xa1\x9d\x93\x48\x97\xef\x08\xf5\xb5\xf3\x9e\xb6\x71\xdb\x31\x16\x49\x1d\x67\xce\x59\xcc\xa5\x64\x58\xd8\x24\x60\xc7\x4c\xc0\x4a\x0a\xee\x43\x48\x08\x51\xf6\x52\x57\x84\x51\x5c\x6c\x5c\xbf\x1f\x01\xca\x5c\x0d\x55\x8d\xaa\x7a\x9a\x24\x68\x9e\x66\x19\xf2\x80\x5c\x36\x77\x67\x15\x6a\xbc\xc5\x3f\xb9\x65\xdd\x97\xb6\xbe\x7d\xd3\x8b\x97\x27\xbf\x3c\xfa\xbf\x00\x00\x00\xff\xff\x8e\x51\x82\xe3\xed\x3e\x00\x00") +var _dbSample_dataSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x5b\x5d\x73\xd3\xb8\xd7\xbf\xe7\x53\x68\xe6\x7f\x11\x18\xa2\x54\xef\x2f\xdd\xd9\x0b\x5a\x28\xb0\x5b\x58\xba\x85\x65\xd8\x9b\x8e\x5e\x8e\x1b\x53\xc7\x0e\xb6\x93\xd2\x7e\xfa\x67\xec\xa4\xa9\x4b\xe9\x53\x27\xa5\x4b\x77\xc3\x90\x2a\xb2\x8f\x7c\x7e\x3f\x1d\x1d\x9d\x23\xc9\x18\xa3\xd7\x79\x5a\xa7\x2e\x43\xd1\xd5\xee\xd1\x23\x8c\xd1\xf3\xb2\x98\xb6\xbf\x90\x8b\x11\x22\x4a\x73\x34\x49\x8f\x4b\x57\xa7\x45\x8e\xca\x62\x56\xa7\x39\x54\xed\x9d\xab\xeb\x84\x10\x75\x94\x2e\x1a\x3a\x72\xd3\x69\x96\x86\xf6\xf6\x51\xf5\x25\x7b\x14\x21\x83\x1a\x50\x52\x16\x13\x74\x5c\x16\xb3\x69\xf5\xcb\x95\xba\x30\x76\x79\x0e\xd9\xd5\xca\xa9\x0b\x27\xee\x18\xae\x56\x76\x5a\xfe\xe5\x9a\x02\xf2\x28\x42\xe2\x66\x59\x7d\x54\x83\x9b\x1c\xa5\xf1\xda\xc3\x9b\xfa\x85\xdc\xf3\xc5\x9d\x6d\x0d\x72\x79\x44\xb3\x0a\x4a\xf4\xd8\xc5\x49\x9a\x6f\xb5\xdf\x4f\x1e\xa5\x79\x05\x65\x8d\xd2\xbc\x2e\x16\xf7\x3d\x4e\xe3\x10\xe5\x6e\x02\x4f\xd0\xdc\x65\x33\xa8\xd0\xe3\x41\x34\x96\x0b\x16\x03\xb6\x8c\x0a\x2c\x04\x8d\xd8\x09\x97\x60\x1f\xa3\xe1\xda\x71\xcf\xb8\x1d\x0c\xd1\x60\xa9\xda\xe0\xc9\x2f\x57\xda\x6d\x1e\x5b\xa1\xc7\xcd\x9f\xa6\xe1\x21\xaa\x20\x94\x50\x0f\xd1\x12\x42\xe7\x49\xad\x56\x4d\x53\xc6\x73\xca\x2c\x8b\x42\x6b\x23\x0d\x0b\x04\x64\xe2\xac\x72\x00\x52\x52\x9e\xd0\xf6\x71\x7d\xd4\x7a\xb2\xe0\x62\xb7\x28\xe1\x8f\xc3\x2e\xb7\x57\x54\xec\xd4\x5f\x32\x30\x44\x11\xaa\x50\xa6\xd3\xa6\xfa\x7b\xda\x82\x55\xcc\x50\xa7\x70\xa4\x2e\xc1\xc2\x47\xc0\xd6\x11\x87\xad\xf6\x5a\x81\x54\x31\x48\xdd\x28\xba\x78\x78\x53\xda\x4f\xf3\xd9\x57\x94\x14\x25\x9a\xb8\xaa\x4a\xe7\x80\x2a\x28\xe7\x50\xa2\x08\xd3\xac\x38\x9b\x40\x5e\x57\xeb\x40\xeb\x62\x58\x1a\xd3\xa5\x7a\xcc\x3b\x11\xac\x11\x58\x82\xf5\x58\x50\x0a\xd8\xeb\xc0\xb1\xe7\xe0\xa9\x48\xb4\x63\xaa\xe1\x91\x0e\xd1\x40\x2b\x35\xe2\x23\xd2\x3c\x7a\x5c\xd7\xd3\x6a\x7b\x6b\x6b\x36\x8d\xae\x86\x51\x09\x19\xb8\x0a\x46\x49\xe6\xea\xe0\x4a\x9c\x35\x08\x46\x39\xd4\x5b\x6e\x12\x95\xc0\xb3\xaa\xdc\x5a\x4a\x6f\x35\xe2\xcb\xfb\x8e\xa6\x65\x11\x67\xa1\x61\xee\x68\xd9\xd2\xf1\xf9\x60\x88\xde\x7e\xd8\xdf\x1f\xa2\x01\x95\xc2\x2a\x2d\xa4\x69\x44\x32\xf1\xfb\xa9\x7e\x06\x3b\xfb\xe5\x5f\xaf\x9f\xdb\xdf\x7c\x72\xf6\xa6\xf8\x0d\x76\xe4\xd9\xef\xc7\xbf\x36\xd7\x19\xa1\x16\x13\x83\x19\x41\x84\x6c\x53\xb6\xcd\xf5\x48\x32\x6e\x79\x2b\xdd\xb3\x13\xe8\x6d\x6c\x71\xae\x3d\x4f\x34\xe0\x24\x61\x16\x0b\x0d\x06\x3b\x22\x19\x4e\x88\xe1\x22\x32\xe9\xa3\x97\x1d\xb6\xc4\x9d\xd8\x12\x6b\xb2\x25\x09\x35\x96\xb2\x56\xa4\x3c\x39\x71\x4f\x77\xb6\xce\xdf\xcf\xf5\x1f\xef\x3e\x1e\xa7\xf1\xd3\xd3\x13\x71\x98\x3f\x3f\xbc\xce\x96\xda\xa6\x72\x9b\xd9\x11\x25\x86\x29\xf5\x23\xd9\x0a\xcc\x71\xc5\x29\xc3\xde\x1a\x8b\x05\xe1\x80\x9d\x97\x1a\x13\x15\x88\x94\x4e\x83\x0b\x6c\xc9\x96\x21\x66\x44\x36\x66\x6b\x29\xbd\x0e\x5b\x5a\x6b\xaa\x05\x15\x8d\x88\xff\xc2\x93\x83\x3f\x5f\xbd\x33\x5f\x77\xf8\x9f\x7b\x1f\x3e\xef\xc6\x67\x09\x3f\x3d\xf8\xb4\xcb\x5e\x7c\xc7\xb6\x88\xdd\x26\x6a\x64\xb8\xb5\xc6\xfe\x48\xb6\x04\x97\x86\x18\xcb\x70\x70\xd1\x60\xa1\x8c\xc3\x8e\x78\x8f\xc1\xdb\x48\x80\x58\x08\x4e\x5c\xb0\x45\xe5\x5d\xd8\x5a\x48\xaf\xc5\x96\x51\x82\x4b\xdd\xe2\x3d\x79\x2b\xdc\xa4\xf8\xfd\xd3\x5f\x7f\x7f\x78\xc9\x3e\x16\x87\xf1\xe0\x15\x7d\xf7\xea\xdd\x79\x29\x9f\x5d\x65\x4b\x22\xca\xb7\xa5\xdc\x66\x64\xd4\x30\x4d\x7f\x28\x5b\xcc\x88\xc8\xac\xf4\x58\x52\x93\x60\x11\x95\xc6\xd6\x5a\xc0\x56\x58\x65\x22\x01\x88\x96\x5c\xb0\xc5\xec\x5d\xd8\x5a\x48\xaf\xc3\x96\x51\x4c\x48\xb9\xb0\x2d\x96\x8d\x8b\x0f\xf3\x79\x5e\x7c\xe2\xd2\x4e\x53\xb6\x97\xbb\xc3\xad\xaf\xd5\x71\x9d\x76\x47\xa2\xc5\x94\x20\xc6\xb7\x29\xdd\xa6\x64\x64\x98\xb4\x46\xde\x81\xad\x65\x1c\xd1\x99\x84\x88\x22\x4a\xb8\xd8\xcc\x12\x02\x0b\x4b\x04\xb6\x4e\x01\x4e\xa2\x50\x52\x5a\x1e\xa9\x6f\xfd\x46\x55\x3b\x9f\x41\x53\xfa\x1f\x15\xde\x46\xd5\xed\x50\x6a\x11\x91\x8d\xf9\x73\x31\x62\x8a\x32\x41\xd7\x50\xb1\xb7\xeb\xbc\x0d\x0a\x65\xc6\x9b\xc0\x2c\x96\x44\x36\xc3\x44\x70\x6c\x40\x69\xec\xa8\x23\xc0\x83\x12\x34\xb4\x86\xe6\xa1\x76\x2d\x90\x24\xe8\x84\xf3\x9b\x81\x08\xce\xc5\xcf\x00\xe2\x8c\x76\x84\x37\x7d\xd2\x4c\xbf\x42\x3b\x8a\x4d\x0c\x02\x73\x49\xb4\x77\x60\x29\x40\x4b\xb0\xcb\xa6\xe3\x05\x12\x9a\x78\x6f\xfe\x9f\x2e\x91\x5a\xae\x85\xa4\xef\x18\xfa\x06\xc9\x22\x72\xbd\x04\x62\x1d\x8b\xe0\x35\xc1\x5c\x7b\xc0\x82\x30\x85\x8d\xe4\x09\xf6\x49\x8c\xca\x73\xa1\xbd\x6f\x4d\xea\x70\x65\x5c\x7b\x45\x89\x2e\xc7\x10\x0a\xd9\xac\xaa\xa1\x6c\x82\x9a\xc4\x65\x15\x0c\x51\x5d\xce\x56\xdf\xcb\xaa\xc1\x8b\x59\x59\x4c\x61\x6b\x07\xca\x6c\x11\xfe\x51\x89\x26\x69\x3e\xab\xa1\x11\x64\x43\x34\x50\xa4\x53\x71\x03\x47\x96\x28\xb6\x0e\x47\x6b\x8e\x9c\x5b\xa8\xe2\x09\x50\x22\x2c\xc1\x31\x6a\x8e\x85\x17\x16\x7b\xcd\x1c\x66\xc6\x05\x6a\x5d\x48\x42\x0c\x4d\x6b\x3b\x4b\xe3\x7d\x57\x16\x93\xa2\x86\x88\x5a\x23\x40\x4b\x7f\x55\x0d\x51\x63\x50\xae\x0e\x63\xe4\x67\xc7\x15\xaa\xa6\x10\xd2\x24\x0d\x4d\xf5\x59\x31\x2b\x51\x28\xf2\x24\x3d\x9e\x2d\x32\x95\xc1\x55\x3e\xef\x81\x55\xcd\x99\x58\xcb\xf2\xd6\x1a\xc4\xb7\x70\x2a\xbd\xa1\x44\x19\x82\x81\x2b\x87\x85\xd1\xb6\x89\x37\x1c\x16\x89\x35\x16\x0c\xf1\xc6\xb6\x6d\x3d\xbb\x18\x47\xef\x4b\x17\x4e\x2a\x14\x66\x65\x09\x79\x8d\x22\xcc\x21\x2b\xa6\x4d\x58\x8d\x4e\x8b\xf2\xa4\xcd\x82\xd2\xea\x82\xec\x88\x92\x12\xbe\xcc\x20\xaf\xb3\xb3\xbb\x18\x68\x33\x13\xf1\x1e\x54\x0a\x4b\xd7\xf2\xab\xeb\xb9\x91\x6f\xb8\xbc\x98\xd0\xdc\x62\x20\xae\x38\xf5\xcc\x53\x05\x0c\xb0\xd4\x89\xc1\x42\x6b\x89\x0d\xd3\x09\x36\x09\xf1\x94\x3a\xb0\x3e\xb6\x56\x3f\x2d\xaa\x3a\xcd\xab\xda\x65\x59\xf3\xb3\x0d\x0f\xcc\xee\x8e\xa9\xdf\x00\x79\x63\x9e\x9f\xfd\x2d\xff\xfc\xfb\xf4\xfc\xf9\xfe\xd9\xfb\x78\xf2\xea\xf3\x1f\x5b\x9f\x8e\x93\xdf\xff\xca\xd9\x9f\xc7\x1f\xde\x14\x27\xe1\xd7\x4b\x3e\xaf\xd0\x3a\x18\x74\xfe\x7f\x37\xb0\xe7\x8c\x99\x16\x55\xaf\xf4\xa5\x27\xe8\x28\x1d\x0b\x3e\xe1\xb8\x31\x28\x2c\xc0\x04\x6c\x0c\x18\xac\x62\x62\x69\x12\x98\x12\x41\xdd\x00\xfa\xe0\xc3\xcb\x7c\xf2\x4e\xd2\xf1\x54\x9f\x9f\x3d\x7d\xfa\xb4\x90\xc9\xce\xeb\xd3\x17\xd9\xeb\xfc\xfd\xb3\x49\xa5\xb7\xf2\xcf\xf9\xc9\xd7\x59\x9d\x6f\x1d\xbc\x5e\x1b\xf4\x2a\x3e\xa7\x6a\x11\x14\xf4\x9a\x80\x7a\x62\x66\xd6\x06\x29\x22\xc5\x9c\x0b\x81\x85\x03\x8b\x8d\x8b\x0c\xcb\xa0\x78\x94\x2a\xaa\xb0\x08\x63\xbe\x83\xf9\x70\x77\x6e\xec\xcb\x4f\xe7\x5f\xf5\xeb\xaf\x4f\xdf\x67\x9f\xbf\xf8\xb7\x55\xd4\x45\xae\x64\x51\x7c\xfc\xb2\x73\x1e\x76\xcb\xfd\xbd\x7d\x71\xba\x3b\x3e\xd8\xa0\xa3\x17\x51\xb6\x65\x5a\xb4\xf9\x67\xbf\x5c\xa2\x27\x68\x2d\x4c\x4c\x64\x12\x30\x65\x4e\x62\x11\x5d\xc4\x4e\x53\xc0\x42\xc9\x10\xa8\x52\x86\x08\x73\x03\x68\xfb\xea\x43\x25\x4e\xc7\xe9\x79\x72\x36\xf7\x62\x72\x9c\x3d\xfd\xe8\xde\xba\x8f\xfc\xaf\xfd\x83\x4f\xa7\xd5\x47\xfa\xf2\xd5\xdb\x57\xbf\xbd\x9d\x86\xbd\x63\xb1\x1e\xe8\x4e\xb0\x6c\x98\x64\xa2\x1d\x5e\xbd\x52\x82\x9e\xa0\x6d\x88\x42\x8b\x20\x31\x24\x8e\x37\xce\xc2\x36\x93\x3d\xc3\xd2\xc4\xe8\x8d\x64\x10\xcd\x4d\x3d\x4d\x0f\xed\xf9\xc1\xee\xfe\xcb\xcf\x13\x48\x3e\xe5\x2f\xb6\xdc\x5e\x98\xee\x7e\xde\xa7\x6f\xab\xe3\xd9\xab\xf1\xc1\xcb\xcf\xe4\xc3\xee\x44\x26\xe4\x8d\x35\x6b\x80\xbe\x1a\xf3\x5a\xca\xb5\x36\xbd\xa3\x92\xe5\x8a\xcd\xa1\x9b\x4c\x33\xb8\xb2\x32\x43\x37\x5d\xb3\x19\x5e\x84\x24\x57\xd7\x6f\xbc\x12\xd2\x10\x22\xb1\x49\x04\xc1\x42\x31\x8d\x3d\xe7\x1e\x7b\xd0\xc4\x69\x6a\x82\x30\x8b\xe8\xe6\x9a\x2a\x4d\xed\x6f\xb3\xaa\x46\x2e\xbf\xa2\x47\x5d\xa0\x6a\x5c\x9c\xa2\x7a\x0c\x28\xb8\xa9\xf3\x69\x96\xd6\x29\x54\xa8\x48\xd0\x5b\xf0\xa5\xab\x4e\x5c\xef\xf5\x9d\xe1\x20\x2d\x46\x27\x69\x3e\x2f\xb2\x93\x51\xd5\xea\x70\xd3\x9a\x4f\x8b\xbf\x3e\x9b\xc2\x10\xcd\xca\x6c\x88\x92\x34\x83\x05\x1d\x73\x28\xab\x96\x8a\x8e\x9a\x2d\x23\xae\x0c\xe3\x0e\x17\x92\x5a\xd9\x78\x49\x2c\x13\xc3\x30\xa5\x20\xb1\x8d\x9a\xe0\x04\x92\xc4\x50\x1b\x62\xb0\xc9\x60\x88\x44\x27\xd3\x3a\x3d\x3d\x5d\xa9\x97\x16\x6d\x16\x55\x43\x55\x1f\xd1\x11\x19\xb5\x36\xbe\x2a\xf4\x24\xfa\xa6\xcc\xf0\xee\xe8\x28\x53\x56\x27\x4e\x34\xe8\xf8\xdd\xd1\xf1\x0b\x74\xfc\x41\xa0\x33\x84\x08\xdf\xb8\x11\x99\x58\x7d\x77\x74\xe2\x02\x9d\x78\x10\xe8\xdc\xf2\xd3\xa0\x33\x77\x47\x27\x2f\xd0\xc9\x3b\xa0\xbb\xc8\xf8\x3a\x7e\x27\x14\x59\x51\x5e\x07\xb3\xe4\xe1\x7b\xc0\x7c\x02\x9c\x79\xd1\x00\x33\xe1\x66\x60\x83\x37\xae\x49\xa1\xda\x34\x91\x90\xdd\x5d\x42\xd6\x50\xbc\xaf\x6d\xdc\x0b\xc0\xe0\x59\x04\x70\xe6\x96\x51\xd7\xc9\x1e\xff\x47\x88\xb5\x7b\x7b\xeb\x00\xec\x39\xb4\xef\x05\x60\x5c\x7e\x6e\x03\xb8\xe7\xd2\x2c\xcd\x8f\x5b\x84\xcf\x9e\xad\x8b\xb0\xe7\x00\xb8\x2d\x97\xf7\xc1\x39\x65\x7c\xb8\xc5\xc3\x37\x89\x69\x44\x2f\x76\x19\x9a\x55\xf8\x14\xaa\x1a\xb3\x8b\xda\x65\x4e\xbf\xd8\xb2\xa8\x86\xa8\xb9\x8a\x42\xe1\xaa\xfa\x9f\x4c\xef\xfb\xd2\xd6\xd7\xfa\x7a\xf1\x72\x0b\xb7\x9a\x68\xc1\x94\x70\x98\x11\x4d\xb0\xf0\x46\x60\xab\x20\x62\xe3\x98\xb2\xd1\x3b\x49\x18\xfd\x96\x5b\x70\x55\x8d\xe9\x4d\xdc\x36\x57\xff\xfd\xdc\xf6\xe2\xe5\x36\xbb\xa5\x94\x18\xca\xdd\x6d\x76\x7b\xe0\xf0\x73\x98\xb7\xa5\x67\x6d\xa2\xdf\xcd\xfe\x57\xbc\x1e\x9e\xc5\x1c\xee\x94\xed\xdf\x17\xa7\x7d\xa7\x83\x5e\x7c\xdc\xc2\x69\x58\x7e\x6e\xe3\x74\xe9\xb8\xd0\x25\xb7\xab\x9a\x7f\x25\xc7\x7d\x1d\x76\x2f\x7e\xbe\xe1\xb8\xcd\xac\xf2\xb0\x0c\x79\xd2\x69\x67\x9e\xb8\xb8\xd4\x8e\x76\x4a\x46\xcd\xbf\x6b\x76\xdf\x43\x9e\x75\xe4\xaf\xa5\xc4\x3d\xe4\x79\x47\x9e\x6f\x20\x2f\x3a\xf2\xd7\xb2\xd3\x1e\xf2\xb2\x23\x7f\x6d\x1d\xa3\x87\xbc\xea\xc8\xab\x0d\xe4\x75\x47\x5e\x6f\x20\x6f\x3a\xf2\x66\x03\x79\xdb\x91\xbf\xb6\x7f\xdf\xc7\x7e\x48\xd7\x80\xc8\x26\x2d\x5c\x31\xc1\x4d\x6c\x90\x76\x8d\x90\xde\x68\x85\xdd\x03\x32\x9d\x3c\x6c\x99\x33\x2d\x4f\x8a\xb4\x51\xfb\xaa\xbc\x2a\x2c\x36\xdb\x56\x3f\xaf\x0e\x9f\xde\xee\x74\x83\x69\xfd\x3e\x95\x5f\x6f\x2e\xb8\x17\xe5\xd9\xc6\xca\xaf\x93\xe7\x3e\x38\xe6\xd7\x49\x63\x37\x8a\x58\xee\x53\xf9\x75\xb2\xd4\x7b\x52\x7e\x73\xb3\x51\x3f\x5f\x79\xda\x55\x9e\xaf\xa3\xbc\xfe\xf9\xca\x8b\x8d\x99\x37\x6b\x0d\xd8\x0d\x22\xca\x35\x6d\x5e\xaf\xa3\xbc\xfd\xf9\xca\x5f\xb1\x79\xb6\xd6\x24\xb5\xd6\xf2\xcc\xfd\x68\xbf\xb9\xd1\xd3\xf5\xe6\xd8\x87\xa6\xfd\x7a\x49\xec\x06\x41\xbe\x0b\x75\x3a\x4f\xeb\xb3\x95\xc6\x2b\x25\xf2\xe2\xf4\xf1\x13\xe4\x6a\x54\xa7\x13\x40\xe7\x45\x0e\x68\x30\xab\xc3\x00\xe1\x46\x12\xca\xb9\xcb\xd0\x80\xa3\x71\x31\x2b\x97\x7b\xc6\x62\x83\x45\xe4\xde\x2b\x0d\x7d\x33\xf4\xcb\xd8\xea\xc7\x22\x55\x2b\xa4\xb2\xed\xc4\xff\x2e\x52\xca\x56\x50\xf9\xe2\x2c\xc0\x7f\x17\xaa\x59\x41\x15\xff\x71\xfb\x65\x62\x05\x95\x2d\xd6\x23\x1e\x2e\xd4\x95\x4b\xad\x6a\x57\xcf\xaa\xa3\x71\x5a\xd5\x45\xf9\x1d\xe4\xdd\x1e\xeb\xc5\xc2\x65\x7f\xff\x84\x80\xf4\x36\x34\x72\x43\x34\xa8\xbb\xd2\xf4\x00\x71\xa9\x75\x71\xd9\x87\xdc\x4b\x7a\x43\x34\x48\x3c\xf0\x6e\x62\x77\x07\x86\x28\x41\x15\x84\x22\x8f\x0f\x14\xa3\xe8\xec\xe2\xf7\x0b\x70\xd4\x43\xb6\x45\xb9\x29\x9c\x7f\x8b\xcb\xe8\x0f\x4c\x3f\xe4\x7e\xd2\x9b\xc2\xf9\xd7\x38\x8d\xbb\x20\xfb\x59\x5e\x03\xe6\x90\xd7\xe8\xf1\xb4\x84\x79\x5a\xcc\xaa\xa3\xd5\x01\x0e\x28\xcb\xa2\x3c\x0a\x45\x84\xe1\x25\x13\xed\x76\xf9\x37\x5b\xe9\x6d\x0b\x47\xf5\xd9\x14\xda\x83\x58\x15\x64\x10\xea\xcb\xc3\x63\x1b\xa5\x71\x50\x8f\xd2\xb8\x78\xf5\xf1\xb2\x79\x04\x35\x3a\x1d\x43\xd9\x14\x46\x6d\xc5\xaf\x88\xb7\x1b\x56\x50\x8f\x4a\xa8\x66\x59\x8d\x7e\x45\xe4\xc6\x93\x66\xec\x07\xbc\x1d\xa8\x0d\x89\xca\x0a\x82\xad\x13\x66\x71\xc6\xdc\x98\x98\x60\x2b\xbd\x53\xdc\x7b\xb0\xc1\x0f\xbe\x7b\xba\x0c\xb5\xf8\x9f\xe5\x45\x3d\x86\x12\x55\xd7\xae\x0f\x51\x02\x90\xa1\xa4\x04\x40\x75\x81\x4a\x98\x14\x73\x40\x93\xc5\x0e\xd7\x1d\xde\x1c\xbc\xfb\x59\x1d\x48\x3c\x35\x2a\x58\x1c\x65\xf0\x58\xc4\x84\x61\xcb\x0d\xc3\x41\x18\x46\x41\xc4\x10\x84\xef\x9c\xd5\xd9\xde\xda\xca\x8a\xe0\xb2\x71\x51\xd5\xdb\x86\x90\xc5\xab\x38\x11\x26\xc5\xd1\x9c\x5e\xbc\xd8\xb3\x2a\xf4\x24\xf4\xfe\x4e\x22\x79\xc7\x8c\x4b\x84\xc1\x5e\x7a\x8b\x85\x22\x80\xad\x50\x0e\x83\x77\x96\xa8\x00\x3a\xba\x64\x0d\x74\xf4\x02\x1d\xbd\x03\xba\x1f\x72\x8e\xc5\xe9\x60\x82\x75\x02\x47\xe6\x38\x16\x5a\x46\xec\x41\x09\x6c\x29\x4d\x12\x13\x15\x58\xdb\xae\x86\x76\x4e\x22\x5d\xbe\x43\xd4\xd7\xce\x7b\xda\xc6\x6d\xc7\x58\x24\x75\x9c\x39\x67\x31\x97\x92\x61\x61\x93\x80\x1d\x33\x01\x2b\x29\xb8\x0f\x21\x21\x44\xd9\x4b\x5d\x11\x46\x71\xb1\x71\xfd\x7e\x0c\x28\x73\x35\x54\x35\xaa\xea\x59\x92\xa0\xd3\x34\xcb\x90\x07\xe4\xb2\x53\x77\x56\xa1\xc6\x5b\xfc\x93\x5b\xd6\x7d\x69\xeb\xdb\x37\xbd\x78\x79\xf2\xcb\xa3\xff\x0b\x00\x00\xff\xff\x43\xfe\x6c\x0d\x0d\x3f\x00\x00") func dbSample_dataSqlBytes() ([]byte, error) { return bindataRead( @@ -121,8 +121,8 @@ func dbSample_dataSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "db/sample_data.sql", size: 16109, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0x3c, 0x43, 0xae, 0x85, 0x22, 0x83, 0xf1, 0x1e, 0x53, 0xc9, 0x70, 0xbd, 0x49, 0xc0, 0xb3, 0x87, 0x92, 0x47, 0x79, 0x3, 0x1b, 0x2c, 0x9c, 0x87, 0x3a, 0x35, 0x40, 0xc, 0xe1, 0xd9, 0x5c}} + info := bindataFileInfo{name: "db/sample_data.sql", size: 16141, mode: os.FileMode(0644), modTime: time.Unix(1, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbf, 0x20, 0x5e, 0xf0, 0xfc, 0x21, 0x54, 0x6a, 0x25, 0x63, 0xa3, 0xc7, 0x7f, 0x33, 0x32, 0x3a, 0xa3, 0xbb, 0xbd, 0x16, 0x3d, 0xea, 0xef, 0xc0, 0xbd, 0x55, 0x6c, 0xc, 0x74, 0xe4, 0x1c, 0xd5}} return a, nil } diff --git a/backend/pkg/api/db/sample_data.sql b/backend/pkg/api/db/sample_data.sql index b02a97259..889c4e22e 100644 --- a/backend/pkg/api/db/sample_data.sql +++ b/backend/pkg/api/db/sample_data.sql @@ -35,7 +35,7 @@ insert into flatcar_action values ('748df5fc-12a5-4dad-a71e-465cc1668048', 'post insert into flatcar_action values ('9cd474c5-efa3-4989-9992-58ddb852ed84', 'postinstall', '', '1S9zQCLGjmefYnE/aFcpCjL1NsguHhQGj0UCm5f0M98=', false, false, true, '', '', '', '2019-09-10 23:11:10.913778', '284d295b-518f-4d67-999e-94968d0eed90'); -- Sample application 1 -insert into application (id, name, description, team_id) values ('b6458005-8f40-4627-b33b-be70a718c48e', 'Sample application', 'Just an application to show the capabilities of Nebraska', 'd89342dc-9214-441d-a4af-bdd837a3b239'); +insert into application (id, name, description, team_id, product_id) values ('b6458005-8f40-4627-b33b-be70a718c48e', 'Sample application', 'Just an application to show the capabilities of Nebraska', 'd89342dc-9214-441d-a4af-bdd837a3b239','io.kinvolk.sample'); insert into package (id, type, url, filename, version, application_id, arch) values ('5195d5a2-5f82-11e5-9d70-feff819cdc9f', 4, 'https://www.kinvolk.io/', 'test_1.0.2', '1.0.2', 'b6458005-8f40-4627-b33b-be70a718c48e', 1); insert into package (id, type, url, filename, version, application_id, arch) values ('12697fa4-5f83-11e5-9d70-feff819cdc9f', 4, 'https://www.kinvolk.io/', 'test_1.0.3', '1.0.3', 'b6458005-8f40-4627-b33b-be70a718c48e', 1); insert into package (id, type, url, filename, version, application_id, arch) values ('8004bad8-5f97-11e5-9d70-feff819cdc9f', 4, 'https://www.kinvolk.io/', 'test_1.0.4', '1.0.4', 'b6458005-8f40-4627-b33b-be70a718c48e', 1); diff --git a/backend/pkg/auth/oidc.go b/backend/pkg/auth/oidc.go index 31b2db2a6..98f76200f 100644 --- a/backend/pkg/auth/oidc.go +++ b/backend/pkg/auth/oidc.go @@ -17,6 +17,7 @@ import ( "github.com/tidwall/gjson" "golang.org/x/oauth2" + "github.com/kinvolk/nebraska/backend/pkg/codegen" "github.com/kinvolk/nebraska/backend/pkg/sessions" echosessions "github.com/kinvolk/nebraska/backend/pkg/sessions/echo" ) @@ -326,9 +327,7 @@ func (oa *oidcAuth) LoginToken(c echo.Context) error { session.Set("username", oidcToken.Subject) sessionSave(c, session, "login_token") - return c.JSON(http.StatusOK, map[string]string{ - "token": oidcTokenResp.AccessToken, - }) + return c.JSON(http.StatusOK, codegen.LoginToken{Token: oidcTokenResp.AccessToken}) } // tokenFromRequest extracts token from request header. If Authorization header is not present returns id_token query param . diff --git a/backend/pkg/codegen/client.gen.go b/backend/pkg/codegen/client.gen.go index 74c7e938d..17ce6b3b0 100644 --- a/backend/pkg/codegen/client.gen.go +++ b/backend/pkg/codegen/client.gen.go @@ -102,96 +102,96 @@ type ClientInterface interface { CreateApp(ctx context.Context, params *CreateAppParams, body CreateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteApp request - DeleteApp(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteApp(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetApp request - GetApp(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetApp(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateApp request with any body - UpdateAppWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateAppWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateApp(ctx context.Context, appID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateApp(ctx context.Context, appIDorProductID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PaginateChannels request - PaginateChannels(ctx context.Context, appID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + PaginateChannels(ctx context.Context, appIDorProductID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateChannel request with any body - CreateChannelWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateChannelWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateChannel(ctx context.Context, appID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateChannel(ctx context.Context, appIDorProductID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteChannel request - DeleteChannel(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteChannel(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetChannel request - GetChannel(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetChannel(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateChannel request with any body - UpdateChannelWithBody(ctx context.Context, appID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateChannelWithBody(ctx context.Context, appIDorProductID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateChannel(ctx context.Context, appID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateChannel(ctx context.Context, appIDorProductID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PaginateGroups request - PaginateGroups(ctx context.Context, appID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + PaginateGroups(ctx context.Context, appIDorProductID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateGroup request with any body - CreateGroupWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateGroupWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateGroup(ctx context.Context, appID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateGroup(ctx context.Context, appIDorProductID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteGroup request - DeleteGroup(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteGroup(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroup request - GetGroup(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroup(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateGroup request with any body - UpdateGroupWithBody(ctx context.Context, appID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateGroupWithBody(ctx context.Context, appIDorProductID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateGroup(ctx context.Context, appID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateGroup(ctx context.Context, appIDorProductID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroupInstances request - GetGroupInstances(ctx context.Context, appID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroupInstances(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInstance request - GetInstance(ctx context.Context, appID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetInstance(ctx context.Context, appIDorProductID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetInstanceStatusHistory request - GetInstanceStatusHistory(ctx context.Context, appID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetInstanceStatusHistory(ctx context.Context, appIDorProductID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroupInstanceStats request - GetGroupInstanceStats(ctx context.Context, appID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroupInstanceStats(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroupInstancesCount request - GetGroupInstancesCount(ctx context.Context, appID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroupInstancesCount(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroupStatusTimeline request - GetGroupStatusTimeline(ctx context.Context, appID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroupStatusTimeline(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroupVersionBreakdown request - GetGroupVersionBreakdown(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroupVersionBreakdown(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetGroupVersionTimeline request - GetGroupVersionTimeline(ctx context.Context, appID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) + GetGroupVersionTimeline(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PaginatePackages request - PaginatePackages(ctx context.Context, appID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + PaginatePackages(ctx context.Context, appIDorProductID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePackage request with any body - CreatePackageWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + CreatePackageWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreatePackage(ctx context.Context, appID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreatePackage(ctx context.Context, appIDorProductID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeletePackage request - DeletePackage(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) + DeletePackage(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetPackage request - GetPackage(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) + GetPackage(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdatePackage request with any body - UpdatePackageWithBody(ctx context.Context, appID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdatePackageWithBody(ctx context.Context, appIDorProductID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdatePackage(ctx context.Context, appID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdatePackage(ctx context.Context, appIDorProductID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // UpdateInstance request with any body UpdateInstanceWithBody(ctx context.Context, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -271,8 +271,8 @@ func (c *Client) CreateApp(ctx context.Context, params *CreateAppParams, body Cr return c.Client.Do(req) } -func (c *Client) DeleteApp(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteAppRequest(c.Server, appID) +func (c *Client) DeleteApp(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteAppRequest(c.Server, appIDorProductID) if err != nil { return nil, err } @@ -283,8 +283,8 @@ func (c *Client) DeleteApp(ctx context.Context, appID string, reqEditors ...Requ return c.Client.Do(req) } -func (c *Client) GetApp(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAppRequest(c.Server, appID) +func (c *Client) GetApp(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetAppRequest(c.Server, appIDorProductID) if err != nil { return nil, err } @@ -295,8 +295,8 @@ func (c *Client) GetApp(ctx context.Context, appID string, reqEditors ...Request return c.Client.Do(req) } -func (c *Client) UpdateAppWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateAppRequestWithBody(c.Server, appID, contentType, body) +func (c *Client) UpdateAppWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateAppRequestWithBody(c.Server, appIDorProductID, contentType, body) if err != nil { return nil, err } @@ -307,8 +307,8 @@ func (c *Client) UpdateAppWithBody(ctx context.Context, appID string, contentTyp return c.Client.Do(req) } -func (c *Client) UpdateApp(ctx context.Context, appID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateAppRequest(c.Server, appID, body) +func (c *Client) UpdateApp(ctx context.Context, appIDorProductID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateAppRequest(c.Server, appIDorProductID, body) if err != nil { return nil, err } @@ -319,8 +319,8 @@ func (c *Client) UpdateApp(ctx context.Context, appID string, body UpdateAppJSON return c.Client.Do(req) } -func (c *Client) PaginateChannels(ctx context.Context, appID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPaginateChannelsRequest(c.Server, appID, params) +func (c *Client) PaginateChannels(ctx context.Context, appIDorProductID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPaginateChannelsRequest(c.Server, appIDorProductID, params) if err != nil { return nil, err } @@ -331,8 +331,8 @@ func (c *Client) PaginateChannels(ctx context.Context, appID string, params *Pag return c.Client.Do(req) } -func (c *Client) CreateChannelWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateChannelRequestWithBody(c.Server, appID, contentType, body) +func (c *Client) CreateChannelWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateChannelRequestWithBody(c.Server, appIDorProductID, contentType, body) if err != nil { return nil, err } @@ -343,8 +343,8 @@ func (c *Client) CreateChannelWithBody(ctx context.Context, appID string, conten return c.Client.Do(req) } -func (c *Client) CreateChannel(ctx context.Context, appID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateChannelRequest(c.Server, appID, body) +func (c *Client) CreateChannel(ctx context.Context, appIDorProductID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateChannelRequest(c.Server, appIDorProductID, body) if err != nil { return nil, err } @@ -355,8 +355,8 @@ func (c *Client) CreateChannel(ctx context.Context, appID string, body CreateCha return c.Client.Do(req) } -func (c *Client) DeleteChannel(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteChannelRequest(c.Server, appID, channelID) +func (c *Client) DeleteChannel(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteChannelRequest(c.Server, appIDorProductID, channelID) if err != nil { return nil, err } @@ -367,8 +367,8 @@ func (c *Client) DeleteChannel(ctx context.Context, appID string, channelID stri return c.Client.Do(req) } -func (c *Client) GetChannel(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetChannelRequest(c.Server, appID, channelID) +func (c *Client) GetChannel(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetChannelRequest(c.Server, appIDorProductID, channelID) if err != nil { return nil, err } @@ -379,8 +379,8 @@ func (c *Client) GetChannel(ctx context.Context, appID string, channelID string, return c.Client.Do(req) } -func (c *Client) UpdateChannelWithBody(ctx context.Context, appID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateChannelRequestWithBody(c.Server, appID, channelID, contentType, body) +func (c *Client) UpdateChannelWithBody(ctx context.Context, appIDorProductID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateChannelRequestWithBody(c.Server, appIDorProductID, channelID, contentType, body) if err != nil { return nil, err } @@ -391,8 +391,8 @@ func (c *Client) UpdateChannelWithBody(ctx context.Context, appID string, channe return c.Client.Do(req) } -func (c *Client) UpdateChannel(ctx context.Context, appID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateChannelRequest(c.Server, appID, channelID, body) +func (c *Client) UpdateChannel(ctx context.Context, appIDorProductID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateChannelRequest(c.Server, appIDorProductID, channelID, body) if err != nil { return nil, err } @@ -403,8 +403,8 @@ func (c *Client) UpdateChannel(ctx context.Context, appID string, channelID stri return c.Client.Do(req) } -func (c *Client) PaginateGroups(ctx context.Context, appID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPaginateGroupsRequest(c.Server, appID, params) +func (c *Client) PaginateGroups(ctx context.Context, appIDorProductID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPaginateGroupsRequest(c.Server, appIDorProductID, params) if err != nil { return nil, err } @@ -415,8 +415,8 @@ func (c *Client) PaginateGroups(ctx context.Context, appID string, params *Pagin return c.Client.Do(req) } -func (c *Client) CreateGroupWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateGroupRequestWithBody(c.Server, appID, contentType, body) +func (c *Client) CreateGroupWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateGroupRequestWithBody(c.Server, appIDorProductID, contentType, body) if err != nil { return nil, err } @@ -427,8 +427,8 @@ func (c *Client) CreateGroupWithBody(ctx context.Context, appID string, contentT return c.Client.Do(req) } -func (c *Client) CreateGroup(ctx context.Context, appID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateGroupRequest(c.Server, appID, body) +func (c *Client) CreateGroup(ctx context.Context, appIDorProductID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateGroupRequest(c.Server, appIDorProductID, body) if err != nil { return nil, err } @@ -439,8 +439,8 @@ func (c *Client) CreateGroup(ctx context.Context, appID string, body CreateGroup return c.Client.Do(req) } -func (c *Client) DeleteGroup(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteGroupRequest(c.Server, appID, groupID) +func (c *Client) DeleteGroup(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteGroupRequest(c.Server, appIDorProductID, groupID) if err != nil { return nil, err } @@ -451,8 +451,8 @@ func (c *Client) DeleteGroup(ctx context.Context, appID string, groupID string, return c.Client.Do(req) } -func (c *Client) GetGroup(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupRequest(c.Server, appID, groupID) +func (c *Client) GetGroup(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupRequest(c.Server, appIDorProductID, groupID) if err != nil { return nil, err } @@ -463,8 +463,8 @@ func (c *Client) GetGroup(ctx context.Context, appID string, groupID string, req return c.Client.Do(req) } -func (c *Client) UpdateGroupWithBody(ctx context.Context, appID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateGroupRequestWithBody(c.Server, appID, groupID, contentType, body) +func (c *Client) UpdateGroupWithBody(ctx context.Context, appIDorProductID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateGroupRequestWithBody(c.Server, appIDorProductID, groupID, contentType, body) if err != nil { return nil, err } @@ -475,8 +475,8 @@ func (c *Client) UpdateGroupWithBody(ctx context.Context, appID string, groupID return c.Client.Do(req) } -func (c *Client) UpdateGroup(ctx context.Context, appID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateGroupRequest(c.Server, appID, groupID, body) +func (c *Client) UpdateGroup(ctx context.Context, appIDorProductID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateGroupRequest(c.Server, appIDorProductID, groupID, body) if err != nil { return nil, err } @@ -487,8 +487,8 @@ func (c *Client) UpdateGroup(ctx context.Context, appID string, groupID string, return c.Client.Do(req) } -func (c *Client) GetGroupInstances(ctx context.Context, appID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupInstancesRequest(c.Server, appID, groupID, params) +func (c *Client) GetGroupInstances(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupInstancesRequest(c.Server, appIDorProductID, groupID, params) if err != nil { return nil, err } @@ -499,8 +499,8 @@ func (c *Client) GetGroupInstances(ctx context.Context, appID string, groupID st return c.Client.Do(req) } -func (c *Client) GetInstance(ctx context.Context, appID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetInstanceRequest(c.Server, appID, groupID, instanceID) +func (c *Client) GetInstance(ctx context.Context, appIDorProductID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetInstanceRequest(c.Server, appIDorProductID, groupID, instanceID) if err != nil { return nil, err } @@ -511,8 +511,8 @@ func (c *Client) GetInstance(ctx context.Context, appID string, groupID string, return c.Client.Do(req) } -func (c *Client) GetInstanceStatusHistory(ctx context.Context, appID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetInstanceStatusHistoryRequest(c.Server, appID, groupID, instanceID, params) +func (c *Client) GetInstanceStatusHistory(ctx context.Context, appIDorProductID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetInstanceStatusHistoryRequest(c.Server, appIDorProductID, groupID, instanceID, params) if err != nil { return nil, err } @@ -523,8 +523,8 @@ func (c *Client) GetInstanceStatusHistory(ctx context.Context, appID string, gro return c.Client.Do(req) } -func (c *Client) GetGroupInstanceStats(ctx context.Context, appID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupInstanceStatsRequest(c.Server, appID, groupID, params) +func (c *Client) GetGroupInstanceStats(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupInstanceStatsRequest(c.Server, appIDorProductID, groupID, params) if err != nil { return nil, err } @@ -535,8 +535,8 @@ func (c *Client) GetGroupInstanceStats(ctx context.Context, appID string, groupI return c.Client.Do(req) } -func (c *Client) GetGroupInstancesCount(ctx context.Context, appID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupInstancesCountRequest(c.Server, appID, groupID, params) +func (c *Client) GetGroupInstancesCount(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupInstancesCountRequest(c.Server, appIDorProductID, groupID, params) if err != nil { return nil, err } @@ -547,8 +547,8 @@ func (c *Client) GetGroupInstancesCount(ctx context.Context, appID string, group return c.Client.Do(req) } -func (c *Client) GetGroupStatusTimeline(ctx context.Context, appID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupStatusTimelineRequest(c.Server, appID, groupID, params) +func (c *Client) GetGroupStatusTimeline(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupStatusTimelineRequest(c.Server, appIDorProductID, groupID, params) if err != nil { return nil, err } @@ -559,8 +559,8 @@ func (c *Client) GetGroupStatusTimeline(ctx context.Context, appID string, group return c.Client.Do(req) } -func (c *Client) GetGroupVersionBreakdown(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupVersionBreakdownRequest(c.Server, appID, groupID) +func (c *Client) GetGroupVersionBreakdown(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupVersionBreakdownRequest(c.Server, appIDorProductID, groupID) if err != nil { return nil, err } @@ -571,8 +571,8 @@ func (c *Client) GetGroupVersionBreakdown(ctx context.Context, appID string, gro return c.Client.Do(req) } -func (c *Client) GetGroupVersionTimeline(ctx context.Context, appID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetGroupVersionTimelineRequest(c.Server, appID, groupID, params) +func (c *Client) GetGroupVersionTimeline(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetGroupVersionTimelineRequest(c.Server, appIDorProductID, groupID, params) if err != nil { return nil, err } @@ -583,8 +583,8 @@ func (c *Client) GetGroupVersionTimeline(ctx context.Context, appID string, grou return c.Client.Do(req) } -func (c *Client) PaginatePackages(ctx context.Context, appID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPaginatePackagesRequest(c.Server, appID, params) +func (c *Client) PaginatePackages(ctx context.Context, appIDorProductID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPaginatePackagesRequest(c.Server, appIDorProductID, params) if err != nil { return nil, err } @@ -595,8 +595,8 @@ func (c *Client) PaginatePackages(ctx context.Context, appID string, params *Pag return c.Client.Do(req) } -func (c *Client) CreatePackageWithBody(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackageRequestWithBody(c.Server, appID, contentType, body) +func (c *Client) CreatePackageWithBody(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePackageRequestWithBody(c.Server, appIDorProductID, contentType, body) if err != nil { return nil, err } @@ -607,8 +607,8 @@ func (c *Client) CreatePackageWithBody(ctx context.Context, appID string, conten return c.Client.Do(req) } -func (c *Client) CreatePackage(ctx context.Context, appID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackageRequest(c.Server, appID, body) +func (c *Client) CreatePackage(ctx context.Context, appIDorProductID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePackageRequest(c.Server, appIDorProductID, body) if err != nil { return nil, err } @@ -619,8 +619,8 @@ func (c *Client) CreatePackage(ctx context.Context, appID string, body CreatePac return c.Client.Do(req) } -func (c *Client) DeletePackage(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackageRequest(c.Server, appID, packageID) +func (c *Client) DeletePackage(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePackageRequest(c.Server, appIDorProductID, packageID) if err != nil { return nil, err } @@ -631,8 +631,8 @@ func (c *Client) DeletePackage(ctx context.Context, appID string, packageID stri return c.Client.Do(req) } -func (c *Client) GetPackage(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackageRequest(c.Server, appID, packageID) +func (c *Client) GetPackage(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPackageRequest(c.Server, appIDorProductID, packageID) if err != nil { return nil, err } @@ -643,8 +643,8 @@ func (c *Client) GetPackage(ctx context.Context, appID string, packageID string, return c.Client.Do(req) } -func (c *Client) UpdatePackageWithBody(ctx context.Context, appID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackageRequestWithBody(c.Server, appID, packageID, contentType, body) +func (c *Client) UpdatePackageWithBody(ctx context.Context, appIDorProductID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePackageRequestWithBody(c.Server, appIDorProductID, packageID, contentType, body) if err != nil { return nil, err } @@ -655,8 +655,8 @@ func (c *Client) UpdatePackageWithBody(ctx context.Context, appID string, packag return c.Client.Do(req) } -func (c *Client) UpdatePackage(ctx context.Context, appID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackageRequest(c.Server, appID, packageID, body) +func (c *Client) UpdatePackage(ctx context.Context, appIDorProductID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePackageRequest(c.Server, appIDorProductID, packageID, body) if err != nil { return nil, err } @@ -808,9 +808,9 @@ func NewPaginateActivityRequest(server string, params *PaginateActivityParams) ( queryValues := queryURL.Query() - if params.AppID != nil { + if params.AppIDorProductID != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "appID", runtime.ParamLocationQuery, *params.AppID); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "appIDorProductID", runtime.ParamLocationQuery, *params.AppIDorProductID); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -1094,12 +1094,12 @@ func NewCreateAppRequestWithBody(server string, params *CreateAppParams, content } // NewDeleteAppRequest generates requests for DeleteApp -func NewDeleteAppRequest(server string, appID string) (*http.Request, error) { +func NewDeleteAppRequest(server string, appIDorProductID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1128,12 +1128,12 @@ func NewDeleteAppRequest(server string, appID string) (*http.Request, error) { } // NewGetAppRequest generates requests for GetApp -func NewGetAppRequest(server string, appID string) (*http.Request, error) { +func NewGetAppRequest(server string, appIDorProductID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1162,23 +1162,23 @@ func NewGetAppRequest(server string, appID string) (*http.Request, error) { } // NewUpdateAppRequest calls the generic UpdateApp builder with application/json body -func NewUpdateAppRequest(server string, appID string, body UpdateAppJSONRequestBody) (*http.Request, error) { +func NewUpdateAppRequest(server string, appIDorProductID string, body UpdateAppJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateAppRequestWithBody(server, appID, "application/json", bodyReader) + return NewUpdateAppRequestWithBody(server, appIDorProductID, "application/json", bodyReader) } // NewUpdateAppRequestWithBody generates requests for UpdateApp with any type of body -func NewUpdateAppRequestWithBody(server string, appID string, contentType string, body io.Reader) (*http.Request, error) { +func NewUpdateAppRequestWithBody(server string, appIDorProductID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1209,12 +1209,12 @@ func NewUpdateAppRequestWithBody(server string, appID string, contentType string } // NewPaginateChannelsRequest generates requests for PaginateChannels -func NewPaginateChannelsRequest(server string, appID string, params *PaginateChannelsParams) (*http.Request, error) { +func NewPaginateChannelsRequest(server string, appIDorProductID string, params *PaginateChannelsParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1279,23 +1279,23 @@ func NewPaginateChannelsRequest(server string, appID string, params *PaginateCha } // NewCreateChannelRequest calls the generic CreateChannel builder with application/json body -func NewCreateChannelRequest(server string, appID string, body CreateChannelJSONRequestBody) (*http.Request, error) { +func NewCreateChannelRequest(server string, appIDorProductID string, body CreateChannelJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateChannelRequestWithBody(server, appID, "application/json", bodyReader) + return NewCreateChannelRequestWithBody(server, appIDorProductID, "application/json", bodyReader) } // NewCreateChannelRequestWithBody generates requests for CreateChannel with any type of body -func NewCreateChannelRequestWithBody(server string, appID string, contentType string, body io.Reader) (*http.Request, error) { +func NewCreateChannelRequestWithBody(server string, appIDorProductID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1326,12 +1326,12 @@ func NewCreateChannelRequestWithBody(server string, appID string, contentType st } // NewDeleteChannelRequest generates requests for DeleteChannel -func NewDeleteChannelRequest(server string, appID string, channelID string) (*http.Request, error) { +func NewDeleteChannelRequest(server string, appIDorProductID string, channelID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1367,12 +1367,12 @@ func NewDeleteChannelRequest(server string, appID string, channelID string) (*ht } // NewGetChannelRequest generates requests for GetChannel -func NewGetChannelRequest(server string, appID string, channelID string) (*http.Request, error) { +func NewGetChannelRequest(server string, appIDorProductID string, channelID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1408,23 +1408,23 @@ func NewGetChannelRequest(server string, appID string, channelID string) (*http. } // NewUpdateChannelRequest calls the generic UpdateChannel builder with application/json body -func NewUpdateChannelRequest(server string, appID string, channelID string, body UpdateChannelJSONRequestBody) (*http.Request, error) { +func NewUpdateChannelRequest(server string, appIDorProductID string, channelID string, body UpdateChannelJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateChannelRequestWithBody(server, appID, channelID, "application/json", bodyReader) + return NewUpdateChannelRequestWithBody(server, appIDorProductID, channelID, "application/json", bodyReader) } // NewUpdateChannelRequestWithBody generates requests for UpdateChannel with any type of body -func NewUpdateChannelRequestWithBody(server string, appID string, channelID string, contentType string, body io.Reader) (*http.Request, error) { +func NewUpdateChannelRequestWithBody(server string, appIDorProductID string, channelID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1462,12 +1462,12 @@ func NewUpdateChannelRequestWithBody(server string, appID string, channelID stri } // NewPaginateGroupsRequest generates requests for PaginateGroups -func NewPaginateGroupsRequest(server string, appID string, params *PaginateGroupsParams) (*http.Request, error) { +func NewPaginateGroupsRequest(server string, appIDorProductID string, params *PaginateGroupsParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1532,23 +1532,23 @@ func NewPaginateGroupsRequest(server string, appID string, params *PaginateGroup } // NewCreateGroupRequest calls the generic CreateGroup builder with application/json body -func NewCreateGroupRequest(server string, appID string, body CreateGroupJSONRequestBody) (*http.Request, error) { +func NewCreateGroupRequest(server string, appIDorProductID string, body CreateGroupJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateGroupRequestWithBody(server, appID, "application/json", bodyReader) + return NewCreateGroupRequestWithBody(server, appIDorProductID, "application/json", bodyReader) } // NewCreateGroupRequestWithBody generates requests for CreateGroup with any type of body -func NewCreateGroupRequestWithBody(server string, appID string, contentType string, body io.Reader) (*http.Request, error) { +func NewCreateGroupRequestWithBody(server string, appIDorProductID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1579,12 +1579,12 @@ func NewCreateGroupRequestWithBody(server string, appID string, contentType stri } // NewDeleteGroupRequest generates requests for DeleteGroup -func NewDeleteGroupRequest(server string, appID string, groupID string) (*http.Request, error) { +func NewDeleteGroupRequest(server string, appIDorProductID string, groupID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1620,12 +1620,12 @@ func NewDeleteGroupRequest(server string, appID string, groupID string) (*http.R } // NewGetGroupRequest generates requests for GetGroup -func NewGetGroupRequest(server string, appID string, groupID string) (*http.Request, error) { +func NewGetGroupRequest(server string, appIDorProductID string, groupID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1661,23 +1661,23 @@ func NewGetGroupRequest(server string, appID string, groupID string) (*http.Requ } // NewUpdateGroupRequest calls the generic UpdateGroup builder with application/json body -func NewUpdateGroupRequest(server string, appID string, groupID string, body UpdateGroupJSONRequestBody) (*http.Request, error) { +func NewUpdateGroupRequest(server string, appIDorProductID string, groupID string, body UpdateGroupJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateGroupRequestWithBody(server, appID, groupID, "application/json", bodyReader) + return NewUpdateGroupRequestWithBody(server, appIDorProductID, groupID, "application/json", bodyReader) } // NewUpdateGroupRequestWithBody generates requests for UpdateGroup with any type of body -func NewUpdateGroupRequestWithBody(server string, appID string, groupID string, contentType string, body io.Reader) (*http.Request, error) { +func NewUpdateGroupRequestWithBody(server string, appIDorProductID string, groupID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1715,12 +1715,12 @@ func NewUpdateGroupRequestWithBody(server string, appID string, groupID string, } // NewGetGroupInstancesRequest generates requests for GetGroupInstances -func NewGetGroupInstancesRequest(server string, appID string, groupID string, params *GetGroupInstancesParams) (*http.Request, error) { +func NewGetGroupInstancesRequest(server string, appIDorProductID string, groupID string, params *GetGroupInstancesParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1896,12 +1896,12 @@ func NewGetGroupInstancesRequest(server string, appID string, groupID string, pa } // NewGetInstanceRequest generates requests for GetInstance -func NewGetInstanceRequest(server string, appID string, groupID string, instanceID string) (*http.Request, error) { +func NewGetInstanceRequest(server string, appIDorProductID string, groupID string, instanceID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -1944,12 +1944,12 @@ func NewGetInstanceRequest(server string, appID string, groupID string, instance } // NewGetInstanceStatusHistoryRequest generates requests for GetInstanceStatusHistory -func NewGetInstanceStatusHistoryRequest(server string, appID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams) (*http.Request, error) { +func NewGetInstanceStatusHistoryRequest(server string, appIDorProductID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2012,12 +2012,12 @@ func NewGetInstanceStatusHistoryRequest(server string, appID string, groupID str } // NewGetGroupInstanceStatsRequest generates requests for GetGroupInstanceStats -func NewGetGroupInstanceStatsRequest(server string, appID string, groupID string, params *GetGroupInstanceStatsParams) (*http.Request, error) { +func NewGetGroupInstanceStatsRequest(server string, appIDorProductID string, groupID string, params *GetGroupInstanceStatsParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2069,12 +2069,12 @@ func NewGetGroupInstanceStatsRequest(server string, appID string, groupID string } // NewGetGroupInstancesCountRequest generates requests for GetGroupInstancesCount -func NewGetGroupInstancesCountRequest(server string, appID string, groupID string, params *GetGroupInstancesCountParams) (*http.Request, error) { +func NewGetGroupInstancesCountRequest(server string, appIDorProductID string, groupID string, params *GetGroupInstancesCountParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2126,12 +2126,12 @@ func NewGetGroupInstancesCountRequest(server string, appID string, groupID strin } // NewGetGroupStatusTimelineRequest generates requests for GetGroupStatusTimeline -func NewGetGroupStatusTimelineRequest(server string, appID string, groupID string, params *GetGroupStatusTimelineParams) (*http.Request, error) { +func NewGetGroupStatusTimelineRequest(server string, appIDorProductID string, groupID string, params *GetGroupStatusTimelineParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2183,12 +2183,12 @@ func NewGetGroupStatusTimelineRequest(server string, appID string, groupID strin } // NewGetGroupVersionBreakdownRequest generates requests for GetGroupVersionBreakdown -func NewGetGroupVersionBreakdownRequest(server string, appID string, groupID string) (*http.Request, error) { +func NewGetGroupVersionBreakdownRequest(server string, appIDorProductID string, groupID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2224,12 +2224,12 @@ func NewGetGroupVersionBreakdownRequest(server string, appID string, groupID str } // NewGetGroupVersionTimelineRequest generates requests for GetGroupVersionTimeline -func NewGetGroupVersionTimelineRequest(server string, appID string, groupID string, params *GetGroupVersionTimelineParams) (*http.Request, error) { +func NewGetGroupVersionTimelineRequest(server string, appIDorProductID string, groupID string, params *GetGroupVersionTimelineParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2281,12 +2281,12 @@ func NewGetGroupVersionTimelineRequest(server string, appID string, groupID stri } // NewPaginatePackagesRequest generates requests for PaginatePackages -func NewPaginatePackagesRequest(server string, appID string, params *PaginatePackagesParams) (*http.Request, error) { +func NewPaginatePackagesRequest(server string, appIDorProductID string, params *PaginatePackagesParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2367,23 +2367,23 @@ func NewPaginatePackagesRequest(server string, appID string, params *PaginatePac } // NewCreatePackageRequest calls the generic CreatePackage builder with application/json body -func NewCreatePackageRequest(server string, appID string, body CreatePackageJSONRequestBody) (*http.Request, error) { +func NewCreatePackageRequest(server string, appIDorProductID string, body CreatePackageJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreatePackageRequestWithBody(server, appID, "application/json", bodyReader) + return NewCreatePackageRequestWithBody(server, appIDorProductID, "application/json", bodyReader) } // NewCreatePackageRequestWithBody generates requests for CreatePackage with any type of body -func NewCreatePackageRequestWithBody(server string, appID string, contentType string, body io.Reader) (*http.Request, error) { +func NewCreatePackageRequestWithBody(server string, appIDorProductID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2414,12 +2414,12 @@ func NewCreatePackageRequestWithBody(server string, appID string, contentType st } // NewDeletePackageRequest generates requests for DeletePackage -func NewDeletePackageRequest(server string, appID string, packageID string) (*http.Request, error) { +func NewDeletePackageRequest(server string, appIDorProductID string, packageID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2455,12 +2455,12 @@ func NewDeletePackageRequest(server string, appID string, packageID string) (*ht } // NewGetPackageRequest generates requests for GetPackage -func NewGetPackageRequest(server string, appID string, packageID string) (*http.Request, error) { +func NewGetPackageRequest(server string, appIDorProductID string, packageID string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2496,23 +2496,23 @@ func NewGetPackageRequest(server string, appID string, packageID string) (*http. } // NewUpdatePackageRequest calls the generic UpdatePackage builder with application/json body -func NewUpdatePackageRequest(server string, appID string, packageID string, body UpdatePackageJSONRequestBody) (*http.Request, error) { +func NewUpdatePackageRequest(server string, appIDorProductID string, packageID string, body UpdatePackageJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdatePackageRequestWithBody(server, appID, packageID, "application/json", bodyReader) + return NewUpdatePackageRequestWithBody(server, appIDorProductID, packageID, "application/json", bodyReader) } // NewUpdatePackageRequestWithBody generates requests for UpdatePackage with any type of body -func NewUpdatePackageRequestWithBody(server string, appID string, packageID string, contentType string, body io.Reader) (*http.Request, error) { +func NewUpdatePackageRequestWithBody(server string, appIDorProductID string, packageID string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appID", runtime.ParamLocationPath, appID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, appIDorProductID) if err != nil { return nil, err } @@ -2905,96 +2905,96 @@ type ClientWithResponsesInterface interface { CreateAppWithResponse(ctx context.Context, params *CreateAppParams, body CreateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAppResponse, error) // DeleteApp request - DeleteAppWithResponse(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*DeleteAppResponse, error) + DeleteAppWithResponse(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*DeleteAppResponse, error) // GetApp request - GetAppWithResponse(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*GetAppResponse, error) + GetAppWithResponse(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*GetAppResponse, error) // UpdateApp request with any body - UpdateAppWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) + UpdateAppWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) - UpdateAppWithResponse(ctx context.Context, appID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) + UpdateAppWithResponse(ctx context.Context, appIDorProductID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) // PaginateChannels request - PaginateChannelsWithResponse(ctx context.Context, appID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*PaginateChannelsResponse, error) + PaginateChannelsWithResponse(ctx context.Context, appIDorProductID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*PaginateChannelsResponse, error) // CreateChannel request with any body - CreateChannelWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) + CreateChannelWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) - CreateChannelWithResponse(ctx context.Context, appID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) + CreateChannelWithResponse(ctx context.Context, appIDorProductID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) // DeleteChannel request - DeleteChannelWithResponse(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*DeleteChannelResponse, error) + DeleteChannelWithResponse(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*DeleteChannelResponse, error) // GetChannel request - GetChannelWithResponse(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) + GetChannelWithResponse(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) // UpdateChannel request with any body - UpdateChannelWithBodyWithResponse(ctx context.Context, appID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) + UpdateChannelWithBodyWithResponse(ctx context.Context, appIDorProductID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) - UpdateChannelWithResponse(ctx context.Context, appID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) + UpdateChannelWithResponse(ctx context.Context, appIDorProductID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) // PaginateGroups request - PaginateGroupsWithResponse(ctx context.Context, appID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*PaginateGroupsResponse, error) + PaginateGroupsWithResponse(ctx context.Context, appIDorProductID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*PaginateGroupsResponse, error) // CreateGroup request with any body - CreateGroupWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) + CreateGroupWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) - CreateGroupWithResponse(ctx context.Context, appID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) + CreateGroupWithResponse(ctx context.Context, appIDorProductID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) // DeleteGroup request - DeleteGroupWithResponse(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*DeleteGroupResponse, error) + DeleteGroupWithResponse(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*DeleteGroupResponse, error) // GetGroup request - GetGroupWithResponse(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupResponse, error) + GetGroupWithResponse(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupResponse, error) // UpdateGroup request with any body - UpdateGroupWithBodyWithResponse(ctx context.Context, appID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) + UpdateGroupWithBodyWithResponse(ctx context.Context, appIDorProductID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) - UpdateGroupWithResponse(ctx context.Context, appID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) + UpdateGroupWithResponse(ctx context.Context, appIDorProductID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) // GetGroupInstances request - GetGroupInstancesWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesResponse, error) + GetGroupInstancesWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesResponse, error) // GetInstance request - GetInstanceWithResponse(ctx context.Context, appID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error) + GetInstanceWithResponse(ctx context.Context, appIDorProductID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error) // GetInstanceStatusHistory request - GetInstanceStatusHistoryWithResponse(ctx context.Context, appID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*GetInstanceStatusHistoryResponse, error) + GetInstanceStatusHistoryWithResponse(ctx context.Context, appIDorProductID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*GetInstanceStatusHistoryResponse, error) // GetGroupInstanceStats request - GetGroupInstanceStatsWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*GetGroupInstanceStatsResponse, error) + GetGroupInstanceStatsWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*GetGroupInstanceStatsResponse, error) // GetGroupInstancesCount request - GetGroupInstancesCountWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesCountResponse, error) + GetGroupInstancesCountWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesCountResponse, error) // GetGroupStatusTimeline request - GetGroupStatusTimelineWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupStatusTimelineResponse, error) + GetGroupStatusTimelineWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupStatusTimelineResponse, error) // GetGroupVersionBreakdown request - GetGroupVersionBreakdownWithResponse(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupVersionBreakdownResponse, error) + GetGroupVersionBreakdownWithResponse(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupVersionBreakdownResponse, error) // GetGroupVersionTimeline request - GetGroupVersionTimelineWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupVersionTimelineResponse, error) + GetGroupVersionTimelineWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupVersionTimelineResponse, error) // PaginatePackages request - PaginatePackagesWithResponse(ctx context.Context, appID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*PaginatePackagesResponse, error) + PaginatePackagesWithResponse(ctx context.Context, appIDorProductID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*PaginatePackagesResponse, error) // CreatePackage request with any body - CreatePackageWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) + CreatePackageWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) - CreatePackageWithResponse(ctx context.Context, appID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) + CreatePackageWithResponse(ctx context.Context, appIDorProductID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) // DeletePackage request - DeletePackageWithResponse(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) + DeletePackageWithResponse(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) // GetPackage request - GetPackageWithResponse(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) + GetPackageWithResponse(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) // UpdatePackage request with any body - UpdatePackageWithBodyWithResponse(ctx context.Context, appID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) + UpdatePackageWithBodyWithResponse(ctx context.Context, appIDorProductID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) - UpdatePackageWithResponse(ctx context.Context, appID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) + UpdatePackageWithResponse(ctx context.Context, appIDorProductID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) // UpdateInstance request with any body UpdateInstanceWithBodyWithResponse(ctx context.Context, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateInstanceResponse, error) @@ -3770,6 +3770,7 @@ func (r LoginCbResponse) StatusCode() int { type LoginTokenResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *LoginToken } // Status returns HTTPResponse.Status @@ -3887,8 +3888,8 @@ func (c *ClientWithResponses) CreateAppWithResponse(ctx context.Context, params } // DeleteAppWithResponse request returning *DeleteAppResponse -func (c *ClientWithResponses) DeleteAppWithResponse(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*DeleteAppResponse, error) { - rsp, err := c.DeleteApp(ctx, appID, reqEditors...) +func (c *ClientWithResponses) DeleteAppWithResponse(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*DeleteAppResponse, error) { + rsp, err := c.DeleteApp(ctx, appIDorProductID, reqEditors...) if err != nil { return nil, err } @@ -3896,8 +3897,8 @@ func (c *ClientWithResponses) DeleteAppWithResponse(ctx context.Context, appID s } // GetAppWithResponse request returning *GetAppResponse -func (c *ClientWithResponses) GetAppWithResponse(ctx context.Context, appID string, reqEditors ...RequestEditorFn) (*GetAppResponse, error) { - rsp, err := c.GetApp(ctx, appID, reqEditors...) +func (c *ClientWithResponses) GetAppWithResponse(ctx context.Context, appIDorProductID string, reqEditors ...RequestEditorFn) (*GetAppResponse, error) { + rsp, err := c.GetApp(ctx, appIDorProductID, reqEditors...) if err != nil { return nil, err } @@ -3905,16 +3906,16 @@ func (c *ClientWithResponses) GetAppWithResponse(ctx context.Context, appID stri } // UpdateAppWithBodyWithResponse request with arbitrary body returning *UpdateAppResponse -func (c *ClientWithResponses) UpdateAppWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { - rsp, err := c.UpdateAppWithBody(ctx, appID, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateAppWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { + rsp, err := c.UpdateAppWithBody(ctx, appIDorProductID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateAppResponse(rsp) } -func (c *ClientWithResponses) UpdateAppWithResponse(ctx context.Context, appID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { - rsp, err := c.UpdateApp(ctx, appID, body, reqEditors...) +func (c *ClientWithResponses) UpdateAppWithResponse(ctx context.Context, appIDorProductID string, body UpdateAppJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAppResponse, error) { + rsp, err := c.UpdateApp(ctx, appIDorProductID, body, reqEditors...) if err != nil { return nil, err } @@ -3922,8 +3923,8 @@ func (c *ClientWithResponses) UpdateAppWithResponse(ctx context.Context, appID s } // PaginateChannelsWithResponse request returning *PaginateChannelsResponse -func (c *ClientWithResponses) PaginateChannelsWithResponse(ctx context.Context, appID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*PaginateChannelsResponse, error) { - rsp, err := c.PaginateChannels(ctx, appID, params, reqEditors...) +func (c *ClientWithResponses) PaginateChannelsWithResponse(ctx context.Context, appIDorProductID string, params *PaginateChannelsParams, reqEditors ...RequestEditorFn) (*PaginateChannelsResponse, error) { + rsp, err := c.PaginateChannels(ctx, appIDorProductID, params, reqEditors...) if err != nil { return nil, err } @@ -3931,16 +3932,16 @@ func (c *ClientWithResponses) PaginateChannelsWithResponse(ctx context.Context, } // CreateChannelWithBodyWithResponse request with arbitrary body returning *CreateChannelResponse -func (c *ClientWithResponses) CreateChannelWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { - rsp, err := c.CreateChannelWithBody(ctx, appID, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateChannelWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { + rsp, err := c.CreateChannelWithBody(ctx, appIDorProductID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateChannelResponse(rsp) } -func (c *ClientWithResponses) CreateChannelWithResponse(ctx context.Context, appID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { - rsp, err := c.CreateChannel(ctx, appID, body, reqEditors...) +func (c *ClientWithResponses) CreateChannelWithResponse(ctx context.Context, appIDorProductID string, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { + rsp, err := c.CreateChannel(ctx, appIDorProductID, body, reqEditors...) if err != nil { return nil, err } @@ -3948,8 +3949,8 @@ func (c *ClientWithResponses) CreateChannelWithResponse(ctx context.Context, app } // DeleteChannelWithResponse request returning *DeleteChannelResponse -func (c *ClientWithResponses) DeleteChannelWithResponse(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*DeleteChannelResponse, error) { - rsp, err := c.DeleteChannel(ctx, appID, channelID, reqEditors...) +func (c *ClientWithResponses) DeleteChannelWithResponse(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*DeleteChannelResponse, error) { + rsp, err := c.DeleteChannel(ctx, appIDorProductID, channelID, reqEditors...) if err != nil { return nil, err } @@ -3957,8 +3958,8 @@ func (c *ClientWithResponses) DeleteChannelWithResponse(ctx context.Context, app } // GetChannelWithResponse request returning *GetChannelResponse -func (c *ClientWithResponses) GetChannelWithResponse(ctx context.Context, appID string, channelID string, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) { - rsp, err := c.GetChannel(ctx, appID, channelID, reqEditors...) +func (c *ClientWithResponses) GetChannelWithResponse(ctx context.Context, appIDorProductID string, channelID string, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) { + rsp, err := c.GetChannel(ctx, appIDorProductID, channelID, reqEditors...) if err != nil { return nil, err } @@ -3966,16 +3967,16 @@ func (c *ClientWithResponses) GetChannelWithResponse(ctx context.Context, appID } // UpdateChannelWithBodyWithResponse request with arbitrary body returning *UpdateChannelResponse -func (c *ClientWithResponses) UpdateChannelWithBodyWithResponse(ctx context.Context, appID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { - rsp, err := c.UpdateChannelWithBody(ctx, appID, channelID, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateChannelWithBodyWithResponse(ctx context.Context, appIDorProductID string, channelID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { + rsp, err := c.UpdateChannelWithBody(ctx, appIDorProductID, channelID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateChannelResponse(rsp) } -func (c *ClientWithResponses) UpdateChannelWithResponse(ctx context.Context, appID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { - rsp, err := c.UpdateChannel(ctx, appID, channelID, body, reqEditors...) +func (c *ClientWithResponses) UpdateChannelWithResponse(ctx context.Context, appIDorProductID string, channelID string, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { + rsp, err := c.UpdateChannel(ctx, appIDorProductID, channelID, body, reqEditors...) if err != nil { return nil, err } @@ -3983,8 +3984,8 @@ func (c *ClientWithResponses) UpdateChannelWithResponse(ctx context.Context, app } // PaginateGroupsWithResponse request returning *PaginateGroupsResponse -func (c *ClientWithResponses) PaginateGroupsWithResponse(ctx context.Context, appID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*PaginateGroupsResponse, error) { - rsp, err := c.PaginateGroups(ctx, appID, params, reqEditors...) +func (c *ClientWithResponses) PaginateGroupsWithResponse(ctx context.Context, appIDorProductID string, params *PaginateGroupsParams, reqEditors ...RequestEditorFn) (*PaginateGroupsResponse, error) { + rsp, err := c.PaginateGroups(ctx, appIDorProductID, params, reqEditors...) if err != nil { return nil, err } @@ -3992,16 +3993,16 @@ func (c *ClientWithResponses) PaginateGroupsWithResponse(ctx context.Context, ap } // CreateGroupWithBodyWithResponse request with arbitrary body returning *CreateGroupResponse -func (c *ClientWithResponses) CreateGroupWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) { - rsp, err := c.CreateGroupWithBody(ctx, appID, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateGroupWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) { + rsp, err := c.CreateGroupWithBody(ctx, appIDorProductID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateGroupResponse(rsp) } -func (c *ClientWithResponses) CreateGroupWithResponse(ctx context.Context, appID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) { - rsp, err := c.CreateGroup(ctx, appID, body, reqEditors...) +func (c *ClientWithResponses) CreateGroupWithResponse(ctx context.Context, appIDorProductID string, body CreateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateGroupResponse, error) { + rsp, err := c.CreateGroup(ctx, appIDorProductID, body, reqEditors...) if err != nil { return nil, err } @@ -4009,8 +4010,8 @@ func (c *ClientWithResponses) CreateGroupWithResponse(ctx context.Context, appID } // DeleteGroupWithResponse request returning *DeleteGroupResponse -func (c *ClientWithResponses) DeleteGroupWithResponse(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*DeleteGroupResponse, error) { - rsp, err := c.DeleteGroup(ctx, appID, groupID, reqEditors...) +func (c *ClientWithResponses) DeleteGroupWithResponse(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*DeleteGroupResponse, error) { + rsp, err := c.DeleteGroup(ctx, appIDorProductID, groupID, reqEditors...) if err != nil { return nil, err } @@ -4018,8 +4019,8 @@ func (c *ClientWithResponses) DeleteGroupWithResponse(ctx context.Context, appID } // GetGroupWithResponse request returning *GetGroupResponse -func (c *ClientWithResponses) GetGroupWithResponse(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupResponse, error) { - rsp, err := c.GetGroup(ctx, appID, groupID, reqEditors...) +func (c *ClientWithResponses) GetGroupWithResponse(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupResponse, error) { + rsp, err := c.GetGroup(ctx, appIDorProductID, groupID, reqEditors...) if err != nil { return nil, err } @@ -4027,16 +4028,16 @@ func (c *ClientWithResponses) GetGroupWithResponse(ctx context.Context, appID st } // UpdateGroupWithBodyWithResponse request with arbitrary body returning *UpdateGroupResponse -func (c *ClientWithResponses) UpdateGroupWithBodyWithResponse(ctx context.Context, appID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) { - rsp, err := c.UpdateGroupWithBody(ctx, appID, groupID, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateGroupWithBodyWithResponse(ctx context.Context, appIDorProductID string, groupID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) { + rsp, err := c.UpdateGroupWithBody(ctx, appIDorProductID, groupID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdateGroupResponse(rsp) } -func (c *ClientWithResponses) UpdateGroupWithResponse(ctx context.Context, appID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) { - rsp, err := c.UpdateGroup(ctx, appID, groupID, body, reqEditors...) +func (c *ClientWithResponses) UpdateGroupWithResponse(ctx context.Context, appIDorProductID string, groupID string, body UpdateGroupJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateGroupResponse, error) { + rsp, err := c.UpdateGroup(ctx, appIDorProductID, groupID, body, reqEditors...) if err != nil { return nil, err } @@ -4044,8 +4045,8 @@ func (c *ClientWithResponses) UpdateGroupWithResponse(ctx context.Context, appID } // GetGroupInstancesWithResponse request returning *GetGroupInstancesResponse -func (c *ClientWithResponses) GetGroupInstancesWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesResponse, error) { - rsp, err := c.GetGroupInstances(ctx, appID, groupID, params, reqEditors...) +func (c *ClientWithResponses) GetGroupInstancesWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesResponse, error) { + rsp, err := c.GetGroupInstances(ctx, appIDorProductID, groupID, params, reqEditors...) if err != nil { return nil, err } @@ -4053,8 +4054,8 @@ func (c *ClientWithResponses) GetGroupInstancesWithResponse(ctx context.Context, } // GetInstanceWithResponse request returning *GetInstanceResponse -func (c *ClientWithResponses) GetInstanceWithResponse(ctx context.Context, appID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error) { - rsp, err := c.GetInstance(ctx, appID, groupID, instanceID, reqEditors...) +func (c *ClientWithResponses) GetInstanceWithResponse(ctx context.Context, appIDorProductID string, groupID string, instanceID string, reqEditors ...RequestEditorFn) (*GetInstanceResponse, error) { + rsp, err := c.GetInstance(ctx, appIDorProductID, groupID, instanceID, reqEditors...) if err != nil { return nil, err } @@ -4062,8 +4063,8 @@ func (c *ClientWithResponses) GetInstanceWithResponse(ctx context.Context, appID } // GetInstanceStatusHistoryWithResponse request returning *GetInstanceStatusHistoryResponse -func (c *ClientWithResponses) GetInstanceStatusHistoryWithResponse(ctx context.Context, appID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*GetInstanceStatusHistoryResponse, error) { - rsp, err := c.GetInstanceStatusHistory(ctx, appID, groupID, instanceID, params, reqEditors...) +func (c *ClientWithResponses) GetInstanceStatusHistoryWithResponse(ctx context.Context, appIDorProductID string, groupID string, instanceID string, params *GetInstanceStatusHistoryParams, reqEditors ...RequestEditorFn) (*GetInstanceStatusHistoryResponse, error) { + rsp, err := c.GetInstanceStatusHistory(ctx, appIDorProductID, groupID, instanceID, params, reqEditors...) if err != nil { return nil, err } @@ -4071,8 +4072,8 @@ func (c *ClientWithResponses) GetInstanceStatusHistoryWithResponse(ctx context.C } // GetGroupInstanceStatsWithResponse request returning *GetGroupInstanceStatsResponse -func (c *ClientWithResponses) GetGroupInstanceStatsWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*GetGroupInstanceStatsResponse, error) { - rsp, err := c.GetGroupInstanceStats(ctx, appID, groupID, params, reqEditors...) +func (c *ClientWithResponses) GetGroupInstanceStatsWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstanceStatsParams, reqEditors ...RequestEditorFn) (*GetGroupInstanceStatsResponse, error) { + rsp, err := c.GetGroupInstanceStats(ctx, appIDorProductID, groupID, params, reqEditors...) if err != nil { return nil, err } @@ -4080,8 +4081,8 @@ func (c *ClientWithResponses) GetGroupInstanceStatsWithResponse(ctx context.Cont } // GetGroupInstancesCountWithResponse request returning *GetGroupInstancesCountResponse -func (c *ClientWithResponses) GetGroupInstancesCountWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesCountResponse, error) { - rsp, err := c.GetGroupInstancesCount(ctx, appID, groupID, params, reqEditors...) +func (c *ClientWithResponses) GetGroupInstancesCountWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupInstancesCountParams, reqEditors ...RequestEditorFn) (*GetGroupInstancesCountResponse, error) { + rsp, err := c.GetGroupInstancesCount(ctx, appIDorProductID, groupID, params, reqEditors...) if err != nil { return nil, err } @@ -4089,8 +4090,8 @@ func (c *ClientWithResponses) GetGroupInstancesCountWithResponse(ctx context.Con } // GetGroupStatusTimelineWithResponse request returning *GetGroupStatusTimelineResponse -func (c *ClientWithResponses) GetGroupStatusTimelineWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupStatusTimelineResponse, error) { - rsp, err := c.GetGroupStatusTimeline(ctx, appID, groupID, params, reqEditors...) +func (c *ClientWithResponses) GetGroupStatusTimelineWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupStatusTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupStatusTimelineResponse, error) { + rsp, err := c.GetGroupStatusTimeline(ctx, appIDorProductID, groupID, params, reqEditors...) if err != nil { return nil, err } @@ -4098,8 +4099,8 @@ func (c *ClientWithResponses) GetGroupStatusTimelineWithResponse(ctx context.Con } // GetGroupVersionBreakdownWithResponse request returning *GetGroupVersionBreakdownResponse -func (c *ClientWithResponses) GetGroupVersionBreakdownWithResponse(ctx context.Context, appID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupVersionBreakdownResponse, error) { - rsp, err := c.GetGroupVersionBreakdown(ctx, appID, groupID, reqEditors...) +func (c *ClientWithResponses) GetGroupVersionBreakdownWithResponse(ctx context.Context, appIDorProductID string, groupID string, reqEditors ...RequestEditorFn) (*GetGroupVersionBreakdownResponse, error) { + rsp, err := c.GetGroupVersionBreakdown(ctx, appIDorProductID, groupID, reqEditors...) if err != nil { return nil, err } @@ -4107,8 +4108,8 @@ func (c *ClientWithResponses) GetGroupVersionBreakdownWithResponse(ctx context.C } // GetGroupVersionTimelineWithResponse request returning *GetGroupVersionTimelineResponse -func (c *ClientWithResponses) GetGroupVersionTimelineWithResponse(ctx context.Context, appID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupVersionTimelineResponse, error) { - rsp, err := c.GetGroupVersionTimeline(ctx, appID, groupID, params, reqEditors...) +func (c *ClientWithResponses) GetGroupVersionTimelineWithResponse(ctx context.Context, appIDorProductID string, groupID string, params *GetGroupVersionTimelineParams, reqEditors ...RequestEditorFn) (*GetGroupVersionTimelineResponse, error) { + rsp, err := c.GetGroupVersionTimeline(ctx, appIDorProductID, groupID, params, reqEditors...) if err != nil { return nil, err } @@ -4116,8 +4117,8 @@ func (c *ClientWithResponses) GetGroupVersionTimelineWithResponse(ctx context.Co } // PaginatePackagesWithResponse request returning *PaginatePackagesResponse -func (c *ClientWithResponses) PaginatePackagesWithResponse(ctx context.Context, appID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*PaginatePackagesResponse, error) { - rsp, err := c.PaginatePackages(ctx, appID, params, reqEditors...) +func (c *ClientWithResponses) PaginatePackagesWithResponse(ctx context.Context, appIDorProductID string, params *PaginatePackagesParams, reqEditors ...RequestEditorFn) (*PaginatePackagesResponse, error) { + rsp, err := c.PaginatePackages(ctx, appIDorProductID, params, reqEditors...) if err != nil { return nil, err } @@ -4125,16 +4126,16 @@ func (c *ClientWithResponses) PaginatePackagesWithResponse(ctx context.Context, } // CreatePackageWithBodyWithResponse request with arbitrary body returning *CreatePackageResponse -func (c *ClientWithResponses) CreatePackageWithBodyWithResponse(ctx context.Context, appID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) { - rsp, err := c.CreatePackageWithBody(ctx, appID, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreatePackageWithBodyWithResponse(ctx context.Context, appIDorProductID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) { + rsp, err := c.CreatePackageWithBody(ctx, appIDorProductID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreatePackageResponse(rsp) } -func (c *ClientWithResponses) CreatePackageWithResponse(ctx context.Context, appID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) { - rsp, err := c.CreatePackage(ctx, appID, body, reqEditors...) +func (c *ClientWithResponses) CreatePackageWithResponse(ctx context.Context, appIDorProductID string, body CreatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackageResponse, error) { + rsp, err := c.CreatePackage(ctx, appIDorProductID, body, reqEditors...) if err != nil { return nil, err } @@ -4142,8 +4143,8 @@ func (c *ClientWithResponses) CreatePackageWithResponse(ctx context.Context, app } // DeletePackageWithResponse request returning *DeletePackageResponse -func (c *ClientWithResponses) DeletePackageWithResponse(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { - rsp, err := c.DeletePackage(ctx, appID, packageID, reqEditors...) +func (c *ClientWithResponses) DeletePackageWithResponse(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { + rsp, err := c.DeletePackage(ctx, appIDorProductID, packageID, reqEditors...) if err != nil { return nil, err } @@ -4151,8 +4152,8 @@ func (c *ClientWithResponses) DeletePackageWithResponse(ctx context.Context, app } // GetPackageWithResponse request returning *GetPackageResponse -func (c *ClientWithResponses) GetPackageWithResponse(ctx context.Context, appID string, packageID string, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) { - rsp, err := c.GetPackage(ctx, appID, packageID, reqEditors...) +func (c *ClientWithResponses) GetPackageWithResponse(ctx context.Context, appIDorProductID string, packageID string, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) { + rsp, err := c.GetPackage(ctx, appIDorProductID, packageID, reqEditors...) if err != nil { return nil, err } @@ -4160,16 +4161,16 @@ func (c *ClientWithResponses) GetPackageWithResponse(ctx context.Context, appID } // UpdatePackageWithBodyWithResponse request with arbitrary body returning *UpdatePackageResponse -func (c *ClientWithResponses) UpdatePackageWithBodyWithResponse(ctx context.Context, appID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) { - rsp, err := c.UpdatePackageWithBody(ctx, appID, packageID, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdatePackageWithBodyWithResponse(ctx context.Context, appIDorProductID string, packageID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) { + rsp, err := c.UpdatePackageWithBody(ctx, appIDorProductID, packageID, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseUpdatePackageResponse(rsp) } -func (c *ClientWithResponses) UpdatePackageWithResponse(ctx context.Context, appID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) { - rsp, err := c.UpdatePackage(ctx, appID, packageID, body, reqEditors...) +func (c *ClientWithResponses) UpdatePackageWithResponse(ctx context.Context, appIDorProductID string, packageID string, body UpdatePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackageResponse, error) { + rsp, err := c.UpdatePackage(ctx, appIDorProductID, packageID, body, reqEditors...) if err != nil { return nil, err } @@ -5092,6 +5093,16 @@ func ParseLoginTokenResponse(rsp *http.Response) (*LoginTokenResponse, error) { HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest LoginToken + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } diff --git a/backend/pkg/codegen/server.gen.go b/backend/pkg/codegen/server.gen.go index 703d71aef..9d29a652c 100644 --- a/backend/pkg/codegen/server.gen.go +++ b/backend/pkg/codegen/server.gen.go @@ -23,83 +23,83 @@ type ServerInterface interface { // (POST /api/apps) CreateApp(ctx echo.Context, params CreateAppParams) error - // (DELETE /api/apps/{appID}) - DeleteApp(ctx echo.Context, appID string) error + // (DELETE /api/apps/{appIDorProductID}) + DeleteApp(ctx echo.Context, appIDorProductID string) error - // (GET /api/apps/{appID}) - GetApp(ctx echo.Context, appID string) error + // (GET /api/apps/{appIDorProductID}) + GetApp(ctx echo.Context, appIDorProductID string) error - // (PUT /api/apps/{appID}) - UpdateApp(ctx echo.Context, appID string) error + // (PUT /api/apps/{appIDorProductID}) + UpdateApp(ctx echo.Context, appIDorProductID string) error - // (GET /api/apps/{appID}/channels) - PaginateChannels(ctx echo.Context, appID string, params PaginateChannelsParams) error + // (GET /api/apps/{appIDorProductID}/channels) + PaginateChannels(ctx echo.Context, appIDorProductID string, params PaginateChannelsParams) error - // (POST /api/apps/{appID}/channels) - CreateChannel(ctx echo.Context, appID string) error + // (POST /api/apps/{appIDorProductID}/channels) + CreateChannel(ctx echo.Context, appIDorProductID string) error - // (DELETE /api/apps/{appID}/channels/{channelID}) - DeleteChannel(ctx echo.Context, appID string, channelID string) error + // (DELETE /api/apps/{appIDorProductID}/channels/{channelID}) + DeleteChannel(ctx echo.Context, appIDorProductID string, channelID string) error - // (GET /api/apps/{appID}/channels/{channelID}) - GetChannel(ctx echo.Context, appID string, channelID string) error + // (GET /api/apps/{appIDorProductID}/channels/{channelID}) + GetChannel(ctx echo.Context, appIDorProductID string, channelID string) error - // (PUT /api/apps/{appID}/channels/{channelID}) - UpdateChannel(ctx echo.Context, appID string, channelID string) error + // (PUT /api/apps/{appIDorProductID}/channels/{channelID}) + UpdateChannel(ctx echo.Context, appIDorProductID string, channelID string) error - // (GET /api/apps/{appID}/groups) - PaginateGroups(ctx echo.Context, appID string, params PaginateGroupsParams) error + // (GET /api/apps/{appIDorProductID}/groups) + PaginateGroups(ctx echo.Context, appIDorProductID string, params PaginateGroupsParams) error - // (POST /api/apps/{appID}/groups) - CreateGroup(ctx echo.Context, appID string) error + // (POST /api/apps/{appIDorProductID}/groups) + CreateGroup(ctx echo.Context, appIDorProductID string) error - // (DELETE /api/apps/{appID}/groups/{groupID}) - DeleteGroup(ctx echo.Context, appID string, groupID string) error + // (DELETE /api/apps/{appIDorProductID}/groups/{groupID}) + DeleteGroup(ctx echo.Context, appIDorProductID string, groupID string) error - // (GET /api/apps/{appID}/groups/{groupID}) - GetGroup(ctx echo.Context, appID string, groupID string) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}) + GetGroup(ctx echo.Context, appIDorProductID string, groupID string) error - // (PUT /api/apps/{appID}/groups/{groupID}) - UpdateGroup(ctx echo.Context, appID string, groupID string) error + // (PUT /api/apps/{appIDorProductID}/groups/{groupID}) + UpdateGroup(ctx echo.Context, appIDorProductID string, groupID string) error - // (GET /api/apps/{appID}/groups/{groupID}/instances) - GetGroupInstances(ctx echo.Context, appID string, groupID string, params GetGroupInstancesParams) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/instances) + GetGroupInstances(ctx echo.Context, appIDorProductID string, groupID string, params GetGroupInstancesParams) error - // (GET /api/apps/{appID}/groups/{groupID}/instances/{instanceID}) - GetInstance(ctx echo.Context, appID string, groupID string, instanceID string) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/instances/{instanceID}) + GetInstance(ctx echo.Context, appIDorProductID string, groupID string, instanceID string) error - // (GET /api/apps/{appID}/groups/{groupID}/instances/{instanceID}/status_history) - GetInstanceStatusHistory(ctx echo.Context, appID string, groupID string, instanceID string, params GetInstanceStatusHistoryParams) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/instances/{instanceID}/status_history) + GetInstanceStatusHistory(ctx echo.Context, appIDorProductID string, groupID string, instanceID string, params GetInstanceStatusHistoryParams) error - // (GET /api/apps/{appID}/groups/{groupID}/instances_stats) - GetGroupInstanceStats(ctx echo.Context, appID string, groupID string, params GetGroupInstanceStatsParams) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/instances_stats) + GetGroupInstanceStats(ctx echo.Context, appIDorProductID string, groupID string, params GetGroupInstanceStatsParams) error - // (GET /api/apps/{appID}/groups/{groupID}/instancescount) - GetGroupInstancesCount(ctx echo.Context, appID string, groupID string, params GetGroupInstancesCountParams) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/instancescount) + GetGroupInstancesCount(ctx echo.Context, appIDorProductID string, groupID string, params GetGroupInstancesCountParams) error - // (GET /api/apps/{appID}/groups/{groupID}/status_timeline) - GetGroupStatusTimeline(ctx echo.Context, appID string, groupID string, params GetGroupStatusTimelineParams) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/status_timeline) + GetGroupStatusTimeline(ctx echo.Context, appIDorProductID string, groupID string, params GetGroupStatusTimelineParams) error - // (GET /api/apps/{appID}/groups/{groupID}/version_breakdown) - GetGroupVersionBreakdown(ctx echo.Context, appID string, groupID string) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/version_breakdown) + GetGroupVersionBreakdown(ctx echo.Context, appIDorProductID string, groupID string) error - // (GET /api/apps/{appID}/groups/{groupID}/version_timeline) - GetGroupVersionTimeline(ctx echo.Context, appID string, groupID string, params GetGroupVersionTimelineParams) error + // (GET /api/apps/{appIDorProductID}/groups/{groupID}/version_timeline) + GetGroupVersionTimeline(ctx echo.Context, appIDorProductID string, groupID string, params GetGroupVersionTimelineParams) error - // (GET /api/apps/{appID}/packages) - PaginatePackages(ctx echo.Context, appID string, params PaginatePackagesParams) error + // (GET /api/apps/{appIDorProductID}/packages) + PaginatePackages(ctx echo.Context, appIDorProductID string, params PaginatePackagesParams) error - // (POST /api/apps/{appID}/packages) - CreatePackage(ctx echo.Context, appID string) error + // (POST /api/apps/{appIDorProductID}/packages) + CreatePackage(ctx echo.Context, appIDorProductID string) error - // (DELETE /api/apps/{appID}/packages/{packageID}) - DeletePackage(ctx echo.Context, appID string, packageID string) error + // (DELETE /api/apps/{appIDorProductID}/packages/{packageID}) + DeletePackage(ctx echo.Context, appIDorProductID string, packageID string) error - // (GET /api/apps/{appID}/packages/{packageID}) - GetPackage(ctx echo.Context, appID string, packageID string) error + // (GET /api/apps/{appIDorProductID}/packages/{packageID}) + GetPackage(ctx echo.Context, appIDorProductID string, packageID string) error - // (PUT /api/apps/{appID}/packages/{packageID}) - UpdatePackage(ctx echo.Context, appID string, packageID string) error + // (PUT /api/apps/{appIDorProductID}/packages/{packageID}) + UpdatePackage(ctx echo.Context, appIDorProductID string, packageID string) error // (PUT /api/instances/{instanceID}) UpdateInstance(ctx echo.Context, instanceID string) error @@ -146,11 +146,11 @@ func (w *ServerInterfaceWrapper) PaginateActivity(ctx echo.Context) error { // Parameter object where we will unmarshal all parameters from the context var params PaginateActivityParams - // ------------- Optional query parameter "appID" ------------- + // ------------- Optional query parameter "appIDorProductID" ------------- - err = runtime.BindQueryParameter("form", true, false, "appID", ctx.QueryParams(), ¶ms.AppID) + err = runtime.BindQueryParameter("form", true, false, "appIDorProductID", ctx.QueryParams(), ¶ms.AppIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Optional query parameter "groupID" ------------- @@ -279,12 +279,12 @@ func (w *ServerInterfaceWrapper) CreateApp(ctx echo.Context) error { // DeleteApp converts echo context to params. func (w *ServerInterfaceWrapper) DeleteApp(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -294,19 +294,19 @@ func (w *ServerInterfaceWrapper) DeleteApp(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.DeleteApp(ctx, appID) + err = w.Handler.DeleteApp(ctx, appIDorProductID) return err } // GetApp converts echo context to params. func (w *ServerInterfaceWrapper) GetApp(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -316,19 +316,19 @@ func (w *ServerInterfaceWrapper) GetApp(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetApp(ctx, appID) + err = w.Handler.GetApp(ctx, appIDorProductID) return err } // UpdateApp converts echo context to params. func (w *ServerInterfaceWrapper) UpdateApp(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -338,19 +338,19 @@ func (w *ServerInterfaceWrapper) UpdateApp(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.UpdateApp(ctx, appID) + err = w.Handler.UpdateApp(ctx, appIDorProductID) return err } // PaginateChannels converts echo context to params. func (w *ServerInterfaceWrapper) PaginateChannels(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -376,19 +376,19 @@ func (w *ServerInterfaceWrapper) PaginateChannels(ctx echo.Context) error { } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PaginateChannels(ctx, appID, params) + err = w.Handler.PaginateChannels(ctx, appIDorProductID, params) return err } // CreateChannel converts echo context to params. func (w *ServerInterfaceWrapper) CreateChannel(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -398,19 +398,19 @@ func (w *ServerInterfaceWrapper) CreateChannel(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.CreateChannel(ctx, appID) + err = w.Handler.CreateChannel(ctx, appIDorProductID) return err } // DeleteChannel converts echo context to params. func (w *ServerInterfaceWrapper) DeleteChannel(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "channelID" ------------- @@ -428,19 +428,19 @@ func (w *ServerInterfaceWrapper) DeleteChannel(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.DeleteChannel(ctx, appID, channelID) + err = w.Handler.DeleteChannel(ctx, appIDorProductID, channelID) return err } // GetChannel converts echo context to params. func (w *ServerInterfaceWrapper) GetChannel(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "channelID" ------------- @@ -458,19 +458,19 @@ func (w *ServerInterfaceWrapper) GetChannel(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetChannel(ctx, appID, channelID) + err = w.Handler.GetChannel(ctx, appIDorProductID, channelID) return err } // UpdateChannel converts echo context to params. func (w *ServerInterfaceWrapper) UpdateChannel(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "channelID" ------------- @@ -488,19 +488,19 @@ func (w *ServerInterfaceWrapper) UpdateChannel(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.UpdateChannel(ctx, appID, channelID) + err = w.Handler.UpdateChannel(ctx, appIDorProductID, channelID) return err } // PaginateGroups converts echo context to params. func (w *ServerInterfaceWrapper) PaginateGroups(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -526,19 +526,19 @@ func (w *ServerInterfaceWrapper) PaginateGroups(ctx echo.Context) error { } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PaginateGroups(ctx, appID, params) + err = w.Handler.PaginateGroups(ctx, appIDorProductID, params) return err } // CreateGroup converts echo context to params. func (w *ServerInterfaceWrapper) CreateGroup(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -548,19 +548,19 @@ func (w *ServerInterfaceWrapper) CreateGroup(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.CreateGroup(ctx, appID) + err = w.Handler.CreateGroup(ctx, appIDorProductID) return err } // DeleteGroup converts echo context to params. func (w *ServerInterfaceWrapper) DeleteGroup(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -578,19 +578,19 @@ func (w *ServerInterfaceWrapper) DeleteGroup(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.DeleteGroup(ctx, appID, groupID) + err = w.Handler.DeleteGroup(ctx, appIDorProductID, groupID) return err } // GetGroup converts echo context to params. func (w *ServerInterfaceWrapper) GetGroup(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -608,19 +608,19 @@ func (w *ServerInterfaceWrapper) GetGroup(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroup(ctx, appID, groupID) + err = w.Handler.GetGroup(ctx, appIDorProductID, groupID) return err } // UpdateGroup converts echo context to params. func (w *ServerInterfaceWrapper) UpdateGroup(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -638,19 +638,19 @@ func (w *ServerInterfaceWrapper) UpdateGroup(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.UpdateGroup(ctx, appID, groupID) + err = w.Handler.UpdateGroup(ctx, appIDorProductID, groupID) return err } // GetGroupInstances converts echo context to params. func (w *ServerInterfaceWrapper) GetGroupInstances(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -733,19 +733,19 @@ func (w *ServerInterfaceWrapper) GetGroupInstances(ctx echo.Context) error { } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroupInstances(ctx, appID, groupID, params) + err = w.Handler.GetGroupInstances(ctx, appIDorProductID, groupID, params) return err } // GetInstance converts echo context to params. func (w *ServerInterfaceWrapper) GetInstance(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -771,19 +771,19 @@ func (w *ServerInterfaceWrapper) GetInstance(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetInstance(ctx, appID, groupID, instanceID) + err = w.Handler.GetInstance(ctx, appIDorProductID, groupID, instanceID) return err } // GetInstanceStatusHistory converts echo context to params. func (w *ServerInterfaceWrapper) GetInstanceStatusHistory(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -818,19 +818,19 @@ func (w *ServerInterfaceWrapper) GetInstanceStatusHistory(ctx echo.Context) erro } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetInstanceStatusHistory(ctx, appID, groupID, instanceID, params) + err = w.Handler.GetInstanceStatusHistory(ctx, appIDorProductID, groupID, instanceID, params) return err } // GetGroupInstanceStats converts echo context to params. func (w *ServerInterfaceWrapper) GetGroupInstanceStats(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -857,19 +857,19 @@ func (w *ServerInterfaceWrapper) GetGroupInstanceStats(ctx echo.Context) error { } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroupInstanceStats(ctx, appID, groupID, params) + err = w.Handler.GetGroupInstanceStats(ctx, appIDorProductID, groupID, params) return err } // GetGroupInstancesCount converts echo context to params. func (w *ServerInterfaceWrapper) GetGroupInstancesCount(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -896,19 +896,19 @@ func (w *ServerInterfaceWrapper) GetGroupInstancesCount(ctx echo.Context) error } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroupInstancesCount(ctx, appID, groupID, params) + err = w.Handler.GetGroupInstancesCount(ctx, appIDorProductID, groupID, params) return err } // GetGroupStatusTimeline converts echo context to params. func (w *ServerInterfaceWrapper) GetGroupStatusTimeline(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -935,19 +935,19 @@ func (w *ServerInterfaceWrapper) GetGroupStatusTimeline(ctx echo.Context) error } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroupStatusTimeline(ctx, appID, groupID, params) + err = w.Handler.GetGroupStatusTimeline(ctx, appIDorProductID, groupID, params) return err } // GetGroupVersionBreakdown converts echo context to params. func (w *ServerInterfaceWrapper) GetGroupVersionBreakdown(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -965,19 +965,19 @@ func (w *ServerInterfaceWrapper) GetGroupVersionBreakdown(ctx echo.Context) erro ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroupVersionBreakdown(ctx, appID, groupID) + err = w.Handler.GetGroupVersionBreakdown(ctx, appIDorProductID, groupID) return err } // GetGroupVersionTimeline converts echo context to params. func (w *ServerInterfaceWrapper) GetGroupVersionTimeline(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "groupID" ------------- @@ -1004,19 +1004,19 @@ func (w *ServerInterfaceWrapper) GetGroupVersionTimeline(ctx echo.Context) error } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetGroupVersionTimeline(ctx, appID, groupID, params) + err = w.Handler.GetGroupVersionTimeline(ctx, appIDorProductID, groupID, params) return err } // PaginatePackages converts echo context to params. func (w *ServerInterfaceWrapper) PaginatePackages(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -1049,19 +1049,19 @@ func (w *ServerInterfaceWrapper) PaginatePackages(ctx echo.Context) error { } // Invoke the callback with all the unmarshalled arguments - err = w.Handler.PaginatePackages(ctx, appID, params) + err = w.Handler.PaginatePackages(ctx, appIDorProductID, params) return err } // CreatePackage converts echo context to params. func (w *ServerInterfaceWrapper) CreatePackage(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } ctx.Set(OidcBearerAuthScopes, []string{""}) @@ -1071,19 +1071,19 @@ func (w *ServerInterfaceWrapper) CreatePackage(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.CreatePackage(ctx, appID) + err = w.Handler.CreatePackage(ctx, appIDorProductID) return err } // DeletePackage converts echo context to params. func (w *ServerInterfaceWrapper) DeletePackage(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "packageID" ------------- @@ -1101,19 +1101,19 @@ func (w *ServerInterfaceWrapper) DeletePackage(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.DeletePackage(ctx, appID, packageID) + err = w.Handler.DeletePackage(ctx, appIDorProductID, packageID) return err } // GetPackage converts echo context to params. func (w *ServerInterfaceWrapper) GetPackage(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "packageID" ------------- @@ -1131,19 +1131,19 @@ func (w *ServerInterfaceWrapper) GetPackage(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetPackage(ctx, appID, packageID) + err = w.Handler.GetPackage(ctx, appIDorProductID, packageID) return err } // UpdatePackage converts echo context to params. func (w *ServerInterfaceWrapper) UpdatePackage(ctx echo.Context) error { var err error - // ------------- Path parameter "appID" ------------- - var appID string + // ------------- Path parameter "appIDorProductID" ------------- + var appIDorProductID string - err = runtime.BindStyledParameterWithLocation("simple", false, "appID", runtime.ParamLocationPath, ctx.Param("appID"), &appID) + err = runtime.BindStyledParameterWithLocation("simple", false, "appIDorProductID", runtime.ParamLocationPath, ctx.Param("appIDorProductID"), &appIDorProductID) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appID: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter appIDorProductID: %s", err)) } // ------------- Path parameter "packageID" ------------- @@ -1161,7 +1161,7 @@ func (w *ServerInterfaceWrapper) UpdatePackage(ctx echo.Context) error { ctx.Set(GithubCookieAuthScopes, []string{""}) // Invoke the callback with all the unmarshalled arguments - err = w.Handler.UpdatePackage(ctx, appID, packageID) + err = w.Handler.UpdatePackage(ctx, appIDorProductID, packageID) return err } @@ -1340,32 +1340,32 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/api/activity", wrapper.PaginateActivity) router.GET(baseURL+"/api/apps", wrapper.PaginateApps) router.POST(baseURL+"/api/apps", wrapper.CreateApp) - router.DELETE(baseURL+"/api/apps/:appID", wrapper.DeleteApp) - router.GET(baseURL+"/api/apps/:appID", wrapper.GetApp) - router.PUT(baseURL+"/api/apps/:appID", wrapper.UpdateApp) - router.GET(baseURL+"/api/apps/:appID/channels", wrapper.PaginateChannels) - router.POST(baseURL+"/api/apps/:appID/channels", wrapper.CreateChannel) - router.DELETE(baseURL+"/api/apps/:appID/channels/:channelID", wrapper.DeleteChannel) - router.GET(baseURL+"/api/apps/:appID/channels/:channelID", wrapper.GetChannel) - router.PUT(baseURL+"/api/apps/:appID/channels/:channelID", wrapper.UpdateChannel) - router.GET(baseURL+"/api/apps/:appID/groups", wrapper.PaginateGroups) - router.POST(baseURL+"/api/apps/:appID/groups", wrapper.CreateGroup) - router.DELETE(baseURL+"/api/apps/:appID/groups/:groupID", wrapper.DeleteGroup) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID", wrapper.GetGroup) - router.PUT(baseURL+"/api/apps/:appID/groups/:groupID", wrapper.UpdateGroup) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/instances", wrapper.GetGroupInstances) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/instances/:instanceID", wrapper.GetInstance) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/instances/:instanceID/status_history", wrapper.GetInstanceStatusHistory) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/instances_stats", wrapper.GetGroupInstanceStats) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/instancescount", wrapper.GetGroupInstancesCount) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/status_timeline", wrapper.GetGroupStatusTimeline) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/version_breakdown", wrapper.GetGroupVersionBreakdown) - router.GET(baseURL+"/api/apps/:appID/groups/:groupID/version_timeline", wrapper.GetGroupVersionTimeline) - router.GET(baseURL+"/api/apps/:appID/packages", wrapper.PaginatePackages) - router.POST(baseURL+"/api/apps/:appID/packages", wrapper.CreatePackage) - router.DELETE(baseURL+"/api/apps/:appID/packages/:packageID", wrapper.DeletePackage) - router.GET(baseURL+"/api/apps/:appID/packages/:packageID", wrapper.GetPackage) - router.PUT(baseURL+"/api/apps/:appID/packages/:packageID", wrapper.UpdatePackage) + router.DELETE(baseURL+"/api/apps/:appIDorProductID", wrapper.DeleteApp) + router.GET(baseURL+"/api/apps/:appIDorProductID", wrapper.GetApp) + router.PUT(baseURL+"/api/apps/:appIDorProductID", wrapper.UpdateApp) + router.GET(baseURL+"/api/apps/:appIDorProductID/channels", wrapper.PaginateChannels) + router.POST(baseURL+"/api/apps/:appIDorProductID/channels", wrapper.CreateChannel) + router.DELETE(baseURL+"/api/apps/:appIDorProductID/channels/:channelID", wrapper.DeleteChannel) + router.GET(baseURL+"/api/apps/:appIDorProductID/channels/:channelID", wrapper.GetChannel) + router.PUT(baseURL+"/api/apps/:appIDorProductID/channels/:channelID", wrapper.UpdateChannel) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups", wrapper.PaginateGroups) + router.POST(baseURL+"/api/apps/:appIDorProductID/groups", wrapper.CreateGroup) + router.DELETE(baseURL+"/api/apps/:appIDorProductID/groups/:groupID", wrapper.DeleteGroup) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID", wrapper.GetGroup) + router.PUT(baseURL+"/api/apps/:appIDorProductID/groups/:groupID", wrapper.UpdateGroup) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/instances", wrapper.GetGroupInstances) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/instances/:instanceID", wrapper.GetInstance) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/instances/:instanceID/status_history", wrapper.GetInstanceStatusHistory) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/instances_stats", wrapper.GetGroupInstanceStats) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/instancescount", wrapper.GetGroupInstancesCount) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/status_timeline", wrapper.GetGroupStatusTimeline) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/version_breakdown", wrapper.GetGroupVersionBreakdown) + router.GET(baseURL+"/api/apps/:appIDorProductID/groups/:groupID/version_timeline", wrapper.GetGroupVersionTimeline) + router.GET(baseURL+"/api/apps/:appIDorProductID/packages", wrapper.PaginatePackages) + router.POST(baseURL+"/api/apps/:appIDorProductID/packages", wrapper.CreatePackage) + router.DELETE(baseURL+"/api/apps/:appIDorProductID/packages/:packageID", wrapper.DeletePackage) + router.GET(baseURL+"/api/apps/:appIDorProductID/packages/:packageID", wrapper.GetPackage) + router.PUT(baseURL+"/api/apps/:appIDorProductID/packages/:packageID", wrapper.UpdatePackage) router.PUT(baseURL+"/api/instances/:instanceID", wrapper.UpdateInstance) router.GET(baseURL+"/config", wrapper.GetConfig) router.GET(baseURL+"/health", wrapper.Health) diff --git a/backend/pkg/codegen/spec.gen.go b/backend/pkg/codegen/spec.gen.go index acf16b170..ee615a157 100644 --- a/backend/pkg/codegen/spec.gen.go +++ b/backend/pkg/codegen/spec.gen.go @@ -18,74 +18,75 @@ import ( // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "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", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/backend/pkg/codegen/types.gen.go b/backend/pkg/codegen/types.gen.go index 45c5be949..9192c7243 100644 --- a/backend/pkg/codegen/types.gen.go +++ b/backend/pkg/codegen/types.gen.go @@ -96,13 +96,13 @@ type ChannelPage struct { // Config defines model for config. type Config struct { - AccessManagementUrl string `json:"accessManagementUrl"` - AuthMode string `json:"authMode"` - HeaderStyle string `json:"headerStyle"` - LoginUrl string `json:"loginUrl"` + AccessManagementUrl string `json:"access_management_url"` + AuthMode string `json:"auth_mode"` + HeaderStyle string `json:"header_style"` + LoginUrl string `json:"login_url"` Logo string `json:"logo"` - LogoutUrl string `json:"logoutUrl"` - NebraskaVersion string `json:"nebraskaVersion"` + LogoutUrl string `json:"logout_url"` + NebraskaVersion string `json:"nebraska_version"` Title string `json:"title"` } @@ -250,6 +250,11 @@ type LoginInfo struct { Username string `json:"username"` } +// LoginToken defines model for loginToken. +type LoginToken struct { + Token string `json:"token"` +} + // OmahaRequest defines model for omahaRequest. type OmahaRequest = map[string]interface{} @@ -308,16 +313,16 @@ type VersionBreakdownEntry struct { // PaginateActivityParams defines parameters for PaginateActivity. type PaginateActivityParams struct { - AppID *string `form:"appID,omitempty" json:"appID,omitempty"` - GroupID *string `form:"groupID,omitempty" json:"groupID,omitempty"` - ChannelID *string `form:"channelID,omitempty" json:"channelID,omitempty"` - InstanceID *string `form:"instanceID,omitempty" json:"instanceID,omitempty"` - Version *string `form:"version,omitempty" json:"version,omitempty"` - Severity *int `form:"severity,omitempty" json:"severity,omitempty"` - Start string `form:"start" json:"start"` - End string `form:"end" json:"end"` - Page *int `form:"page,omitempty" json:"page,omitempty"` - Perpage *int `form:"perpage,omitempty" json:"perpage,omitempty"` + AppIDorProductID *string `form:"appIDorProductID,omitempty" json:"appIDorProductID,omitempty"` + GroupID *string `form:"groupID,omitempty" json:"groupID,omitempty"` + ChannelID *string `form:"channelID,omitempty" json:"channelID,omitempty"` + InstanceID *string `form:"instanceID,omitempty" json:"instanceID,omitempty"` + Version *string `form:"version,omitempty" json:"version,omitempty"` + Severity *int `form:"severity,omitempty" json:"severity,omitempty"` + Start string `form:"start" json:"start"` + End string `form:"end" json:"end"` + Page *int `form:"page,omitempty" json:"page,omitempty"` + Perpage *int `form:"perpage,omitempty" json:"perpage,omitempty"` } // PaginateAppsParams defines parameters for PaginateApps. diff --git a/backend/pkg/handler/activity.go b/backend/pkg/handler/activity.go index f8ceb7802..8a9f3819a 100644 --- a/backend/pkg/handler/activity.go +++ b/backend/pkg/handler/activity.go @@ -23,8 +23,12 @@ func (h *Handler) PaginateActivity(ctx echo.Context, params codegen.PaginateActi } var p api.ActivityQueryParams - if params.AppID != nil { - p.AppID = *params.AppID + if params.AppIDorProductID != nil { + appID, err := h.db.GetAppID(*params.AppIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, *params.AppIDorProductID) + } + p.AppID = appID } if params.GroupID != nil { p.GroupID = *params.GroupID diff --git a/backend/pkg/handler/app.go b/backend/pkg/handler/app.go index 5a7d8feac..38eb02a1c 100644 --- a/backend/pkg/handler/app.go +++ b/backend/pkg/handler/app.go @@ -56,7 +56,11 @@ func (h *Handler) CreateApp(ctx echo.Context, params codegen.CreateAppParams) er source := "" if params.CloneFrom != nil { - source = *params.CloneFrom + cloneAppID, err := h.db.GetAppID(*params.CloneFrom) + if err != nil { + return appNotFoundResponse(ctx, *params.CloneFrom) + } + source = cloneAppID } app, err = h.db.AddAppCloning(app, source) @@ -75,7 +79,13 @@ func (h *Handler) CreateApp(ctx echo.Context, params codegen.CreateAppParams) er return ctx.JSON(http.StatusOK, app) } -func (h *Handler) GetApp(ctx echo.Context, appID string) error { +func (h *Handler) GetApp(ctx echo.Context, appIDorProductID string) error { + + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + app, err := h.db.GetApp(appID) if err != nil { if err == sql.ErrNoRows { @@ -87,7 +97,7 @@ func (h *Handler) GetApp(ctx echo.Context, appID string) error { return ctx.JSON(http.StatusOK, app) } -func (h *Handler) UpdateApp(ctx echo.Context, appID string) error { +func (h *Handler) UpdateApp(ctx echo.Context, appIDorProductID string) error { logger := loggerWithUsername(logger, ctx) var request codegen.AppConfig @@ -97,6 +107,11 @@ func (h *Handler) UpdateApp(ctx echo.Context, appID string) error { return ctx.NoContent(http.StatusBadRequest) } + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + oldApp, err := h.db.GetApp(appID) if err != nil { logger.Error().Err(err).Str("appID", appID).Msg("updateApp - getting old app to update") @@ -122,9 +137,14 @@ func (h *Handler) UpdateApp(ctx echo.Context, appID string) error { return ctx.JSON(http.StatusOK, app) } -func (h *Handler) DeleteApp(ctx echo.Context, appID string) error { +func (h *Handler) DeleteApp(ctx echo.Context, appIDorProductID string) error { logger := loggerWithUsername(logger, ctx) + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + app, err := h.db.GetApp(appID) if err != nil { logger.Error().Err(err).Str("appID", appID).Msg("deleteApp - getting app to delete") diff --git a/backend/pkg/handler/channels.go b/backend/pkg/handler/channels.go index 8380c349f..3c22fb13a 100644 --- a/backend/pkg/handler/channels.go +++ b/backend/pkg/handler/channels.go @@ -11,7 +11,13 @@ import ( "github.com/kinvolk/nebraska/backend/pkg/codegen" ) -func (h *Handler) PaginateChannels(ctx echo.Context, appID string, params codegen.PaginateChannelsParams) error { +func (h *Handler) PaginateChannels(ctx echo.Context, appIDorProductID string, params codegen.PaginateChannelsParams) error { + + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + if params.Page == nil { params.Page = &defaultPage } @@ -37,7 +43,7 @@ func (h *Handler) PaginateChannels(ctx echo.Context, appID string, params codege return ctx.JSON(http.StatusOK, channelsPage{totalCount, len(channels), channels}) } -func (h *Handler) CreateChannel(ctx echo.Context, appID string) error { +func (h *Handler) CreateChannel(ctx echo.Context, appIDorProductID string) error { logger := loggerWithUsername(logger, ctx) var request codegen.ChannelConfig @@ -47,6 +53,10 @@ func (h *Handler) CreateChannel(ctx echo.Context, appID string) error { return ctx.NoContent(http.StatusBadRequest) } + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } channel := newChannel(appID, request.Arch, request.Color, request.Name, request.PackageId) _, err = h.db.AddChannel(channel) if err != nil { @@ -64,7 +74,7 @@ func (h *Handler) CreateChannel(ctx echo.Context, appID string) error { return ctx.JSON(http.StatusOK, channel) } -func (h *Handler) GetChannel(ctx echo.Context, appID string, channelID string) error { +func (h *Handler) GetChannel(ctx echo.Context, appIDorProductID string, channelID string) error { channel, err := h.db.GetChannel(channelID) if err != nil { if err == sql.ErrNoRows { @@ -76,12 +86,17 @@ func (h *Handler) GetChannel(ctx echo.Context, appID string, channelID string) e return ctx.JSON(http.StatusOK, channel) } -func (h *Handler) UpdateChannel(ctx echo.Context, appID string, channelID string) error { +func (h *Handler) UpdateChannel(ctx echo.Context, appIDorProductID string, channelID string) error { logger := loggerWithUsername(logger, ctx) + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + var request codegen.ChannelConfig - err := ctx.Bind(&request) + err = ctx.Bind(&request) if err != nil { logger.Error().Err(err).Msg("updateChannel") return ctx.NoContent(http.StatusBadRequest) @@ -116,7 +131,7 @@ func (h *Handler) UpdateChannel(ctx echo.Context, appID string, channelID string return ctx.JSON(http.StatusOK, channel) } -func (h *Handler) DeleteChannel(ctx echo.Context, appID string, channelID string) error { +func (h *Handler) DeleteChannel(ctx echo.Context, appIDorProductID string, channelID string) error { logger := loggerWithUsername(logger, ctx) channel, err := h.db.GetChannel(channelID) @@ -142,7 +157,9 @@ func newChannel(appID string, arch uint, color string, name string, packageID *s Name: name, Color: color, Arch: api.Arch(arch), - PackageID: null.StringFromPtr(packageID), + } + if packageID != nil && *packageID != "" { + channel.PackageID = null.StringFromPtr(packageID) } return channel } diff --git a/backend/pkg/handler/groups.go b/backend/pkg/handler/groups.go index 1507404e0..90022a8c3 100644 --- a/backend/pkg/handler/groups.go +++ b/backend/pkg/handler/groups.go @@ -11,7 +11,7 @@ import ( "github.com/kinvolk/nebraska/backend/pkg/codegen" ) -func (h *Handler) PaginateGroups(ctx echo.Context, appID string, params codegen.PaginateGroupsParams) error { +func (h *Handler) PaginateGroups(ctx echo.Context, appIDorProductID string, params codegen.PaginateGroupsParams) error { if params.Page == nil { params.Page = &defaultPage } @@ -20,6 +20,11 @@ func (h *Handler) PaginateGroups(ctx echo.Context, appID string, params codegen. params.Perpage = &defaultPerPage } + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + totalCount, err := h.db.GetGroupsCount(appID) if err != nil { logger.Error().Err(err).Str("appID", appID).Msg("getGroups count - getting groups") @@ -39,11 +44,16 @@ func (h *Handler) PaginateGroups(ctx echo.Context, appID string, params codegen. return ctx.JSON(http.StatusOK, groupsPage{totalCount, len(groups), groups}) } -func (h *Handler) CreateGroup(ctx echo.Context, appID string) error { +func (h *Handler) CreateGroup(ctx echo.Context, appIDorProductID string) error { logger := loggerWithUsername(logger, ctx) + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + var request codegen.GroupConfig - err := ctx.Bind(&request) + err = ctx.Bind(&request) if err != nil { logger.Error().Err(err).Msg("addGroup - decoding payload") return ctx.NoContent(http.StatusBadRequest) @@ -67,7 +77,7 @@ func (h *Handler) CreateGroup(ctx echo.Context, appID string) error { return ctx.JSON(http.StatusOK, group) } -func (h *Handler) GetGroup(ctx echo.Context, appID string, groupID string) error { +func (h *Handler) GetGroup(ctx echo.Context, appIDorProductID string, groupID string) error { group, err := h.db.GetGroup(groupID) if err != nil { if err == sql.ErrNoRows { @@ -80,11 +90,16 @@ func (h *Handler) GetGroup(ctx echo.Context, appID string, groupID string) error return ctx.JSON(http.StatusOK, group) } -func (h *Handler) UpdateGroup(ctx echo.Context, appID string, groupID string) error { +func (h *Handler) UpdateGroup(ctx echo.Context, appIDorProductID string, groupID string) error { logger := loggerWithUsername(logger, ctx) + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + var request codegen.GroupConfig - err := ctx.Bind(&request) + err = ctx.Bind(&request) if err != nil { logger.Error().Err(err).Msg("updateGroup - decoding payload") return ctx.NoContent(http.StatusBadRequest) @@ -118,7 +133,7 @@ func (h *Handler) UpdateGroup(ctx echo.Context, appID string, groupID string) er return ctx.JSON(http.StatusOK, group) } -func (h *Handler) DeleteGroup(ctx echo.Context, appID string, groupID string) error { +func (h *Handler) DeleteGroup(ctx echo.Context, appIDorProductID string, groupID string) error { logger := loggerWithUsername(logger, ctx) group, err := h.db.GetGroup(groupID) @@ -141,7 +156,7 @@ func (h *Handler) DeleteGroup(ctx echo.Context, appID string, groupID string) er return ctx.NoContent(http.StatusNoContent) } -func (h *Handler) GetGroupVersionTimeline(ctx echo.Context, appID string, groupID string, params codegen.GetGroupVersionTimelineParams) error { +func (h *Handler) GetGroupVersionTimeline(ctx echo.Context, appIDorProductID string, groupID string, params codegen.GetGroupVersionTimelineParams) error { versionCountTimeline, isCache, err := h.db.GetGroupVersionCountTimeline(groupID, params.Duration) if err != nil { if err == sql.ErrNoRows { @@ -160,7 +175,7 @@ func (h *Handler) GetGroupVersionTimeline(ctx echo.Context, appID string, groupI return ctx.JSON(http.StatusOK, versionCountTimeline) } -func (h *Handler) GetGroupStatusTimeline(ctx echo.Context, appID string, groupID string, params codegen.GetGroupStatusTimelineParams) error { +func (h *Handler) GetGroupStatusTimeline(ctx echo.Context, appIDorProductID string, groupID string, params codegen.GetGroupStatusTimelineParams) error { statusCountTimeline, err := h.db.GetGroupStatusCountTimeline(groupID, params.Duration) if err != nil { if err == sql.ErrNoRows { @@ -173,7 +188,7 @@ func (h *Handler) GetGroupStatusTimeline(ctx echo.Context, appID string, groupID return ctx.JSON(http.StatusOK, statusCountTimeline) } -func (h *Handler) GetGroupInstanceStats(ctx echo.Context, appID string, groupID string, params codegen.GetGroupInstanceStatsParams) error { +func (h *Handler) GetGroupInstanceStats(ctx echo.Context, appIDorProductID string, groupID string, params codegen.GetGroupInstanceStatsParams) error { instancesStats, err := h.db.GetGroupInstancesStats(groupID, params.Duration) if err != nil { if err == sql.ErrNoRows { @@ -186,7 +201,7 @@ func (h *Handler) GetGroupInstanceStats(ctx echo.Context, appID string, groupID return ctx.JSON(http.StatusOK, instancesStats) } -func (h *Handler) GetGroupVersionBreakdown(ctx echo.Context, appID string, groupID string) error { +func (h *Handler) GetGroupVersionBreakdown(ctx echo.Context, appIDorProductID string, groupID string) error { versionBreakdown, err := h.db.GetGroupVersionBreakdown(groupID) if err != nil { @@ -204,7 +219,13 @@ func (h *Handler) GetGroupVersionBreakdown(ctx echo.Context, appID string, group return ctx.JSON(http.StatusOK, versionBreakdown) } -func (h *Handler) GetGroupInstances(ctx echo.Context, appID string, groupID string, params codegen.GetGroupInstancesParams) error { +func (h *Handler) GetGroupInstances(ctx echo.Context, appIDorProductID string, groupID string, params codegen.GetGroupInstancesParams) error { + + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + if params.Page == nil { params.Page = &defaultPage } @@ -245,7 +266,12 @@ func (h *Handler) GetGroupInstances(ctx echo.Context, appID string, groupID stri return ctx.JSON(http.StatusOK, groupInstances) } -func (h *Handler) GetGroupInstancesCount(ctx echo.Context, appID string, groupID string, params codegen.GetGroupInstancesCountParams) error { +func (h *Handler) GetGroupInstancesCount(ctx echo.Context, appIDorProductID string, groupID string, params codegen.GetGroupInstancesCountParams) error { + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + p := api.InstancesQueryParams{ ApplicationID: appID, GroupID: groupID, @@ -265,9 +291,13 @@ func groupFromRequest(name string, description *string, policyMaxUpdatesPerPerio Name: name, PolicyMaxUpdatesPerPeriod: policyMaxUpdatesPerPeriod, PolicyPeriodInterval: policyPeriodInterval, - PolicyTimezone: null.StringFrom(policyTimezone), PolicyUpdateTimeout: policyUpdateTimeout, - ChannelID: null.StringFromPtr(channelID), + } + if channelID != nil && *channelID != "" { + group.ChannelID = null.StringFromPtr(channelID) + } + if policyTimezone != "" { + group.PolicyTimezone = null.StringFrom(policyTimezone) } if groupID != "" { group.ID = groupID diff --git a/backend/pkg/handler/handler.go b/backend/pkg/handler/handler.go index 7f87f6cbc..3ee57df95 100644 --- a/backend/pkg/handler/handler.go +++ b/backend/pkg/handler/handler.go @@ -10,6 +10,7 @@ import ( "github.com/kinvolk/nebraska/backend/pkg/api" "github.com/kinvolk/nebraska/backend/pkg/auth" + "github.com/kinvolk/nebraska/backend/pkg/codegen" "github.com/kinvolk/nebraska/backend/pkg/config" "github.com/kinvolk/nebraska/backend/pkg/omaha" "github.com/kinvolk/nebraska/backend/pkg/util" @@ -21,22 +22,11 @@ const ( GithubAccessManagementURL = "https://github.com/settings/apps/authorizations" ) -type ClientConfig struct { - AccessManagementURL string `json:"access_management_url"` - LogoutURL string `json:"logout_url"` - NebraskaVersion string `json:"nebraska_version"` - Logo string `json:"logo"` - Title string `json:"title"` - HeaderStyle string `json:"header_style"` - LoginURL string `json:"login_url"` - AuthMode string `json:"auth_mode"` -} - type Handler struct { db *api.API omahaHandler *omaha.Handler conf *config.Config - clientConf *ClientConfig + clientConf *codegen.Config auth auth.Authenticator } @@ -46,7 +36,7 @@ var defaultPerPage int = 10 var logger = util.NewLogger("nebraska") func New(db *api.API, conf *config.Config, auth auth.Authenticator) (*Handler, error) { - clientConfig := &ClientConfig{ + clientConfig := &codegen.Config{ AuthMode: conf.AuthMode, NebraskaVersion: version.Version, Title: conf.AppTitle, @@ -73,9 +63,9 @@ func New(db *api.API, conf *config.Config, auth auth.Authenticator) (*Handler, e return nil, err } url.Path = "/login" - clientConfig.LoginURL = url.String() - clientConfig.AccessManagementURL = conf.OidcManagementURL - clientConfig.LogoutURL = conf.OidcLogutURL + clientConfig.LoginUrl = url.String() + clientConfig.AccessManagementUrl = conf.OidcManagementURL + clientConfig.LogoutUrl = conf.OidcLogutURL } return &Handler{db, omaha.NewHandler(db), conf, clientConfig, auth}, nil diff --git a/backend/pkg/handler/instances.go b/backend/pkg/handler/instances.go index ce96ff2db..eb3fd6d1a 100644 --- a/backend/pkg/handler/instances.go +++ b/backend/pkg/handler/instances.go @@ -9,7 +9,12 @@ import ( "github.com/kinvolk/nebraska/backend/pkg/codegen" ) -func (h *Handler) GetInstance(ctx echo.Context, appID string, groupID string, instanceID string) error { +func (h *Handler) GetInstance(ctx echo.Context, appIDorProductID string, groupID string, instanceID string) error { + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + instance, err := h.db.GetInstance(instanceID, appID) if err != nil { if err == sql.ErrNoRows { @@ -21,11 +26,15 @@ func (h *Handler) GetInstance(ctx echo.Context, appID string, groupID string, in return ctx.JSON(http.StatusOK, instance) } -func (h *Handler) GetInstanceStatusHistory(ctx echo.Context, appID string, groupID string, instanceID string, params codegen.GetInstanceStatusHistoryParams) error { +func (h *Handler) GetInstanceStatusHistory(ctx echo.Context, appIDorProductID string, groupID string, instanceID string, params codegen.GetInstanceStatusHistoryParams) error { limit := 20 if params.Limit != nil { limit = *params.Limit } + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } instanceStatusHistory, err := h.db.GetInstanceStatusHistory(instanceID, appID, groupID, uint64(limit)) if err != nil { diff --git a/backend/pkg/handler/packages.go b/backend/pkg/handler/packages.go index 46c30d2ca..9cb21ec6f 100644 --- a/backend/pkg/handler/packages.go +++ b/backend/pkg/handler/packages.go @@ -11,7 +11,7 @@ import ( "github.com/kinvolk/nebraska/backend/pkg/codegen" ) -func (h *Handler) PaginatePackages(ctx echo.Context, appID string, params codegen.PaginatePackagesParams) error { +func (h *Handler) PaginatePackages(ctx echo.Context, appIDorProductID string, params codegen.PaginatePackagesParams) error { if params.Page == nil { params.Page = &defaultPage } @@ -19,6 +19,10 @@ func (h *Handler) PaginatePackages(ctx echo.Context, appID string, params codege if params.Perpage == nil { params.Perpage = &defaultPerPage } + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } totalCount, err := h.db.GetPackagesCount(appID, params.SearchVersion) if err != nil { @@ -37,12 +41,17 @@ func (h *Handler) PaginatePackages(ctx echo.Context, appID string, params codege return ctx.JSON(http.StatusOK, packagePage{totalCount, len(pkgs), pkgs}) } -func (h *Handler) CreatePackage(ctx echo.Context, appID string) error { +func (h *Handler) CreatePackage(ctx echo.Context, appIDorProductID string) error { logger := loggerWithUsername(logger, ctx) + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + var request codegen.PackageConfig - err := ctx.Bind(&request) + err = ctx.Bind(&request) if err != nil { logger.Error().Err(err).Msg("addPackage - decoding payload") return ctx.NoContent(http.StatusBadRequest) @@ -67,7 +76,7 @@ func (h *Handler) CreatePackage(ctx echo.Context, appID string) error { return ctx.JSON(http.StatusOK, pkg) } -func (h *Handler) GetPackage(ctx echo.Context, appID string, packageID string) error { +func (h *Handler) GetPackage(ctx echo.Context, appIDorProductID string, packageID string) error { pkg, err := h.db.GetPackage(packageID) if err != nil { if err == sql.ErrNoRows { @@ -80,12 +89,17 @@ func (h *Handler) GetPackage(ctx echo.Context, appID string, packageID string) e return ctx.JSON(http.StatusOK, pkg) } -func (h *Handler) UpdatePackage(ctx echo.Context, appID string, packageID string) error { +func (h *Handler) UpdatePackage(ctx echo.Context, appIDorProductID string, packageID string) error { logger := loggerWithUsername(logger, ctx) + appID, err := h.db.GetAppID(appIDorProductID) + if err != nil { + return appNotFoundResponse(ctx, appIDorProductID) + } + var request codegen.PackageConfig - err := ctx.Bind(&request) + err = ctx.Bind(&request) if err != nil { logger.Error().Err(err).Msg("updatePackage - decoding payload") return ctx.NoContent(http.StatusBadRequest) @@ -119,7 +133,7 @@ func (h *Handler) UpdatePackage(ctx echo.Context, appID string, packageID string return ctx.JSON(http.StatusOK, pkg) } -func (h *Handler) DeletePackage(ctx echo.Context, appID string, packageID string) error { +func (h *Handler) DeletePackage(ctx echo.Context, appIDorProductID string, packageID string) error { logger := loggerWithUsername(logger, ctx) pkg, err := h.db.GetPackage(packageID) diff --git a/backend/pkg/handler/utils.go b/backend/pkg/handler/utils.go index 3165d4d9f..41bff297c 100644 --- a/backend/pkg/handler/utils.go +++ b/backend/pkg/handler/utils.go @@ -1,6 +1,9 @@ package handler import ( + "fmt" + "net/http" + echosessions "github.com/kinvolk/nebraska/backend/pkg/sessions/echo" "github.com/labstack/echo/v4" @@ -24,3 +27,9 @@ func loggerWithUsername(l zerolog.Logger, ctx echo.Context) zerolog.Logger { return logger.With().Str("username", username.(string)).Logger() } + +func appNotFoundResponse(ctx echo.Context, appIDProductID string) error { + return ctx.JSON(http.StatusBadRequest, map[string]string{ + "message": fmt.Sprintf("App not found for :%s", appIDProductID), + }) +} diff --git a/backend/test/api/app_test.go b/backend/test/api/app_test.go index 38f38c7a2..24d46d45d 100644 --- a/backend/test/api/app_test.go +++ b/backend/test/api/app_test.go @@ -47,6 +47,7 @@ func TestCreateApp(t *testing.T) { t.Run("success_do_not_copy", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // Create App request url := fmt.Sprintf("%s%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), "/api/apps") @@ -72,6 +73,7 @@ func TestCreateApp(t *testing.T) { t.Run("success_with_copy", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() app := getRandomApp(t, db) @@ -99,12 +101,45 @@ func TestCreateApp(t *testing.T) { assert.Equal(t, application.ID, app.ID) }) + + t.Run("success_with_copy_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + app := getAppWithProductID(t, db) + + // Create App request + url := fmt.Sprintf("%s/api/apps?clone_from=%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "POST" + + appName := "test_with_clone" + payload := strings.NewReader(fmt.Sprintf(`{"name":"%s"}`, appName)) + + // response + var application api.Application + + httpDo(t, url, method, payload, http.StatusOK, "json", &application) + + // close and create new db session to clear and update cached appIds + db.Close() + db, err := api.New() + require.NoError(t, err) + require.NotNil(t, db) + + // check if app exists in DB + app, err = db.GetApp(application.ID) + require.NoError(t, err) + + assert.Equal(t, application.ID, app.ID) + }) } func TestGetApp(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() app := getRandomApp(t, db) @@ -120,12 +155,34 @@ func TestGetApp(t *testing.T) { assert.Equal(t, app.Name, application.Name) assert.Equal(t, app.Instances, application.Instances) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from db + app := getAppWithProductID(t, db) + + // fetch app by product_id request + url := fmt.Sprintf("%s/api/apps/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "GET" + + // check response + var application codegen.Application + + httpDo(t, url, method, nil, http.StatusOK, "json", &application) + + assert.Equal(t, app.Name, application.Name) + assert.Equal(t, app.ProductID.String, application.ProductId) + assert.Equal(t, app.ID, application.Id) + }) } func TestUpdateApp(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB to update app := getRandomApp(t, db) @@ -151,12 +208,43 @@ func TestUpdateApp(t *testing.T) { assert.Equal(t, name, app.Name) }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product_id from DB to update + app := getAppWithProductID(t, db) + + // Update App Request + url := fmt.Sprintf("%s/api/apps/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "PUT" + + name := "updated_name_product_id" + payload := strings.NewReader(fmt.Sprintf(`{"name":"%s","description":"%s","id":"%s"}`, name, app.Description, app.ID)) + + // response struct + var application api.Application + + httpDo(t, url, method, payload, http.StatusOK, "json", &application) + + assert.Equal(t, name, application.Name) + + // check name in DB + + app, err := db.GetApp(app.ID) + require.NoError(t, err) + + assert.Equal(t, name, app.Name) + }) } func TestDeleteApp(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from db app := getRandomApp(t, db) @@ -172,4 +260,24 @@ func TestDeleteApp(t *testing.T) { assert.Error(t, err) assert.Nil(t, app) }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from db + app := getAppWithProductID(t, db) + + // Update App Request + url := fmt.Sprintf("%s/api/apps/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "DELETE" + + httpDo(t, url, method, nil, http.StatusNoContent, "", nil) + + // check if app exists in db + app, err := db.GetApp(app.ID) + assert.Error(t, err) + assert.Nil(t, app) + }) } diff --git a/backend/test/api/channel_test.go b/backend/test/api/channel_test.go index 39c2c8f7a..4eee5730b 100644 --- a/backend/test/api/channel_test.go +++ b/backend/test/api/channel_test.go @@ -21,6 +21,7 @@ func TestListChannels(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -44,12 +45,41 @@ func TestListChannels(t *testing.T) { assert.Equal(t, channelsDB[i].ApplicationID, channelsResp.Channels[i].ApplicationID) } }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // get channels from DB for app + channelsDB, err := db.GetChannels(app.ID, 1, 10) + require.NoError(t, err) + require.NotNil(t, channelsDB) + + // fetch channels from API + url := fmt.Sprintf("%s/api/apps/%s/channels", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "GET" + + var channelsResp codegen.ChannelPage + + httpDo(t, url, method, nil, http.StatusOK, "json", &channelsResp) + + for i := range channelsDB { + assert.NotEqual(t, 0, len(channelsResp.Channels)) + assert.Equal(t, len(channelsDB), len(channelsResp.Channels)) + assert.Equal(t, channelsDB[i].ApplicationID, channelsResp.Channels[i].ApplicationID) + } + }) } func TestCreateChannel(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -73,12 +103,42 @@ func TestCreateChannel(t *testing.T) { assert.NotNil(t, channelsDB) assert.Equal(t, channelName, channelsDB.Name) }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // create channel using the API + url := fmt.Sprintf("%s/api/apps/%s/channels", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "POST" + + channelName := "test_channel" + payload := strings.NewReader(fmt.Sprintf(`{"name":"%s","arch":0,"color":"","application_id":"%s"}`, channelName, app.ID)) + + var channel api.Channel + + httpDo(t, url, method, payload, http.StatusOK, "json", &channel) + + assert.Equal(t, channelName, channel.Name) + + // check channel exists in DB + channelsDB, err := db.GetChannel(channel.ID) + assert.NoError(t, err) + assert.NotNil(t, channelsDB) + assert.Equal(t, channelName, channelsDB.Name) + }) + } func TestGetChannel(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -95,52 +155,113 @@ func TestGetChannel(t *testing.T) { assert.Equal(t, app.Channels[0].Name, channel.Name) assert.Equal(t, app.Channels[0].ID, channel.ID) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // fetch channel by id request + url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, app.Channels[0].ID) + method := "GET" + + // response + var channel api.Channel + + httpDo(t, url, method, nil, http.StatusOK, "json", &channel) + + assert.Equal(t, app.Channels[0].Name, channel.Name) + assert.Equal(t, app.Channels[0].ID, channel.ID) + }) + } func TestUpdateChannel(t *testing.T) { - // establish DB connection - db := newDBForTest(t) + t.Run("success", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get random app from DB + app := getRandomApp(t, db) - // get random app from DB - app := getRandomApp(t, db) + // update channel request + var channelDB api.Channel + err := copier.Copy(&channelDB, app.Channels[0]) + require.NoError(t, err) + + channelName := "test_channel" + channelDB.Name = channelName - // update channel request - var channelDB api.Channel - err := copier.Copy(&channelDB, app.Channels[0]) - require.NoError(t, err) + payload, err := json.Marshal(channelDB) + require.NoError(t, err) + + url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, channelDB.ID) + method := "PUT" + + // response + var channel api.Channel - channelName := "test_channel" - channelDB.Name = channelName + httpDo(t, url, method, bytes.NewReader(payload), http.StatusOK, "json", &channel) + assert.Equal(t, channelName, channel.Name) - payload, err := json.Marshal(channelDB) - require.NoError(t, err) + // check name in DB + updatedChannelDB, err := db.GetChannel(channel.ID) + require.NoError(t, err) - url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), channelDB.ApplicationID, channelDB.ID) - method := "PUT" + assert.Equal(t, channelName, updatedChannelDB.Name) + }) - // response - var channel api.Channel + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() - httpDo(t, url, method, bytes.NewReader(payload), http.StatusOK, "json", &channel) - assert.Equal(t, channelName, channel.Name) + // get app with product id from DB + app := getAppWithProductID(t, db) + defer db.Close() - // check name in DB - updatedChannelDB, err := db.GetChannel(channel.ID) - require.NoError(t, err) + // update channel request + var channelDB api.Channel + err := copier.Copy(&channelDB, app.Channels[0]) + require.NoError(t, err) - assert.Equal(t, channelName, updatedChannelDB.Name) + channelName := "test_channel" + channelDB.Name = channelName + + payload, err := json.Marshal(channelDB) + require.NoError(t, err) + + url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, channelDB.ID) + method := "PUT" + + // response + var channel api.Channel + + httpDo(t, url, method, bytes.NewReader(payload), http.StatusOK, "json", &channel) + assert.Equal(t, channelName, channel.Name) + + // check name in DB + updatedChannelDB, err := db.GetChannel(channel.ID) + require.NoError(t, err) + + assert.Equal(t, channelName, updatedChannelDB.Name) + }) } func TestDeleteChannel(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) channelDB := app.Channels[0] - url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), channelDB.ApplicationID, channelDB.ID) + url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, channelDB.ID) method := "DELETE" httpDo(t, url, method, nil, http.StatusNoContent, "", nil) @@ -149,4 +270,23 @@ func TestDeleteChannel(t *testing.T) { assert.Error(t, err) assert.Nil(t, channel) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + channelDB := app.Channels[0] + url := fmt.Sprintf("%s/api/apps/%s/channels/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, channelDB.ID) + method := "DELETE" + + httpDo(t, url, method, nil, http.StatusNoContent, "", nil) + + channel, err := db.GetChannel(channelDB.ID) + assert.Error(t, err) + assert.Nil(t, channel) + }) + } diff --git a/backend/test/api/flatcar_package_test.go b/backend/test/api/flatcar_package_test.go index 5fdc1aa23..705b32744 100644 --- a/backend/test/api/flatcar_package_test.go +++ b/backend/test/api/flatcar_package_test.go @@ -32,6 +32,7 @@ func TestHostFlatcarPackage(t *testing.T) { } db := newDBForTest(t) + defer db.Close() t.Run("file_exists", func(t *testing.T) { server, err := server.New(conf, db) diff --git a/backend/test/api/group_test.go b/backend/test/api/group_test.go index 5a2474dca..55978b1c4 100644 --- a/backend/test/api/group_test.go +++ b/backend/test/api/group_test.go @@ -21,6 +21,7 @@ func TestListGroups(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -46,12 +47,43 @@ func TestListGroups(t *testing.T) { assert.Equal(t, groupsDB[i].Name, groupResp.Groups[i].Name) } }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // get groups from DB for app + groupsDB, err := db.GetGroups(app.ID, 1, 10) + require.NoError(t, err) + require.NotNil(t, groupsDB) + + // fetch groups from API + url := fmt.Sprintf("%s/api/apps/%s/groups", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "GET" + + var groupResp codegen.GroupPage + + httpDo(t, url, method, nil, http.StatusOK, "json", &groupResp) + + assert.NotEqual(t, 0, len(groupResp.Groups)) + assert.Equal(t, len(groupsDB), len(groupResp.Groups)) + + for i := range groupsDB { + assert.Equal(t, groupsDB[i].ID, groupResp.Groups[i].Id) + assert.Equal(t, groupsDB[i].Name, groupResp.Groups[i].Name) + } + }) + } func TestCreateGroup(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -70,6 +102,33 @@ func TestCreateGroup(t *testing.T) { assert.Equal(t, groupName, group.Name) + // check group exists in DB + groupDB, err := db.GetGroup(group.ID) + assert.NoError(t, err) + assert.NotNil(t, groupDB) + }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // create group using the API + url := fmt.Sprintf("%s/api/apps/%s/groups", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "POST" + + groupName := "test_group_product_id" + payload := strings.NewReader(fmt.Sprintf(`{"name":"%s","policy_max_updates_per_period":1,"policy_period_interval":"1 hours","policy_update_timeout":"1 days","policy_timezone":"Asia/Calcutta","application_id":"%s"}`, groupName, app.ID)) + + // response + var group api.Group + + httpDo(t, url, method, payload, http.StatusOK, "json", &group) + + assert.Equal(t, groupName, group.Name) + // check group exists in DB groupDB, err := db.GetGroup(group.ID) assert.NoError(t, err) @@ -81,6 +140,7 @@ func TestGetGroup(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -96,12 +156,33 @@ func TestGetGroup(t *testing.T) { assert.Equal(t, app.Groups[0].Name, group.Name) }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // fetch group by id request + url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, app.Groups[0].ID) + method := "GET" + + // response + var group api.Group + + httpDo(t, url, method, nil, http.StatusOK, "json", &group) + + assert.Equal(t, app.Groups[0].Name, group.Name) + }) } func TestUpdateGroup(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) @@ -117,7 +198,7 @@ func TestUpdateGroup(t *testing.T) { payload, err := json.Marshal(groupDB) require.NoError(t, err) - url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), groupDB.ApplicationID, groupDB.ID) + url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, groupDB.ID) method := "PUT" // response @@ -131,18 +212,73 @@ func TestUpdateGroup(t *testing.T) { require.NoError(t, err) assert.Equal(t, groupName, updatedGroupDB.Name) }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // update group request + var groupDB api.Group + err := copier.Copy(&groupDB, app.Groups[0]) + require.NoError(t, err) + + groupName := "test_group" + groupDB.Name = groupName + + payload, err := json.Marshal(groupDB) + require.NoError(t, err) + + url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, groupDB.ID) + method := "PUT" + + // response + var group api.Group + httpDo(t, url, method, bytes.NewReader(payload), http.StatusOK, "json", &group) + + assert.Equal(t, groupName, group.Name) + + // check name in db + updatedGroupDB, err := db.GetGroup(groupDB.ID) + require.NoError(t, err) + assert.Equal(t, groupName, updatedGroupDB.Name) + }) + } func TestDeleteGroup(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app from DB app := getRandomApp(t, db) groupDB := app.Groups[0] - url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), groupDB.ApplicationID, groupDB.ID) + url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, groupDB.ID) + method := "DELETE" + + httpDo(t, url, method, nil, http.StatusNoContent, "", nil) + + // check if app doesn't exists in DB + group, err := db.GetGroup(groupDB.ID) + assert.Error(t, err) + assert.Nil(t, group) + }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + groupDB := app.Groups[0] + url := fmt.Sprintf("%s/api/apps/%s/groups/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, groupDB.ID) method := "DELETE" httpDo(t, url, method, nil, http.StatusNoContent, "", nil) @@ -152,4 +288,5 @@ func TestDeleteGroup(t *testing.T) { assert.Error(t, err) assert.Nil(t, group) }) + } diff --git a/backend/test/api/helper_test.go b/backend/test/api/helper_test.go index 23579adc8..e7ae7b8be 100644 --- a/backend/test/api/helper_test.go +++ b/backend/test/api/helper_test.go @@ -75,6 +75,19 @@ func getAppWithInstance(t *testing.T, db *api.API) *api.Application { return nil } +func getAppWithProductID(t *testing.T, db *api.API) *api.Application { + t.Helper() + + apps := getApps(t, db) + + for _, app := range apps { + if app.ProductID.Valid { + return app + } + } + return nil +} + // httpDo is a helper function that takes all request related info and // makes the http request and returns the unmarshalled response body based // on the responseType. diff --git a/backend/test/api/instance_test.go b/backend/test/api/instance_test.go index fcd215cf9..995f74819 100644 --- a/backend/test/api/instance_test.go +++ b/backend/test/api/instance_test.go @@ -19,6 +19,7 @@ func TestListInstances(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get app which has instance appWithInstance := getAppWithInstance(t, db) @@ -57,6 +58,7 @@ func TestGetInstanceCount(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get app which has instance appWithInstance := getAppWithInstance(t, db) @@ -83,6 +85,7 @@ func TestGetInstance(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -103,12 +106,38 @@ func TestGetInstance(t *testing.T) { assert.Equal(t, instanceDB.ID, instance.ID) assert.Equal(t, instanceDB.IP, instance.IP) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // create instance for app + instanceID := uuid.New() + instanceDB, err := db.RegisterInstance(instanceID.String(), "alias", "0.0.0.0", "0.0.1", app.ID, app.Groups[0].ID) + require.NoError(t, err) + + // fetch instance from API + url := fmt.Sprintf("%s/api/apps/%s/groups/%s/instances/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, app.Groups[0].ID, instanceDB.ID) + method := "GET" + + var instance api.Instance + + httpDo(t, url, method, nil, http.StatusOK, "json", &instance) + + assert.Equal(t, instanceDB.ID, instance.ID) + assert.Equal(t, instanceDB.IP, instance.IP) + }) + } func TestGetInstanceStatusHistory(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -139,12 +168,48 @@ func TestGetInstanceStatusHistory(t *testing.T) { assert.Equal(t, api.InstanceStatusComplete, instanceEvents[0].Status) assert.Equal(t, api.InstanceStatusUpdateGranted, instanceEvents[1].Status) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // create instance for app + instanceID := uuid.New() + instanceDB, err := db.RegisterInstance(instanceID.String(), "alias", "0.0.0.0", "0.0.1", app.ID, app.Groups[0].ID) + require.NoError(t, err) + + // GetUpdatePackage + _, err = db.GetUpdatePackage(instanceDB.ID, instanceDB.Alias, instanceDB.IP, instanceDB.Application.Version, app.ID, app.Groups[0].ID) + require.NoError(t, err) + + // create event for instance + err = db.RegisterEvent(instanceDB.ID, app.ID, app.Groups[0].ID, api.EventUpdateComplete, api.ResultSuccessReboot, "0.0.0", "0") + require.NoError(t, err) + + // fetch instance status_history + url := fmt.Sprintf("%s/api/apps/%s/groups/%s/instances/%s/status_history", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, app.Groups[0].ID, instanceDB.ID) + method := "GET" + + var instanceEvents []api.InstanceStatusHistoryEntry + + httpDo(t, url, method, nil, http.StatusOK, "json", &instanceEvents) + + require.Equal(t, 2, len(instanceEvents)) + + assert.Equal(t, api.InstanceStatusComplete, instanceEvents[0].Status) + assert.Equal(t, api.InstanceStatusUpdateGranted, instanceEvents[1].Status) + }) + } func TestUpdateInstance(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) diff --git a/backend/test/api/omaha_test.go b/backend/test/api/omaha_test.go index 91789e0f0..0b3180876 100644 --- a/backend/test/api/omaha_test.go +++ b/backend/test/api/omaha_test.go @@ -17,6 +17,7 @@ import ( func TestOmaha(t *testing.T) { // establish db connection db := newDBForTest(t) + defer db.Close() app := getAppWithInstance(t, db) diff --git a/backend/test/api/package_test.go b/backend/test/api/package_test.go index 4a06aae2d..088e0c203 100644 --- a/backend/test/api/package_test.go +++ b/backend/test/api/package_test.go @@ -23,6 +23,7 @@ func TestListPackages(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -37,7 +38,6 @@ func TestListPackages(t *testing.T) { method := "GET" // response - // TODO: will require change as response struct is changed in POC2 branch var packagesResp codegen.PackagePage httpDo(t, url, method, nil, http.StatusOK, "json", &packagesResp) @@ -49,12 +49,43 @@ func TestListPackages(t *testing.T) { assert.Equal(t, packagesDB[i].ID, packagesResp.Packages[i].Id) } }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // get packages from DB for app + packagesDB, err := db.GetPackages(app.ID, 1, 10, nil) + require.NoError(t, err) + require.NotNil(t, packagesDB) + + // fetch packages from API + url := fmt.Sprintf("%s/api/apps/%s/packages", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "GET" + + // response + var packagesResp codegen.PackagePage + + httpDo(t, url, method, nil, http.StatusOK, "json", &packagesResp) + + assert.NotEqual(t, 0, len(packagesResp.Packages)) + assert.Equal(t, len(packagesDB), len(packagesResp.Packages)) + for i := range packagesDB { + assert.Equal(t, packagesDB[i].ApplicationID, packagesResp.Packages[i].ApplicationID) + assert.Equal(t, packagesDB[i].ID, packagesResp.Packages[i].Id) + } + }) + } func TestCreatePackage(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -80,12 +111,43 @@ func TestCreatePackage(t *testing.T) { assert.Equal(t, packageName, packageDB.Filename.String) }) + + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // create group using the API + url := fmt.Sprintf("%s/api/apps/%s/packages", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String) + method := "POST" + + packageName := "test_package" + payload := strings.NewReader(fmt.Sprintf(`{"arch":1,"filename":"%s","description":"kinvolk package","url":"http://kinvolk.io","version":"20.2.4","type":4,"size":"199","hash":"some random hash","application_id":"%s","channels_blacklist":[]}`, packageName, app.ID)) + + // response + var packageResp api.Package + + httpDo(t, url, method, payload, http.StatusOK, "json", &packageResp) + + assert.Equal(t, packageName, packageResp.Filename.String) + + // check group exists in DB + packageDB, err := db.GetPackage(packageResp.ID) + assert.NoError(t, err) + assert.NotNil(t, packageDB) + + assert.Equal(t, packageName, packageDB.Filename.String) + }) } func TestGetPackage(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -96,7 +158,31 @@ func TestGetPackage(t *testing.T) { require.NotNil(t, packagesDB) // fetch group by id request - url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), packagesDB[0].ApplicationID, packagesDB[0].ID) + url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, packagesDB[0].ID) + method := "GET" + + var packageResp api.Package + + httpDo(t, url, method, nil, http.StatusOK, "json", &packageResp) + + assert.Equal(t, packagesDB[0].Filename, packageResp.Filename) + assert.Equal(t, packagesDB[0].ID, packageResp.ID) + }) + t.Run("success_package_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // get packages from DB for app[0] + packagesDB, err := db.GetPackages(app.ID, 1, 10, nil) + require.NoError(t, err) + require.NotNil(t, packagesDB) + + // fetch group by id request + url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, packagesDB[0].ID) method := "GET" var packageResp api.Package @@ -112,6 +198,7 @@ func TestUpdatePackage(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -146,7 +233,7 @@ func TestUpdatePackage(t *testing.T) { require.NoError(t, err) // fetch group by id request - url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), packageDB.ApplicationID, packageDB.ID) + url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, packageDB.ID) method := "PUT" var packageResp api.Package @@ -160,12 +247,66 @@ func TestUpdatePackage(t *testing.T) { require.NoError(t, err) assert.Equal(t, packageVersion, updatedPackageDB.Version) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // get packages from DB for app[0] + packagesDB, err := db.GetPackages(app.ID, 1, 10, nil) + require.NoError(t, err) + require.NotNil(t, packagesDB) + + // update package request + var packageDB api.Package + err = copier.Copy(&packageDB, packagesDB[0]) + require.NoError(t, err) + + if packageDB.ChannelsBlacklist == nil { + packageDB.ChannelsBlacklist = []string{} + } + if packageDB.Description.IsZero() { + packageDB.Description = null.StringFrom("some desc") + } + if packageDB.Size.IsZero() { + packageDB.Size = null.StringFrom("20") + } + if packageDB.Hash.IsZero() { + packageDB.Hash = null.StringFrom(uuid.New().String()) + } + + packageVersion := "20.2.2" + packageDB.Version = packageVersion + + payload, err := json.Marshal(packageDB) + require.NoError(t, err) + + // fetch group by id request + url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, packageDB.ID) + method := "PUT" + + var packageResp api.Package + + httpDo(t, url, method, bytes.NewReader(payload), http.StatusOK, "json", &packageResp) + + assert.Equal(t, packageVersion, packageResp.Version) + + // check package version in DB + updatedPackageDB, err := db.GetPackage(packageDB.ID) + require.NoError(t, err) + assert.Equal(t, packageVersion, updatedPackageDB.Version) + }) + } func TestDeletePackage(t *testing.T) { t.Run("success", func(t *testing.T) { // establish DB connection db := newDBForTest(t) + defer db.Close() // get random app app := getRandomApp(t, db) @@ -176,7 +317,7 @@ func TestDeletePackage(t *testing.T) { require.NotNil(t, packagesDB) // delte package by id request - url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), packagesDB[0].ApplicationID, packagesDB[0].ID) + url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ID, packagesDB[0].ID) method := "DELETE" httpDo(t, url, method, nil, http.StatusNoContent, "", nil) @@ -185,4 +326,28 @@ func TestDeletePackage(t *testing.T) { assert.Error(t, err) assert.Nil(t, packageDB) }) + t.Run("success_product_id", func(t *testing.T) { + // establish DB connection + db := newDBForTest(t) + defer db.Close() + + // get app with product id from DB + app := getAppWithProductID(t, db) + + // get packages from DB for app[0] + packagesDB, err := db.GetPackages(app.ID, 1, 10, nil) + require.NoError(t, err) + require.NotNil(t, packagesDB) + + // delte package by id request + url := fmt.Sprintf("%s/api/apps/%s/packages/%s", os.Getenv("NEBRASKA_TEST_SERVER_URL"), app.ProductID.String, packagesDB[0].ID) + method := "DELETE" + + httpDo(t, url, method, nil, http.StatusNoContent, "", nil) + + packageDB, err := db.GetPackage(packagesDB[0].ID) + assert.Error(t, err) + assert.Nil(t, packageDB) + }) + }