diff --git a/.tools/nvim/__http__/iot/app.graphql.yml b/.tools/nvim/__http__/iot/app.graphql.yml index 0baa5a86b..40092164c 100644 --- a/.tools/nvim/__http__/iot/app.graphql.yml +++ b/.tools/nvim/__http__/iot/app.graphql.yml @@ -1,16 +1,15 @@ --- label: "Create App" query: |+ - mutation Iot_createApp($projectName: String!, $envName: String!, $deviceBlueprintName: String!, $app: IOTAppIn!) { - iot_createApp(projectName: $projectName, envName: $envName, deviceBlueprintName: $deviceBlueprintName, app: $app) { - displayName + mutation Iot_createApp($projectName: String!, $deviceBlueprintName: String!, $app: IOTAppIn!) { + iot_createApp(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, app: $app) { id + displayName } } variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprintName": "sample-device-blueprint", "app": { "displayName": "sample app", @@ -33,16 +32,16 @@ variables: label: "update App" query: |+ - mutation Iot_updateApp($projectName: String!, $envName: String!, $deviceBlueprintName: String!, $app: IOTAppIn!) { - iot_updateApp(projectName: $projectName, envName: $envName, deviceBlueprintName: $deviceBlueprintName, app: $app) { - accountName + mutation Iot_updateApp($projectName: String!, $deviceBlueprintName: String!, $app: IOTAppIn!) { + iot_updateApp(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, app: $app) { id + accountName + displayName } } variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprintName": "sample-device-blueprint", "app": { "displayName": "sample app", @@ -65,13 +64,12 @@ variables: label: "delete App" query: |+ - mutation Iot_deleteApp($projectName: String!, $envName: String!, $deviceBlueprintName: String!, $name: String!) { - iot_deleteApp(projectName: $projectName, envName: $envName, deviceBlueprintName: $deviceBlueprintName, name: $name) + mutation Iot_deleteApp($projectName: String!, $deviceBlueprintName: String!, $name: String!) { + iot_deleteApp(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, name: $name) } variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprintName": "sample-device-blueprint", "name": "sample-app" } @@ -80,16 +78,15 @@ variables: label: "get App" query: |+ - query Iot_getApp($projectName: String!, $envName: String!, $deviceBlueprintName: String!, $name: String!) { - iot_getApp(projectName: $projectName, envName: $envName, deviceBlueprintName: $deviceBlueprintName, name: $name) { - id + query Iot_getApp($projectName: String!, $deviceBlueprintName: String!, $name: String!) { + iot_getApp(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, name: $name) { displayName + id } } variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprintName": "sample-device-blueprint", "name": "sample-app" } @@ -98,8 +95,8 @@ variables: label: "list App" query: |+ - query Iot_listApps($projectName: String!, $envName: String!, $deviceBlueprintName: String!) { - iot_listApps(projectName: $projectName, envName: $envName, deviceBlueprintName: $deviceBlueprintName) { + query Iot_listApps($projectName: String!, $deviceBlueprintName: String!) { + iot_listApps(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName) { totalCount edges { node { @@ -112,7 +109,6 @@ query: |+ variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprintName": "sample-device-blueprint", } diff --git a/.tools/nvim/__http__/iot/deployments.graphql.yml b/.tools/nvim/__http__/iot/deployments.graphql.yml index 54f9fb649..4c3a6696d 100644 --- a/.tools/nvim/__http__/iot/deployments.graphql.yml +++ b/.tools/nvim/__http__/iot/deployments.graphql.yml @@ -1,17 +1,16 @@ --- label: "Create Deployment" query: |+ - mutation Iot_createDeployment($projectName: String!, $envName: String!, $deployment: IOTDeploymentIn!) { - iot_createDeployment(projectName: $projectName, envName: $envName, deployment: $deployment) { + mutation Iot_createDeployment($projectName: String!, $deployment: IOTDeploymentIn!) { + iot_createDeployment(projectName: $projectName, deployment: $deployment) { CIDR - displayName id + displayName } } variables: { "projectName": "sample-project", - "envName": "sample-env", "deployment": { "CIDR": "10.0.0.0/16", "displayName": "sample deployment", @@ -29,17 +28,16 @@ variables: label: "update deployment" query: |+ - mutation Iot_updateDeployment($projectName: String!, $envName: String!, $deployment: IOTDeploymentIn!) { - iot_updateDeployment(projectName: $projectName, envName: $envName, deployment: $deployment) { - CIDR + mutation Iot_updateDeployment($projectName: String!, $deployment: IOTDeploymentIn!) { + iot_updateDeployment(projectName: $projectName, deployment: $deployment) { displayName + CIDR id } } variables: { "projectName": "sample-project", - "envName": "sample-env", "deployment": { "displayName": "sample depl one", "CIDR": "10.0.0.1", @@ -57,13 +55,12 @@ variables: label: "delete deployment" query: |+ - mutation Iot_deleteDeployment($projectName: String!, $envName: String!, $name: String!) { - iot_deleteDeployment(projectName: $projectName, envName: $envName, name: $name) + mutation Iot_deleteDeployment($projectName: String!, $name: String!) { + iot_deleteDeployment(projectName: $projectName, name: $name) } variables: { "projectName": "sample-project", - "envName": "sample-env", "name": "sample-deployment" } @@ -71,17 +68,16 @@ variables: label: "get deployment" query: |+ - query Iot_getDeployment($projectName: String!, $envName: String!, $name: String!) { - iot_getDeployment(projectName: $projectName, envName: $envName, name: $name) { + query Iot_getDeployment($projectName: String!, $name: String!) { + iot_getDeployment(projectName: $projectName, name: $name) { CIDR - displayName id + displayName } } variables: { "projectName": "sample-project", - "envName": "sample-env", "name": "sample-deployment" } @@ -89,13 +85,13 @@ variables: label: "list deployments" query: |+ - query Iot_listDeployments($projectName: String!, $envName: String!) { - iot_listDeployments(projectName: $projectName, envName: $envName) { + query Iot_listDeployments($projectName: String!) { + iot_listDeployments(projectName: $projectName) { totalCount edges { node { - CIDR displayName + CIDR name } } @@ -104,7 +100,6 @@ query: |+ variables: { "projectName": "sample-project", - "envName": "sample-env" } --- diff --git a/.tools/nvim/__http__/iot/device-blueprint.graphql.yml b/.tools/nvim/__http__/iot/device-blueprint.graphql.yml index e2e648968..9147b4800 100644 --- a/.tools/nvim/__http__/iot/device-blueprint.graphql.yml +++ b/.tools/nvim/__http__/iot/device-blueprint.graphql.yml @@ -1,8 +1,8 @@ --- label: "Create Device Blueprint" query: |+ - mutation Iot_createDeviceBlueprint($projectName: String!, $envName: String!, $deviceBlueprint: IOTDeviceBlueprintIn!) { - iot_createDeviceBlueprint(projectName: $projectName, envName: $envName, deviceBlueprint: $deviceBlueprint) { + mutation Iot_createDeviceBlueprint($projectName: String!, $deviceBlueprint: IOTDeviceBlueprintIn!) { + iot_createDeviceBlueprint(projectName: $projectName, deviceBlueprint: $deviceBlueprint) { displayName id name @@ -11,7 +11,6 @@ query: |+ variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprint": { "bluePrintType": "singleton_blueprint", "displayName": "sample device blueprint", @@ -24,21 +23,20 @@ variables: label: "update Device Blueprint" query: |+ - mutation Iot_updateDeviceBlueprint($projectName: String!, $envName: String!, $deviceBlueprint: IOTDeviceBlueprintIn!) { - iot_updateDeviceBlueprint(projectName: $projectName, envName: $envName, deviceBlueprint: $deviceBlueprint) { + mutation Iot_updateDeviceBlueprint($projectName: String!, $deviceBlueprint: IOTDeviceBlueprintIn!) { + iot_updateDeviceBlueprint(projectName: $projectName, deviceBlueprint: $deviceBlueprint) { bluePrintType - name displayName + name } } variables: { "projectName": "sample-project", - "envName": "sample-env", "deviceBlueprint": { - "bluePrintType": "group____blueprint", - "displayName": "sample device blueprint", - "name": "sample-device-blueprint-one", + "bluePrintType": "group_blueprint", + "displayName": "sample device blueprint update", + "name": "sample-device-blueprint", "version": 1 } } @@ -47,13 +45,12 @@ variables: label: "delete Device Blueprint" query: |+ - mutation Iot_deleteDeviceBlueprint($projectName: String!, $envName: String!, $name: String!) { - iot_deleteDeviceBlueprint(projectName: $projectName, envName: $envName, name: $name) + mutation Iot_deleteDeviceBlueprint($projectName: String!, $name: String!) { + iot_deleteDeviceBlueprint(projectName: $projectName, name: $name) } variables: { "projectName": "sample-project", - "envName": "sample-env", "name": "sample-device-blueprint" } @@ -61,16 +58,16 @@ variables: label: "get Device Blueprint" query: |+ - query Iot_getDeviceBlueprint($projectName: String!, $envName: String!, $name: String!) { - iot_getDeviceBlueprint(projectName: $projectName, envName: $envName, name: $name) { - displayName + query Iot_getDeviceBlueprint($projectName: String!, $name: String!) { + iot_getDeviceBlueprint(projectName: $projectName, name: $name) { id + name + displayName } } variables: { "projectName": "sample-project", - "envName": "sample-env", "name": "sample-device-blueprint" } @@ -78,13 +75,14 @@ variables: label: "list Device Blueprint" query: |+ - query Iot_listDeployments($projectName: String!, $envName: String!) { - iot_listDeployments(projectName: $projectName, envName: $envName) { + query Iot_listDeviceBlueprints($projectName: String!) { + iot_listDeviceBlueprints(projectName: $projectName) { totalCount edges { node { displayName accountName + projectName } } } @@ -92,7 +90,6 @@ query: |+ variables: { "projectName": "sample-project", - "envName": "sample-env" } --- diff --git a/.tools/nvim/__http__/iot/devices.graphql.yml b/.tools/nvim/__http__/iot/devices.graphql.yml index 089697e66..27745425f 100644 --- a/.tools/nvim/__http__/iot/devices.graphql.yml +++ b/.tools/nvim/__http__/iot/devices.graphql.yml @@ -1,23 +1,24 @@ --- label: "Create Device" query: |+ - mutation Iot_createDevice($projectName: String!, $envName: String!, $device: IOTDeviceIn!) { - iot_createDevice(projectName: $projectName, envName: $envName, device: $device) { - id + mutation Iot_createDevice($projectName: String!, $deviceBlueprintName: String!, $device: IOTDeviceIn!) { + iot_createDevice(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, device: $device) { deployment + deviceBlueprintName name + accountName + displayName } } variables: { "projectName": "sample-project", - "envName": "sample-env", + "deviceBlueprintName": "sample-device-blueprint", "device": { - "blueprint": "sample-device-blueprint-one", - "deployment": "sample-deployment", + "deployment": "", "displayName": "sample device", "ip": "10.10.11.4", - "name": "sample-device", + "name": "sample-device-one", "podCIDR": "10.1.1.1", "publicKey": "10.2.2.2", "serviceCIDR": "10.3.3.3", @@ -29,19 +30,19 @@ variables: label: "update Device" query: |+ - mutation Iot_updateDevice($projectName: String!, $envName: String!, $device: IOTDeviceIn!) { - iot_updateDevice(projectName: $projectName, envName: $envName, device: $device) { - blueprint - id + mutation Iot_updateDevice($projectName: String!, $deviceBlueprintName: String!, $device: IOTDeviceIn!) { + iot_updateDevice(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, device: $device) { + accountName + deployment + deviceBlueprintName name } } variables: { "projectName": "sample-project", - "envName": "sample-env", + "deviceBlueprintName": "sample-device-blueprint", "device": { - "blueprint": "sample-device-blueprint-one", "deployment": "sample-deployment", "displayName": "sample device", "ip": "10.10.11.4", @@ -57,46 +58,47 @@ variables: label: "delete Device" query: |+ - mutation Iot_deleteDevice($projectName: String!, $envName: String!, $name: String!) { - iot_deleteDevice(projectName: $projectName, envName: $envName, name: $name) + mutation Iot_deleteDevice($projectName: String!, $deviceBlueprintName: String!, $name: String!) { + iot_deleteDevice(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, name: $name) } variables: { - "projectName": null, - "envName": null, - "name": null + "projectName": "sample-project", + "deviceBlueprintName": "sample-device-blueprint", + "name": "sample-device" } --- label: "get Device" query: |+ - query Iot_getDevice($projectName: String!, $envName: String!, $name: String!) { - iot_getDevice(projectName: $projectName, envName: $envName, name: $name) { + query Iot_getDevice($projectName: String!, $deviceBlueprintName: String!, $name: String!) { + iot_getDevice(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName, name: $name) { accountName - displayName - id + deployment + deviceBlueprintName name } } variables: { - "projectName": null, - "envName": null, - "name": null + "projectName": "sample-project", + "deviceBlueprintName": "sample-device-blueprint", + "name": "sample-device" } --- label: "list Device" query: |+ - query Iot_listDevices($projectName: String!, $envName: String!) { - iot_listDevices(projectName: $projectName, envName: $envName) { + query Iot_listDevices($projectName: String!, $deviceBlueprintName: String!) { + iot_listDevices(projectName: $projectName, deviceBlueprintName: $deviceBlueprintName) { totalCount edges { node { + accountName deployment - id + deviceBlueprintName name } } @@ -104,8 +106,90 @@ query: |+ } variables: { - "projectName": null, - "envName": null + "projectName": "sample-project", + "deviceBlueprintName": "sample-device-blueprint" + } + +--- + +label: "Add Deployment Device" +query: |+ + mutation Iot_addDeviceToDeployment($projectName: String!, $deploymentName: String!, $deviceName: String!, $deviceBlueprintName: String!) { + iot_addDeviceToDeployment(projectName: $projectName, deploymentName: $deploymentName, deviceName: $deviceName, deviceBlueprintName: $deviceBlueprintName) { + accountName + deployment + name + deviceBlueprintName + } + } +variables: + { + "projectName": "sample-project", + "deploymentName": "sample-deployment", + "deviceName": "sample-device", + "deviceBlueprintName": "sample-device-blueprint" + } + +--- + +label: "Remove Deployment Device" +query: |+ + mutation Iot_removeDeviceOfDeployment($projectName: String!, $deploymentName: String!, $deviceName: String!, $deviceBlueprintName: String!) { + iot_removeDeviceOfDeployment(projectName: $projectName, deploymentName: $deploymentName, deviceName: $deviceName, deviceBlueprintName: $deviceBlueprintName) { + accountName + deployment + deviceBlueprintName + name + } + } +variables: + { + "projectName": "sample-project", + "deploymentName": "sample-deployment", + "deviceName": "sample-device", + "deviceBlueprintName": "sample-device-blueprint" + } + +--- + +label: "get Deployment Device" +query: |+ + query Iot_getDeploymentDevice($projectName: String!, $deploymentName: String!, $name: String!) { + iot_getDeploymentDevice(projectName: $projectName, deploymentName: $deploymentName, name: $name) { + accountName + deployment + deviceBlueprintName + name + } + } +variables: + { + "projectName": "sample-project", + "deploymentName": "sample-deployment", + "name": "sample-device" + } + +--- + +label: "list Deployment Device" +query: |+ + query Iot_listDeploymentDevices($projectName: String!, $deploymentName: String!) { + iot_listDeploymentDevices(projectName: $projectName, deploymentName: $deploymentName) { + totalCount + edges { + node { + accountName + deployment + deviceBlueprintName + name + } + } + } + } +variables: + { + "projectName": "sample-project", + "deploymentName": "sample-deployment" } --- diff --git a/.tools/nvim/__http__/iot/environments.graphql.yml b/.tools/nvim/__http__/iot/environments.graphql.yml deleted file mode 100644 index dc9f93add..000000000 --- a/.tools/nvim/__http__/iot/environments.graphql.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -label: "Create Environment" -query: |+ - mutation Iot_createEnvironment($projectName: String!, $env: IOTEnvironmentIn!) { - iot_createEnvironment(projectName: $projectName, env: $env) { - displayName - id - name - } - } -variables: - { - "projectName": sample-project, - "env": { - "displayName": "sample env one", - "name": "sample-env-one" - } - } - ---- - -label: "update Environment" -query: |+ - mutation Iot_updateEnvironment($projectName: String!, $env: IOTEnvironmentIn!) { - iot_updateEnvironment(projectName: $projectName, env: $env) { - displayName - id - name - } - } -variables: - { - "projectName": null, - "env": { - "displayName": null, - "name": null - } - } - ---- - -label: "delete Environment" -query: |+ - mutation Iot_deleteEnvironment($projectName: String!, $name: String!) { - iot_deleteEnvironment(projectName: $projectName, name: $name) - } -variables: - { - "projectName": null, - "name": null - } - ---- - -label: "get Environment" -query: |+ - query Iot_getEnvironment($projectName: String!, $name: String!) { - iot_getEnvironment(projectName: $projectName, name: $name) { - accountName - displayName - name - } - } -variables: - { - "projectName": "sample-project", - "name": "sample-env" - } - ---- - -label: "list Environment" -query: |+ - query Iot_listEnvironments($projectName: String!) { - iot_listEnvironments(projectName: $projectName) { - edges { - node { - name - id - accountName - } - } - totalCount - } - } -variables: - { - "projectName": "sample-project" - } - ---- - - diff --git a/.tools/nvim/__http__/iot/projects.graphql.yml b/.tools/nvim/__http__/iot/projects.graphql.yml index 154feb145..345389f31 100644 --- a/.tools/nvim/__http__/iot/projects.graphql.yml +++ b/.tools/nvim/__http__/iot/projects.graphql.yml @@ -30,8 +30,8 @@ query: |+ variables: { "project": { - "name": null, - "displayName": null + "name": "sample-project", + "displayName": "sample project" } } diff --git a/apps/iot-console/Taskfile.yml b/apps/iot-console/Taskfile.yml index f16cc5408..1174a3c56 100644 --- a/apps/iot-console/Taskfile.yml +++ b/apps/iot-console/Taskfile.yml @@ -18,7 +18,6 @@ tasks: - mkdir -p "./internal/app/_struct-to-graphql" - go run ../../cmd/struct-to-graphql --struct github.com/kloudlite/api/apps/iot-console/internal/entities.IOTProject - --struct github.com/kloudlite/api/apps/iot-console/internal/entities.IOTEnvironment --struct github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDevice --struct github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDeviceBlueprint --struct github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDeployment @@ -28,7 +27,7 @@ tasks: > ./internal/app/_struct-to-graphql/main.go - |+ pushd ./internal/app/_struct-to-graphql - go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination IOTProject,IOTEnvironment,IOTDevice,IOTDeviceBlueprint,IOTDeployment,IOTApp + go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination IOTProject,IOTDevice,IOTDeviceBlueprint,IOTDeployment,IOTApp popd - rm -rf ./internal/app/_struct-to-graphql diff --git a/apps/iot-console/internal/app/app.go b/apps/iot-console/internal/app/app.go index bb94f716f..0b97221b8 100644 --- a/apps/iot-console/internal/app/app.go +++ b/apps/iot-console/internal/app/app.go @@ -15,13 +15,13 @@ import ( "github.com/kloudlite/api/pkg/errors" httpServer "github.com/kloudlite/api/pkg/http-server" "github.com/kloudlite/api/pkg/kv" + "github.com/kloudlite/api/pkg/logging" "github.com/kloudlite/api/pkg/repos" "go.uber.org/fx" ) var Module = fx.Module("app", repos.NewFxMongoRepo[*entities.IOTProject]("projects", "prj", entities.IOTProjectIndexes), - repos.NewFxMongoRepo[*entities.IOTEnvironment]("environments", "env", entities.IOTEnvironmentIndexes), repos.NewFxMongoRepo[*entities.IOTDeployment]("deployments", "depl", entities.IOTDeploymentIndexes), repos.NewFxMongoRepo[*entities.IOTDevice]("devices", "dev", entities.IOTDeviceIndexes), repos.NewFxMongoRepo[*entities.IOTDeviceBlueprint]("device_blueprints", "devblueprint", entities.IOTDeviceBlueprintIndexes), @@ -83,4 +83,13 @@ var Module = fx.Module("app", ), domain.Module, + + fx.Invoke(func(server httpServer.Server, envs *env.Env, d domain.Domain, logger logging.Logger) { + + a := server.Raw() + + a.Get("/healthy", func(c *fiber.Ctx) error { + return c.SendString("OK") + }) + }), ) diff --git a/apps/iot-console/internal/app/gqlgen.yml b/apps/iot-console/internal/app/gqlgen.yml index ba59aa379..2f4c0c371 100644 --- a/apps/iot-console/internal/app/gqlgen.yml +++ b/apps/iot-console/internal/app/gqlgen.yml @@ -71,10 +71,6 @@ models: model: github.com/kloudlite/api/apps/iot-console/internal/entities.IOTProject IOTProjectIn: *iot-project-model - IOTEnvironment: &iot-environment-model - model: github.com/kloudlite/api/apps/iot-console/internal/entities.IOTEnvironment - IOTEnvironmentIn: *iot-environment-model - IOTDevice: &iot-device-model model: github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDevice IOTDeviceIn: *iot-device-model diff --git a/apps/iot-console/internal/app/graph/generated/generated.go b/apps/iot-console/internal/app/graph/generated/generated.go index b6d1378b4..6fc85a8b6 100644 --- a/apps/iot-console/internal/app/graph/generated/generated.go +++ b/apps/iot-console/internal/app/graph/generated/generated.go @@ -48,7 +48,6 @@ type ResolverRoot interface { IOTDeployment() IOTDeploymentResolver IOTDevice() IOTDeviceResolver IOTDeviceBlueprint() IOTDeviceBlueprintResolver - IOTEnvironment() IOTEnvironmentResolver IOTProject() IOTProjectResolver Metadata() MetadataResolver Mutation() MutationResolver @@ -238,7 +237,6 @@ type ComplexityRoot struct { DeviceBlueprintName func(childComplexity int) int DisplayName func(childComplexity int) int Enabled func(childComplexity int) int - EnvironmentName func(childComplexity int) int Id func(childComplexity int) int Kind func(childComplexity int) int LastUpdatedBy func(childComplexity int) int @@ -268,7 +266,6 @@ type ComplexityRoot struct { CreatedBy func(childComplexity int) int CreationTime func(childComplexity int) int DisplayName func(childComplexity int) int - EnvironmentName func(childComplexity int) int ExposedServices func(childComplexity int) int Id func(childComplexity int) int LastUpdatedBy func(childComplexity int) int @@ -291,25 +288,24 @@ type ComplexityRoot struct { } IOTDevice struct { - AccountName func(childComplexity int) int - Blueprint func(childComplexity int) int - CreatedBy func(childComplexity int) int - CreationTime func(childComplexity int) int - Deployment func(childComplexity int) int - DisplayName func(childComplexity int) int - EnvironmentName func(childComplexity int) int - IP func(childComplexity int) int - Id func(childComplexity int) int - LastUpdatedBy func(childComplexity int) int - MarkedForDeletion func(childComplexity int) int - Name func(childComplexity int) int - PodCIDR func(childComplexity int) int - ProjectName func(childComplexity int) int - PublicKey func(childComplexity int) int - RecordVersion func(childComplexity int) int - ServiceCIDR func(childComplexity int) int - UpdateTime func(childComplexity int) int - Version func(childComplexity int) int + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + Deployment func(childComplexity int) int + DeviceBlueprintName func(childComplexity int) int + DisplayName func(childComplexity int) int + IP func(childComplexity int) int + Id func(childComplexity int) int + LastUpdatedBy func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Name func(childComplexity int) int + PodCIDR func(childComplexity int) int + ProjectName func(childComplexity int) int + PublicKey func(childComplexity int) int + RecordVersion func(childComplexity int) int + ServiceCIDR func(childComplexity int) int + UpdateTime func(childComplexity int) int + Version func(childComplexity int) int } IOTDeviceBlueprint struct { @@ -318,7 +314,6 @@ type ComplexityRoot struct { CreatedBy func(childComplexity int) int CreationTime func(childComplexity int) int DisplayName func(childComplexity int) int - EnvironmentName func(childComplexity int) int Id func(childComplexity int) int LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int @@ -356,7 +351,7 @@ type ComplexityRoot struct { CreatedBy func(childComplexity int) int CreationTime func(childComplexity int) int DisplayName func(childComplexity int) int - Id func(childComplexity int) int + ID func(childComplexity int) int LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int Name func(childComplexity int) int @@ -448,24 +443,23 @@ type ComplexityRoot struct { } Mutation struct { - IotCreateApp func(childComplexity int, projectName string, envName string, deviceBlueprintName string, app entities.IOTApp) int - IotCreateDeployment func(childComplexity int, projectName string, envName string, deployment entities.IOTDeployment) int - IotCreateDevice func(childComplexity int, projectName string, envName string, device entities.IOTDevice) int - IotCreateDeviceBlueprint func(childComplexity int, projectName string, envName string, deviceBlueprint entities.IOTDeviceBlueprint) int - IotCreateEnvironment func(childComplexity int, projectName string, env entities.IOTEnvironment) int - IotCreateProject func(childComplexity int, project entities.IOTProject) int - IotDeleteApp func(childComplexity int, projectName string, envName string, deviceBlueprintName string, name string) int - IotDeleteDeployment func(childComplexity int, projectName string, envName string, name string) int - IotDeleteDevice func(childComplexity int, projectName string, envName string, name string) int - IotDeleteDeviceBlueprint func(childComplexity int, projectName string, envName string, name string) int - IotDeleteEnvironment func(childComplexity int, projectName string, name string) int - IotDeleteProject func(childComplexity int, name string) int - IotUpdateApp func(childComplexity int, projectName string, envName string, deviceBlueprintName string, app entities.IOTApp) int - IotUpdateDeployment func(childComplexity int, projectName string, envName string, deployment entities.IOTDeployment) int - IotUpdateDevice func(childComplexity int, projectName string, envName string, device entities.IOTDevice) int - IotUpdateDeviceBlueprint func(childComplexity int, projectName string, envName string, deviceBlueprint entities.IOTDeviceBlueprint) int - IotUpdateEnvironment func(childComplexity int, projectName string, env entities.IOTEnvironment) int - IotUpdateProject func(childComplexity int, project entities.IOTProject) int + IotAddDeviceToDeployment func(childComplexity int, projectName string, deploymentName string, deviceName string, deviceBlueprintName string) int + IotCreateApp func(childComplexity int, projectName string, deviceBlueprintName string, app entities.IOTApp) int + IotCreateDeployment func(childComplexity int, projectName string, deployment entities.IOTDeployment) int + IotCreateDevice func(childComplexity int, projectName string, deviceBlueprintName string, device entities.IOTDevice) int + IotCreateDeviceBlueprint func(childComplexity int, projectName string, deviceBlueprint entities.IOTDeviceBlueprint) int + IotCreateProject func(childComplexity int, project entities.IOTProject) int + IotDeleteApp func(childComplexity int, projectName string, deviceBlueprintName string, name string) int + IotDeleteDeployment func(childComplexity int, projectName string, name string) int + IotDeleteDevice func(childComplexity int, projectName string, deviceBlueprintName string, name string) int + IotDeleteDeviceBlueprint func(childComplexity int, projectName string, name string) int + IotDeleteProject func(childComplexity int, name string) int + IotRemoveDeviceOfDeployment func(childComplexity int, projectName string, deploymentName string, deviceName string, deviceBlueprintName string) int + IotUpdateApp func(childComplexity int, projectName string, deviceBlueprintName string, app entities.IOTApp) int + IotUpdateDeployment func(childComplexity int, projectName string, deployment entities.IOTDeployment) int + IotUpdateDevice func(childComplexity int, projectName string, deviceBlueprintName string, device entities.IOTDevice) int + IotUpdateDeviceBlueprint func(childComplexity int, projectName string, deviceBlueprint entities.IOTDeviceBlueprint) int + IotUpdateProject func(childComplexity int, project entities.IOTProject) int } PageInfo struct { @@ -476,19 +470,19 @@ type ComplexityRoot struct { } Query struct { - IotGetApp func(childComplexity int, projectName string, envName string, deviceBlueprintName string, name string) int - IotGetDeployment func(childComplexity int, projectName string, envName string, name string) int - IotGetDevice func(childComplexity int, projectName string, envName string, name string) int - IotGetDeviceBlueprint func(childComplexity int, projectName string, envName string, name string) int - IotGetEnvironment func(childComplexity int, projectName string, name string) int - IotGetProject func(childComplexity int, name string) int - IotListApps func(childComplexity int, projectName string, envName string, deviceBlueprintName string, search *model.SearchIOTApps, pq *repos.CursorPagination) int - IotListDeployments func(childComplexity int, projectName string, envName string, search *model.SearchIOTDeployments, pq *repos.CursorPagination) int - IotListDeviceBlueprints func(childComplexity int, projectName string, envName string, search *model.SearchIOTDeviceBlueprints, pq *repos.CursorPagination) int - IotListDevices func(childComplexity int, projectName string, envName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) int - IotListEnvironments func(childComplexity int, projectName string, search *model.SearchIOTEnvironments, pq *repos.CursorPagination) int - IotListProjects func(childComplexity int, search *model.SearchIOTProjects, pq *repos.CursorPagination) int - __resolve__service func(childComplexity int) int + IotGetApp func(childComplexity int, projectName string, deviceBlueprintName string, name string) int + IotGetDeployment func(childComplexity int, projectName string, name string) int + IotGetDeploymentDevice func(childComplexity int, projectName string, deploymentName string, name string) int + IotGetDevice func(childComplexity int, projectName string, deviceBlueprintName string, name string) int + IotGetDeviceBlueprint func(childComplexity int, projectName string, name string) int + IotGetProject func(childComplexity int, name string) int + IotListApps func(childComplexity int, projectName string, deviceBlueprintName string, search *model.SearchIOTApps, pq *repos.CursorPagination) int + IotListDeploymentDevices func(childComplexity int, projectName string, deploymentName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) int + IotListDeployments func(childComplexity int, projectName string, search *model.SearchIOTDeployments, pq *repos.CursorPagination) int + IotListDeviceBlueprints func(childComplexity int, projectName string, search *model.SearchIOTDeviceBlueprints, pq *repos.CursorPagination) int + IotListDevices func(childComplexity int, projectName string, deviceBlueprintName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) int + IotListProjects func(childComplexity int, search *model.SearchIOTProjects, pq *repos.CursorPagination) int + __resolve__service func(childComplexity int) int } _Service struct { @@ -525,11 +519,6 @@ type IOTDeviceBlueprintResolver interface { UpdateTime(ctx context.Context, obj *entities.IOTDeviceBlueprint) (string, error) } -type IOTEnvironmentResolver interface { - CreationTime(ctx context.Context, obj *entities.IOTEnvironment) (string, error) - - UpdateTime(ctx context.Context, obj *entities.IOTEnvironment) (string, error) -} type IOTProjectResolver interface { CreationTime(ctx context.Context, obj *entities.IOTProject) (string, error) @@ -546,35 +535,34 @@ type MutationResolver interface { IotCreateProject(ctx context.Context, project entities.IOTProject) (*entities.IOTProject, error) IotUpdateProject(ctx context.Context, project entities.IOTProject) (*entities.IOTProject, error) IotDeleteProject(ctx context.Context, name string) (bool, error) - IotCreateEnvironment(ctx context.Context, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) - IotUpdateEnvironment(ctx context.Context, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) - IotDeleteEnvironment(ctx context.Context, projectName string, name string) (bool, error) - IotCreateDevice(ctx context.Context, projectName string, envName string, device entities.IOTDevice) (*entities.IOTDevice, error) - IotUpdateDevice(ctx context.Context, projectName string, envName string, device entities.IOTDevice) (*entities.IOTDevice, error) - IotDeleteDevice(ctx context.Context, projectName string, envName string, name string) (bool, error) - IotCreateDeviceBlueprint(ctx context.Context, projectName string, envName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) - IotUpdateDeviceBlueprint(ctx context.Context, projectName string, envName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) - IotDeleteDeviceBlueprint(ctx context.Context, projectName string, envName string, name string) (bool, error) - IotCreateDeployment(ctx context.Context, projectName string, envName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) - IotUpdateDeployment(ctx context.Context, projectName string, envName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) - IotDeleteDeployment(ctx context.Context, projectName string, envName string, name string) (bool, error) - IotCreateApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) - IotUpdateApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) - IotDeleteApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, name string) (bool, error) + IotCreateDevice(ctx context.Context, projectName string, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) + IotUpdateDevice(ctx context.Context, projectName string, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) + IotDeleteDevice(ctx context.Context, projectName string, deviceBlueprintName string, name string) (bool, error) + IotAddDeviceToDeployment(ctx context.Context, projectName string, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) + IotRemoveDeviceOfDeployment(ctx context.Context, projectName string, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) + IotCreateDeviceBlueprint(ctx context.Context, projectName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) + IotUpdateDeviceBlueprint(ctx context.Context, projectName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) + IotDeleteDeviceBlueprint(ctx context.Context, projectName string, name string) (bool, error) + IotCreateDeployment(ctx context.Context, projectName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) + IotUpdateDeployment(ctx context.Context, projectName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) + IotDeleteDeployment(ctx context.Context, projectName string, name string) (bool, error) + IotCreateApp(ctx context.Context, projectName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) + IotUpdateApp(ctx context.Context, projectName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) + IotDeleteApp(ctx context.Context, projectName string, deviceBlueprintName string, name string) (bool, error) } type QueryResolver interface { IotListProjects(ctx context.Context, search *model.SearchIOTProjects, pq *repos.CursorPagination) (*model.IOTProjectPaginatedRecords, error) IotGetProject(ctx context.Context, name string) (*entities.IOTProject, error) - IotListEnvironments(ctx context.Context, projectName string, search *model.SearchIOTEnvironments, pq *repos.CursorPagination) (*model.IOTEnvironmentPaginatedRecords, error) - IotGetEnvironment(ctx context.Context, projectName string, name string) (*entities.IOTEnvironment, error) - IotListDevices(ctx context.Context, projectName string, envName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) (*model.IOTDevicePaginatedRecords, error) - IotGetDevice(ctx context.Context, projectName string, envName string, name string) (*entities.IOTDevice, error) - IotListDeviceBlueprints(ctx context.Context, projectName string, envName string, search *model.SearchIOTDeviceBlueprints, pq *repos.CursorPagination) (*model.IOTDeviceBlueprintPaginatedRecords, error) - IotGetDeviceBlueprint(ctx context.Context, projectName string, envName string, name string) (*entities.IOTDeviceBlueprint, error) - IotListDeployments(ctx context.Context, projectName string, envName string, search *model.SearchIOTDeployments, pq *repos.CursorPagination) (*model.IOTDeploymentPaginatedRecords, error) - IotGetDeployment(ctx context.Context, projectName string, envName string, name string) (*entities.IOTDeployment, error) - IotListApps(ctx context.Context, projectName string, envName string, deviceBlueprintName string, search *model.SearchIOTApps, pq *repos.CursorPagination) (*model.IOTAppPaginatedRecords, error) - IotGetApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, name string) (*entities.IOTApp, error) + IotListDevices(ctx context.Context, projectName string, deviceBlueprintName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) (*model.IOTDevicePaginatedRecords, error) + IotGetDevice(ctx context.Context, projectName string, deviceBlueprintName string, name string) (*entities.IOTDevice, error) + IotListDeploymentDevices(ctx context.Context, projectName string, deploymentName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) (*model.IOTDevicePaginatedRecords, error) + IotGetDeploymentDevice(ctx context.Context, projectName string, deploymentName string, name string) (*entities.IOTDevice, error) + IotListDeviceBlueprints(ctx context.Context, projectName string, search *model.SearchIOTDeviceBlueprints, pq *repos.CursorPagination) (*model.IOTDeviceBlueprintPaginatedRecords, error) + IotGetDeviceBlueprint(ctx context.Context, projectName string, name string) (*entities.IOTDeviceBlueprint, error) + IotListDeployments(ctx context.Context, projectName string, search *model.SearchIOTDeployments, pq *repos.CursorPagination) (*model.IOTDeploymentPaginatedRecords, error) + IotGetDeployment(ctx context.Context, projectName string, name string) (*entities.IOTDeployment, error) + IotListApps(ctx context.Context, projectName string, deviceBlueprintName string, search *model.SearchIOTApps, pq *repos.CursorPagination) (*model.IOTAppPaginatedRecords, error) + IotGetApp(ctx context.Context, projectName string, deviceBlueprintName string, name string) (*entities.IOTApp, error) } type IOTAppInResolver interface { @@ -1346,13 +1334,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IOTApp.Enabled(childComplexity), true - case "IOTApp.environmentName": - if e.complexity.IOTApp.EnvironmentName == nil { - break - } - - return e.complexity.IOTApp.EnvironmentName(childComplexity), true - case "IOTApp.id": if e.complexity.IOTApp.Id == nil { break @@ -1493,13 +1474,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IOTDeployment.DisplayName(childComplexity), true - case "IOTDeployment.environmentName": - if e.complexity.IOTDeployment.EnvironmentName == nil { - break - } - - return e.complexity.IOTDeployment.EnvironmentName(childComplexity), true - case "IOTDeployment.exposedServices": if e.complexity.IOTDeployment.ExposedServices == nil { break @@ -1598,13 +1572,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IOTDevice.AccountName(childComplexity), true - case "IOTDevice.blueprint": - if e.complexity.IOTDevice.Blueprint == nil { - break - } - - return e.complexity.IOTDevice.Blueprint(childComplexity), true - case "IOTDevice.createdBy": if e.complexity.IOTDevice.CreatedBy == nil { break @@ -1626,19 +1593,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IOTDevice.Deployment(childComplexity), true - case "IOTDevice.displayName": - if e.complexity.IOTDevice.DisplayName == nil { + case "IOTDevice.deviceBlueprintName": + if e.complexity.IOTDevice.DeviceBlueprintName == nil { break } - return e.complexity.IOTDevice.DisplayName(childComplexity), true + return e.complexity.IOTDevice.DeviceBlueprintName(childComplexity), true - case "IOTDevice.environmentName": - if e.complexity.IOTDevice.EnvironmentName == nil { + case "IOTDevice.displayName": + if e.complexity.IOTDevice.DisplayName == nil { break } - return e.complexity.IOTDevice.EnvironmentName(childComplexity), true + return e.complexity.IOTDevice.DisplayName(childComplexity), true case "IOTDevice.ip": if e.complexity.IOTDevice.IP == nil { @@ -1759,13 +1726,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IOTDeviceBlueprint.DisplayName(childComplexity), true - case "IOTDeviceBlueprint.environmentName": - if e.complexity.IOTDeviceBlueprint.EnvironmentName == nil { - break - } - - return e.complexity.IOTDeviceBlueprint.EnvironmentName(childComplexity), true - case "IOTDeviceBlueprint.id": if e.complexity.IOTDeviceBlueprint.Id == nil { break @@ -1921,11 +1881,11 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IOTEnvironment.DisplayName(childComplexity), true case "IOTEnvironment.id": - if e.complexity.IOTEnvironment.Id == nil { + if e.complexity.IOTEnvironment.ID == nil { break } - return e.complexity.IOTEnvironment.Id(childComplexity), true + return e.complexity.IOTEnvironment.ID(childComplexity), true case "IOTEnvironment.lastUpdatedBy": if e.complexity.IOTEnvironment.LastUpdatedBy == nil { @@ -2312,6 +2272,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Metadata.Namespace(childComplexity), true + case "Mutation.iot_addDeviceToDeployment": + if e.complexity.Mutation.IotAddDeviceToDeployment == nil { + break + } + + args, err := ec.field_Mutation_iot_addDeviceToDeployment_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.IotAddDeviceToDeployment(childComplexity, args["projectName"].(string), args["deploymentName"].(string), args["deviceName"].(string), args["deviceBlueprintName"].(string)), true + case "Mutation.iot_createApp": if e.complexity.Mutation.IotCreateApp == nil { break @@ -2322,7 +2294,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotCreateApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprintName"].(string), args["app"].(entities.IOTApp)), true + return e.complexity.Mutation.IotCreateApp(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["app"].(entities.IOTApp)), true case "Mutation.iot_createDeployment": if e.complexity.Mutation.IotCreateDeployment == nil { @@ -2334,7 +2306,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotCreateDeployment(childComplexity, args["projectName"].(string), args["envName"].(string), args["deployment"].(entities.IOTDeployment)), true + return e.complexity.Mutation.IotCreateDeployment(childComplexity, args["projectName"].(string), args["deployment"].(entities.IOTDeployment)), true case "Mutation.iot_createDevice": if e.complexity.Mutation.IotCreateDevice == nil { @@ -2346,7 +2318,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotCreateDevice(childComplexity, args["projectName"].(string), args["envName"].(string), args["device"].(entities.IOTDevice)), true + return e.complexity.Mutation.IotCreateDevice(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["device"].(entities.IOTDevice)), true case "Mutation.iot_createDeviceBlueprint": if e.complexity.Mutation.IotCreateDeviceBlueprint == nil { @@ -2358,19 +2330,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotCreateDeviceBlueprint(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprint"].(entities.IOTDeviceBlueprint)), true - - case "Mutation.iot_createEnvironment": - if e.complexity.Mutation.IotCreateEnvironment == nil { - break - } - - args, err := ec.field_Mutation_iot_createEnvironment_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.IotCreateEnvironment(childComplexity, args["projectName"].(string), args["env"].(entities.IOTEnvironment)), true + return e.complexity.Mutation.IotCreateDeviceBlueprint(childComplexity, args["projectName"].(string), args["deviceBlueprint"].(entities.IOTDeviceBlueprint)), true case "Mutation.iot_createProject": if e.complexity.Mutation.IotCreateProject == nil { @@ -2394,7 +2354,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotDeleteApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprintName"].(string), args["name"].(string)), true + return e.complexity.Mutation.IotDeleteApp(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["name"].(string)), true case "Mutation.iot_deleteDeployment": if e.complexity.Mutation.IotDeleteDeployment == nil { @@ -2406,7 +2366,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotDeleteDeployment(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Mutation.IotDeleteDeployment(childComplexity, args["projectName"].(string), args["name"].(string)), true case "Mutation.iot_deleteDevice": if e.complexity.Mutation.IotDeleteDevice == nil { @@ -2418,7 +2378,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotDeleteDevice(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Mutation.IotDeleteDevice(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["name"].(string)), true case "Mutation.iot_deleteDeviceBlueprint": if e.complexity.Mutation.IotDeleteDeviceBlueprint == nil { @@ -2430,31 +2390,31 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotDeleteDeviceBlueprint(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Mutation.IotDeleteDeviceBlueprint(childComplexity, args["projectName"].(string), args["name"].(string)), true - case "Mutation.iot_deleteEnvironment": - if e.complexity.Mutation.IotDeleteEnvironment == nil { + case "Mutation.iot_deleteProject": + if e.complexity.Mutation.IotDeleteProject == nil { break } - args, err := ec.field_Mutation_iot_deleteEnvironment_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_iot_deleteProject_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.IotDeleteEnvironment(childComplexity, args["projectName"].(string), args["name"].(string)), true + return e.complexity.Mutation.IotDeleteProject(childComplexity, args["name"].(string)), true - case "Mutation.iot_deleteProject": - if e.complexity.Mutation.IotDeleteProject == nil { + case "Mutation.iot_removeDeviceOfDeployment": + if e.complexity.Mutation.IotRemoveDeviceOfDeployment == nil { break } - args, err := ec.field_Mutation_iot_deleteProject_args(context.TODO(), rawArgs) + args, err := ec.field_Mutation_iot_removeDeviceOfDeployment_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.IotDeleteProject(childComplexity, args["name"].(string)), true + return e.complexity.Mutation.IotRemoveDeviceOfDeployment(childComplexity, args["projectName"].(string), args["deploymentName"].(string), args["deviceName"].(string), args["deviceBlueprintName"].(string)), true case "Mutation.iot_updateApp": if e.complexity.Mutation.IotUpdateApp == nil { @@ -2466,7 +2426,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotUpdateApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprintName"].(string), args["app"].(entities.IOTApp)), true + return e.complexity.Mutation.IotUpdateApp(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["app"].(entities.IOTApp)), true case "Mutation.iot_updateDeployment": if e.complexity.Mutation.IotUpdateDeployment == nil { @@ -2478,7 +2438,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotUpdateDeployment(childComplexity, args["projectName"].(string), args["envName"].(string), args["deployment"].(entities.IOTDeployment)), true + return e.complexity.Mutation.IotUpdateDeployment(childComplexity, args["projectName"].(string), args["deployment"].(entities.IOTDeployment)), true case "Mutation.iot_updateDevice": if e.complexity.Mutation.IotUpdateDevice == nil { @@ -2490,7 +2450,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotUpdateDevice(childComplexity, args["projectName"].(string), args["envName"].(string), args["device"].(entities.IOTDevice)), true + return e.complexity.Mutation.IotUpdateDevice(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["device"].(entities.IOTDevice)), true case "Mutation.iot_updateDeviceBlueprint": if e.complexity.Mutation.IotUpdateDeviceBlueprint == nil { @@ -2502,19 +2462,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.IotUpdateDeviceBlueprint(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprint"].(entities.IOTDeviceBlueprint)), true - - case "Mutation.iot_updateEnvironment": - if e.complexity.Mutation.IotUpdateEnvironment == nil { - break - } - - args, err := ec.field_Mutation_iot_updateEnvironment_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.IotUpdateEnvironment(childComplexity, args["projectName"].(string), args["env"].(entities.IOTEnvironment)), true + return e.complexity.Mutation.IotUpdateDeviceBlueprint(childComplexity, args["projectName"].(string), args["deviceBlueprint"].(entities.IOTDeviceBlueprint)), true case "Mutation.iot_updateProject": if e.complexity.Mutation.IotUpdateProject == nil { @@ -2566,7 +2514,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.IotGetApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprintName"].(string), args["name"].(string)), true + return e.complexity.Query.IotGetApp(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["name"].(string)), true case "Query.iot_getDeployment": if e.complexity.Query.IotGetDeployment == nil { @@ -2578,43 +2526,43 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.IotGetDeployment(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.IotGetDeployment(childComplexity, args["projectName"].(string), args["name"].(string)), true - case "Query.iot_getDevice": - if e.complexity.Query.IotGetDevice == nil { + case "Query.iot_getDeploymentDevice": + if e.complexity.Query.IotGetDeploymentDevice == nil { break } - args, err := ec.field_Query_iot_getDevice_args(context.TODO(), rawArgs) + args, err := ec.field_Query_iot_getDeploymentDevice_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.IotGetDevice(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.IotGetDeploymentDevice(childComplexity, args["projectName"].(string), args["deploymentName"].(string), args["name"].(string)), true - case "Query.iot_getDeviceBlueprint": - if e.complexity.Query.IotGetDeviceBlueprint == nil { + case "Query.iot_getDevice": + if e.complexity.Query.IotGetDevice == nil { break } - args, err := ec.field_Query_iot_getDeviceBlueprint_args(context.TODO(), rawArgs) + args, err := ec.field_Query_iot_getDevice_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.IotGetDeviceBlueprint(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.IotGetDevice(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["name"].(string)), true - case "Query.iot_getEnvironment": - if e.complexity.Query.IotGetEnvironment == nil { + case "Query.iot_getDeviceBlueprint": + if e.complexity.Query.IotGetDeviceBlueprint == nil { break } - args, err := ec.field_Query_iot_getEnvironment_args(context.TODO(), rawArgs) + args, err := ec.field_Query_iot_getDeviceBlueprint_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.IotGetEnvironment(childComplexity, args["projectName"].(string), args["name"].(string)), true + return e.complexity.Query.IotGetDeviceBlueprint(childComplexity, args["projectName"].(string), args["name"].(string)), true case "Query.iot_getProject": if e.complexity.Query.IotGetProject == nil { @@ -2638,7 +2586,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.IotListApps(childComplexity, args["projectName"].(string), args["envName"].(string), args["deviceBlueprintName"].(string), args["search"].(*model.SearchIOTApps), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.IotListApps(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["search"].(*model.SearchIOTApps), args["pq"].(*repos.CursorPagination)), true + + case "Query.iot_listDeploymentDevices": + if e.complexity.Query.IotListDeploymentDevices == nil { + break + } + + args, err := ec.field_Query_iot_listDeploymentDevices_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.IotListDeploymentDevices(childComplexity, args["projectName"].(string), args["deploymentName"].(string), args["search"].(*model.SearchIOTDevices), args["pq"].(*repos.CursorPagination)), true case "Query.iot_listDeployments": if e.complexity.Query.IotListDeployments == nil { @@ -2650,7 +2610,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.IotListDeployments(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchIOTDeployments), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.IotListDeployments(childComplexity, args["projectName"].(string), args["search"].(*model.SearchIOTDeployments), args["pq"].(*repos.CursorPagination)), true case "Query.iot_listDeviceBlueprints": if e.complexity.Query.IotListDeviceBlueprints == nil { @@ -2662,7 +2622,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.IotListDeviceBlueprints(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchIOTDeviceBlueprints), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.IotListDeviceBlueprints(childComplexity, args["projectName"].(string), args["search"].(*model.SearchIOTDeviceBlueprints), args["pq"].(*repos.CursorPagination)), true case "Query.iot_listDevices": if e.complexity.Query.IotListDevices == nil { @@ -2674,19 +2634,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.IotListDevices(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchIOTDevices), args["pq"].(*repos.CursorPagination)), true - - case "Query.iot_listEnvironments": - if e.complexity.Query.IotListEnvironments == nil { - break - } - - args, err := ec.field_Query_iot_listEnvironments_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.IotListEnvironments(childComplexity, args["projectName"].(string), args["search"].(*model.SearchIOTEnvironments), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.IotListDevices(childComplexity, args["projectName"].(string), args["deviceBlueprintName"].(string), args["search"].(*model.SearchIOTDevices), args["pq"].(*repos.CursorPagination)), true case "Query.iot_listProjects": if e.complexity.Query.IotListProjects == nil { @@ -2754,7 +2702,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputSearchIOTDeployments, ec.unmarshalInputSearchIOTDeviceBlueprints, ec.unmarshalInputSearchIOTDevices, - ec.unmarshalInputSearchIOTEnvironments, ec.unmarshalInputSearchIOTProjects, ) first := true @@ -2863,13 +2810,6 @@ input SearchIOTProjects { markedForDeletion: MatchFilterIn } -input SearchIOTEnvironments { - text: MatchFilterIn - projectName: MatchFilterIn - isReady: MatchFilterIn - markedForDeletion: MatchFilterIn -} - input SearchIOTDeployments { text: MatchFilterIn isReady: MatchFilterIn @@ -2898,20 +2838,20 @@ type Query { iot_listProjects(search: SearchIOTProjects, pq: CursorPaginationIn): IOTProjectPaginatedRecords @isLoggedInAndVerified @hasAccount iot_getProject(name: String!): IOTProject @isLoggedInAndVerified @hasAccount - iot_listEnvironments(projectName: String!,search: SearchIOTEnvironments, pq: CursorPaginationIn): IOTEnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getEnvironment(projectName: String!, name: String!): IOTEnvironment @isLoggedInAndVerified @hasAccount + iot_listDevices(projectName: String!, deviceBlueprintName: String!, search: SearchIOTDevices, pq: CursorPaginationIn): IOTDevicePaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDevice(projectName: String!, deviceBlueprintName: String!, name: String!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_listDevices(projectName: String!, envName: String!,search: SearchIOTDevices, pq: CursorPaginationIn): IOTDevicePaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getDevice(projectName: String!, envName: String!, name: String!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_listDeploymentDevices(projectName: String!, deploymentName: String!, search: SearchIOTDevices, pq: CursorPaginationIn): IOTDevicePaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDeploymentDevice(projectName: String!, deploymentName: String!, name: String!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_listDeviceBlueprints(projectName: String!, envName: String!,search: SearchIOTDeviceBlueprints, pq: CursorPaginationIn): IOTDeviceBlueprintPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getDeviceBlueprint(projectName: String!, envName: String!, name: String!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount + iot_listDeviceBlueprints(projectName: String!,search: SearchIOTDeviceBlueprints, pq: CursorPaginationIn): IOTDeviceBlueprintPaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDeviceBlueprint(projectName: String!, name: String!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount - iot_listDeployments(projectName: String!, envName: String!,search: SearchIOTDeployments, pq: CursorPaginationIn): IOTDeploymentPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getDeployment(projectName: String!, envName: String!, name: String!): IOTDeployment @isLoggedInAndVerified @hasAccount + iot_listDeployments(projectName: String!,search: SearchIOTDeployments, pq: CursorPaginationIn): IOTDeploymentPaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDeployment(projectName: String!, name: String!): IOTDeployment @isLoggedInAndVerified @hasAccount - iot_listApps(projectName: String!, envName: String!, deviceBlueprintName: String!,search: SearchIOTApps, pq: CursorPaginationIn): IOTAppPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getApp(projectName: String!, envName: String!, deviceBlueprintName: String!, name: String!): IOTApp @isLoggedInAndVerified @hasAccount + iot_listApps(projectName: String!, deviceBlueprintName: String!,search: SearchIOTApps, pq: CursorPaginationIn): IOTAppPaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getApp(projectName: String!, deviceBlueprintName: String!, name: String!): IOTApp @isLoggedInAndVerified @hasAccount } type Mutation { @@ -2919,25 +2859,24 @@ type Mutation { iot_updateProject(project: IOTProjectIn!): IOTProject @isLoggedInAndVerified @hasAccount iot_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createEnvironment(projectName: String!,env: IOTEnvironmentIn!): IOTEnvironment @isLoggedInAndVerified @hasAccount - iot_updateEnvironment(projectName: String!,env: IOTEnvironmentIn!): IOTEnvironment @isLoggedInAndVerified @hasAccount - iot_deleteEnvironment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createDevice(projectName: String!, deviceBlueprintName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_updateDevice(projectName: String!, deviceBlueprintName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_deleteDevice(projectName: String!, deviceBlueprintName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createDevice(projectName: String!, envName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_updateDevice(projectName: String!, envName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_deleteDevice(projectName: String!, envName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_addDeviceToDeployment(projectName: String!,deploymentName: String!, deviceName: String!, deviceBlueprintName: String!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_removeDeviceOfDeployment(projectName: String!,deploymentName: String!, deviceName: String!, deviceBlueprintName: String!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_createDeviceBlueprint(projectName: String!, envName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount - iot_updateDeviceBlueprint(projectName: String!, envName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount - iot_deleteDeviceBlueprint(projectName: String!, envName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createDeviceBlueprint(projectName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount + iot_updateDeviceBlueprint(projectName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount + iot_deleteDeviceBlueprint(projectName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createDeployment(projectName: String!, envName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount - iot_updateDeployment(projectName: String!, envName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount - iot_deleteDeployment(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createDeployment(projectName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount + iot_updateDeployment(projectName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount + iot_deleteDeployment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createApp(projectName: String!, envName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount - iot_updateApp(projectName: String!, envName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount - iot_deleteApp(projectName: String!, envName: String!, deviceBlueprintName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createApp(projectName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount + iot_updateApp(projectName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount + iot_deleteApp(projectName: String!, deviceBlueprintName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount } `, BuiltIn: false}, {Name: "../struct-to-graphql/common-types.graphqls", Input: `type Github__com___kloudlite___api___apps___iot____console___internal___entities__ExposedService @shareable { @@ -3370,7 +3309,6 @@ directive @goField( deviceBlueprintName: String! displayName: String! enabled: Boolean - environmentName: String! id: ID! kind: String lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! @@ -3410,7 +3348,6 @@ input IOTAppIn { createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! - environmentName: String! exposedServices: [Github__com___kloudlite___api___apps___iot____console___internal___entities__ExposedService!]! id: ID! lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! @@ -3442,12 +3379,11 @@ input IOTDeploymentIn { `, BuiltIn: false}, {Name: "../struct-to-graphql/iotdevice.graphqls", Input: `type IOTDevice @shareable { accountName: String! - blueprint: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! deployment: String! + deviceBlueprintName: String! displayName: String! - environmentName: String! id: ID! ip: String! lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! @@ -3474,7 +3410,6 @@ type IOTDevicePaginatedRecords @shareable { } input IOTDeviceIn { - blueprint: String! deployment: String! displayName: String! ip: String! @@ -3492,7 +3427,6 @@ input IOTDeviceIn { createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! - environmentName: String! id: ID! lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean @@ -3669,7 +3603,7 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** -func (ec *executionContext) field_Mutation_iot_createApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_iot_addDeviceToDeployment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -3682,36 +3616,36 @@ func (ec *executionContext) field_Mutation_iot_createApp_args(ctx context.Contex } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["deploymentName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deploymentName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 + args["deploymentName"] = arg1 var arg2 string - if tmp, ok := rawArgs["deviceBlueprintName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) + if tmp, ok := rawArgs["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprintName"] = arg2 - var arg3 entities.IOTApp - if tmp, ok := rawArgs["app"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - arg3, err = ec.unmarshalNIOTAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTApp(ctx, tmp) + args["deviceName"] = arg2 + var arg3 string + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) + arg3, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["app"] = arg3 + args["deviceBlueprintName"] = arg3 return args, nil } -func (ec *executionContext) field_Mutation_iot_createDeployment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_iot_createApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -3724,27 +3658,27 @@ func (ec *executionContext) field_Mutation_iot_createDeployment_args(ctx context } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.IOTDeployment - if tmp, ok := rawArgs["deployment"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deployment")) - arg2, err = ec.unmarshalNIOTDeploymentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeployment(ctx, tmp) + args["deviceBlueprintName"] = arg1 + var arg2 entities.IOTApp + if tmp, ok := rawArgs["app"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) + arg2, err = ec.unmarshalNIOTAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTApp(ctx, tmp) if err != nil { return nil, err } } - args["deployment"] = arg2 + args["app"] = arg2 return args, nil } -func (ec *executionContext) field_Mutation_iot_createDeviceBlueprint_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_iot_createDeployment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -3756,28 +3690,19 @@ func (ec *executionContext) field_Mutation_iot_createDeviceBlueprint_args(ctx co } } args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 entities.IOTDeviceBlueprint - if tmp, ok := rawArgs["deviceBlueprint"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprint")) - arg2, err = ec.unmarshalNIOTDeviceBlueprintIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeviceBlueprint(ctx, tmp) + var arg1 entities.IOTDeployment + if tmp, ok := rawArgs["deployment"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deployment")) + arg1, err = ec.unmarshalNIOTDeploymentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeployment(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprint"] = arg2 + args["deployment"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_iot_createDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_iot_createDeviceBlueprint_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -3789,28 +3714,19 @@ func (ec *executionContext) field_Mutation_iot_createDevice_args(ctx context.Con } } args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 entities.IOTDevice - if tmp, ok := rawArgs["device"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("device")) - arg2, err = ec.unmarshalNIOTDeviceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, tmp) + var arg1 entities.IOTDeviceBlueprint + if tmp, ok := rawArgs["deviceBlueprint"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprint")) + arg1, err = ec.unmarshalNIOTDeviceBlueprintIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeviceBlueprint(ctx, tmp) if err != nil { return nil, err } } - args["device"] = arg2 + args["deviceBlueprint"] = arg1 return args, nil } -func (ec *executionContext) field_Mutation_iot_createEnvironment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_iot_createDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -3822,15 +3738,24 @@ func (ec *executionContext) field_Mutation_iot_createEnvironment_args(ctx contex } } args["projectName"] = arg0 - var arg1 entities.IOTEnvironment - if tmp, ok := rawArgs["env"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - arg1, err = ec.unmarshalNIOTEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx, tmp) + var arg1 string + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["env"] = arg1 + args["deviceBlueprintName"] = arg1 + var arg2 entities.IOTDevice + if tmp, ok := rawArgs["device"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("device")) + arg2, err = ec.unmarshalNIOTDeviceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, tmp) + if err != nil { + return nil, err + } + } + args["device"] = arg2 return args, nil } @@ -3862,32 +3787,23 @@ func (ec *executionContext) field_Mutation_iot_deleteApp_args(ctx context.Contex } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["deviceBlueprintName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprintName"] = arg2 - var arg3 string + args["deviceBlueprintName"] = arg1 + var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg3, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg3 + args["name"] = arg2 return args, nil } @@ -3904,23 +3820,14 @@ func (ec *executionContext) field_Mutation_iot_deleteDeployment_args(ctx context } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -3937,23 +3844,14 @@ func (ec *executionContext) field_Mutation_iot_deleteDeviceBlueprint_args(ctx co } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -3970,14 +3868,14 @@ func (ec *executionContext) field_Mutation_iot_deleteDevice_args(ctx context.Con } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 + args["deviceBlueprintName"] = arg1 var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) @@ -3990,7 +3888,22 @@ func (ec *executionContext) field_Mutation_iot_deleteDevice_args(ctx context.Con return args, nil } -func (ec *executionContext) field_Mutation_iot_deleteEnvironment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_iot_deleteProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_iot_removeDeviceOfDeployment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4003,29 +3916,32 @@ func (ec *executionContext) field_Mutation_iot_deleteEnvironment_args(ctx contex } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["deploymentName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deploymentName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Mutation_iot_deleteProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) + args["deploymentName"] = arg1 + var arg2 string + if tmp, ok := rawArgs["deviceName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg0 + args["deviceName"] = arg2 + var arg3 string + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) + arg3, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["deviceBlueprintName"] = arg3 return args, nil } @@ -4042,32 +3958,23 @@ func (ec *executionContext) field_Mutation_iot_updateApp_args(ctx context.Contex } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["deviceBlueprintName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprintName"] = arg2 - var arg3 entities.IOTApp + args["deviceBlueprintName"] = arg1 + var arg2 entities.IOTApp if tmp, ok := rawArgs["app"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - arg3, err = ec.unmarshalNIOTAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTApp(ctx, tmp) + arg2, err = ec.unmarshalNIOTAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTApp(ctx, tmp) if err != nil { return nil, err } } - args["app"] = arg3 + args["app"] = arg2 return args, nil } @@ -4083,24 +3990,15 @@ func (ec *executionContext) field_Mutation_iot_updateDeployment_args(ctx context } } args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 entities.IOTDeployment + var arg1 entities.IOTDeployment if tmp, ok := rawArgs["deployment"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deployment")) - arg2, err = ec.unmarshalNIOTDeploymentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeployment(ctx, tmp) + arg1, err = ec.unmarshalNIOTDeploymentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeployment(ctx, tmp) if err != nil { return nil, err } } - args["deployment"] = arg2 + args["deployment"] = arg1 return args, nil } @@ -4116,24 +4014,15 @@ func (ec *executionContext) field_Mutation_iot_updateDeviceBlueprint_args(ctx co } } args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 entities.IOTDeviceBlueprint + var arg1 entities.IOTDeviceBlueprint if tmp, ok := rawArgs["deviceBlueprint"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprint")) - arg2, err = ec.unmarshalNIOTDeviceBlueprintIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeviceBlueprint(ctx, tmp) + arg1, err = ec.unmarshalNIOTDeviceBlueprintIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDeviceBlueprint(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprint"] = arg2 + args["deviceBlueprint"] = arg1 return args, nil } @@ -4150,14 +4039,14 @@ func (ec *executionContext) field_Mutation_iot_updateDevice_args(ctx context.Con } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 + args["deviceBlueprintName"] = arg1 var arg2 entities.IOTDevice if tmp, ok := rawArgs["device"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("device")) @@ -4170,30 +4059,6 @@ func (ec *executionContext) field_Mutation_iot_updateDevice_args(ctx context.Con return args, nil } -func (ec *executionContext) field_Mutation_iot_updateEnvironment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 entities.IOTEnvironment - if tmp, ok := rawArgs["env"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - arg1, err = ec.unmarshalNIOTEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx, tmp) - if err != nil { - return nil, err - } - } - args["env"] = arg1 - return args, nil -} - func (ec *executionContext) field_Mutation_iot_updateProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -4237,36 +4102,27 @@ func (ec *executionContext) field_Query_iot_getApp_args(ctx context.Context, raw } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["deviceBlueprintName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprintName"] = arg2 - var arg3 string + args["deviceBlueprintName"] = arg1 + var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg3, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg3 + args["name"] = arg2 return args, nil } -func (ec *executionContext) field_Query_iot_getDeployment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_getDeploymentDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4279,14 +4135,14 @@ func (ec *executionContext) field_Query_iot_getDeployment_args(ctx context.Conte } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["deploymentName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deploymentName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 + args["deploymentName"] = arg1 var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) @@ -4299,7 +4155,7 @@ func (ec *executionContext) field_Query_iot_getDeployment_args(ctx context.Conte return args, nil } -func (ec *executionContext) field_Query_iot_getDeviceBlueprint_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_getDeployment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4312,27 +4168,18 @@ func (ec *executionContext) field_Query_iot_getDeviceBlueprint_args(ctx context. } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } -func (ec *executionContext) field_Query_iot_getDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_getDeviceBlueprint_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4345,27 +4192,18 @@ func (ec *executionContext) field_Query_iot_getDevice_args(ctx context.Context, } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } -func (ec *executionContext) field_Query_iot_getEnvironment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_getDevice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4378,14 +4216,23 @@ func (ec *executionContext) field_Query_iot_getEnvironment_args(ctx context.Cont } args["projectName"] = arg0 var arg1 string + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["deviceBlueprintName"] = arg1 + var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 + args["name"] = arg2 return args, nil } @@ -4417,45 +4264,36 @@ func (ec *executionContext) field_Query_iot_listApps_args(ctx context.Context, r } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string if tmp, ok := rawArgs["deviceBlueprintName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["deviceBlueprintName"] = arg2 - var arg3 *model.SearchIOTApps + args["deviceBlueprintName"] = arg1 + var arg2 *model.SearchIOTApps if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg3, err = ec.unmarshalOSearchIOTApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTApps(ctx, tmp) + arg2, err = ec.unmarshalOSearchIOTApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTApps(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg3 - var arg4 *repos.CursorPagination + args["search"] = arg2 + var arg3 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg4, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg4 + args["pq"] = arg3 return args, nil } -func (ec *executionContext) field_Query_iot_listDeployments_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_listDeploymentDevices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4468,18 +4306,18 @@ func (ec *executionContext) field_Query_iot_listDeployments_args(ctx context.Con } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["deploymentName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deploymentName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 *model.SearchIOTDeployments + args["deploymentName"] = arg1 + var arg2 *model.SearchIOTDevices if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchIOTDeployments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDeployments(ctx, tmp) + arg2, err = ec.unmarshalOSearchIOTDevices2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDevices(ctx, tmp) if err != nil { return nil, err } @@ -4497,7 +4335,7 @@ func (ec *executionContext) field_Query_iot_listDeployments_args(ctx context.Con return args, nil } -func (ec *executionContext) field_Query_iot_listDeviceBlueprints_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_listDeployments_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4509,37 +4347,28 @@ func (ec *executionContext) field_Query_iot_listDeviceBlueprints_args(ctx contex } } args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 *model.SearchIOTDeviceBlueprints + var arg1 *model.SearchIOTDeployments if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchIOTDeviceBlueprints2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDeviceBlueprints(ctx, tmp) + arg1, err = ec.unmarshalOSearchIOTDeployments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDeployments(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg2 - var arg3 *repos.CursorPagination + args["search"] = arg1 + var arg2 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg3 + args["pq"] = arg2 return args, nil } -func (ec *executionContext) field_Query_iot_listDevices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_listDeviceBlueprints_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4551,37 +4380,28 @@ func (ec *executionContext) field_Query_iot_listDevices_args(ctx context.Context } } args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 *model.SearchIOTDevices + var arg1 *model.SearchIOTDeviceBlueprints if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchIOTDevices2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDevices(ctx, tmp) + arg1, err = ec.unmarshalOSearchIOTDeviceBlueprints2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDeviceBlueprints(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg2 - var arg3 *repos.CursorPagination + args["search"] = arg1 + var arg2 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg3 + args["pq"] = arg2 return args, nil } -func (ec *executionContext) field_Query_iot_listEnvironments_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_iot_listDevices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -4593,24 +4413,33 @@ func (ec *executionContext) field_Query_iot_listEnvironments_args(ctx context.Co } } args["projectName"] = arg0 - var arg1 *model.SearchIOTEnvironments + var arg1 string + if tmp, ok := rawArgs["deviceBlueprintName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceBlueprintName")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["deviceBlueprintName"] = arg1 + var arg2 *model.SearchIOTDevices if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg1, err = ec.unmarshalOSearchIOTEnvironments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTEnvironments(ctx, tmp) + arg2, err = ec.unmarshalOSearchIOTDevices2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTDevices(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg1 - var arg2 *repos.CursorPagination + args["search"] = arg2 + var arg3 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg2 + args["pq"] = arg3 return args, nil } @@ -9301,50 +9130,6 @@ func (ec *executionContext) fieldContext_IOTApp_enabled(ctx context.Context, fie return fc, nil } -func (ec *executionContext) _IOTApp_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTApp) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTApp_environmentName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnvironmentName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IOTApp_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IOTApp", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _IOTApp_id(ctx context.Context, field graphql.CollectedField, obj *entities.IOTApp) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTApp_id(ctx, field) if err != nil { @@ -9936,8 +9721,6 @@ func (ec *executionContext) fieldContext_IOTAppEdge_node(ctx context.Context, fi return ec.fieldContext_IOTApp_displayName(ctx, field) case "enabled": return ec.fieldContext_IOTApp_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_IOTApp_environmentName(ctx, field) case "id": return ec.fieldContext_IOTApp_id(ctx, field) case "kind": @@ -10341,50 +10124,6 @@ func (ec *executionContext) fieldContext_IOTDeployment_displayName(ctx context.C return fc, nil } -func (ec *executionContext) _IOTDeployment_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeployment) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDeployment_environmentName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnvironmentName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IOTDeployment_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IOTDeployment", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _IOTDeployment_exposedServices(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeployment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTDeployment_exposedServices(ctx, field) if err != nil { @@ -10841,8 +10580,6 @@ func (ec *executionContext) fieldContext_IOTDeploymentEdge_node(ctx context.Cont return ec.fieldContext_IOTDeployment_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeployment_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeployment_environmentName(ctx, field) case "exposedServices": return ec.fieldContext_IOTDeployment_exposedServices(ctx, field) case "id": @@ -11058,50 +10795,6 @@ func (ec *executionContext) fieldContext_IOTDevice_accountName(ctx context.Conte return fc, nil } -func (ec *executionContext) _IOTDevice_blueprint(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDevice) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDevice_blueprint(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Blueprint, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IOTDevice_blueprint(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IOTDevice", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _IOTDevice_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDevice) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTDevice_createdBy(ctx, field) if err != nil { @@ -11242,8 +10935,8 @@ func (ec *executionContext) fieldContext_IOTDevice_deployment(ctx context.Contex return fc, nil } -func (ec *executionContext) _IOTDevice_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDevice) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDevice_displayName(ctx, field) +func (ec *executionContext) _IOTDevice_deviceBlueprintName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) if err != nil { return graphql.Null } @@ -11256,7 +10949,7 @@ func (ec *executionContext) _IOTDevice_displayName(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil + return obj.DeviceBlueprintName, nil }) if err != nil { ec.Error(ctx, err) @@ -11273,7 +10966,7 @@ func (ec *executionContext) _IOTDevice_displayName(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IOTDevice_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IOTDevice_deviceBlueprintName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IOTDevice", Field: field, @@ -11286,8 +10979,8 @@ func (ec *executionContext) fieldContext_IOTDevice_displayName(ctx context.Conte return fc, nil } -func (ec *executionContext) _IOTDevice_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDevice) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDevice_environmentName(ctx, field) +func (ec *executionContext) _IOTDevice_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IOTDevice_displayName(ctx, field) if err != nil { return graphql.Null } @@ -11300,7 +10993,7 @@ func (ec *executionContext) _IOTDevice_environmentName(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnvironmentName, nil + return obj.DisplayName, nil }) if err != nil { ec.Error(ctx, err) @@ -11317,7 +11010,7 @@ func (ec *executionContext) _IOTDevice_environmentName(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IOTDevice_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IOTDevice_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IOTDevice", Field: field, @@ -11977,78 +11670,34 @@ func (ec *executionContext) _IOTDeviceBlueprint_createdBy(ctx context.Context, f } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IOTDeviceBlueprint_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IOTDeviceBlueprint", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "userEmail": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) - case "userId": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) - case "userName": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _IOTDeviceBlueprint_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeviceBlueprint) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDeviceBlueprint_creationTime(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.IOTDeviceBlueprint().CreationTime(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IOTDeviceBlueprint_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IOTDeviceBlueprint_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IOTDeviceBlueprint", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + switch field.Name { + case "userEmail": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) + case "userId": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) + case "userName": + return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) }, } return fc, nil } -func (ec *executionContext) _IOTDeviceBlueprint_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeviceBlueprint) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDeviceBlueprint_displayName(ctx, field) +func (ec *executionContext) _IOTDeviceBlueprint_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeviceBlueprint) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IOTDeviceBlueprint_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -12061,7 +11710,7 @@ func (ec *executionContext) _IOTDeviceBlueprint_displayName(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DisplayName, nil + return ec.resolvers.IOTDeviceBlueprint().CreationTime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -12075,24 +11724,24 @@ func (ec *executionContext) _IOTDeviceBlueprint_displayName(ctx context.Context, } res := resTmp.(string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IOTDeviceBlueprint_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IOTDeviceBlueprint_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IOTDeviceBlueprint", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _IOTDeviceBlueprint_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeviceBlueprint) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IOTDeviceBlueprint_environmentName(ctx, field) +func (ec *executionContext) _IOTDeviceBlueprint_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTDeviceBlueprint) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IOTDeviceBlueprint_displayName(ctx, field) if err != nil { return graphql.Null } @@ -12105,7 +11754,7 @@ func (ec *executionContext) _IOTDeviceBlueprint_environmentName(ctx context.Cont }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnvironmentName, nil + return obj.DisplayName, nil }) if err != nil { ec.Error(ctx, err) @@ -12122,7 +11771,7 @@ func (ec *executionContext) _IOTDeviceBlueprint_environmentName(ctx context.Cont return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IOTDeviceBlueprint_environmentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IOTDeviceBlueprint_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IOTDeviceBlueprint", Field: field, @@ -12585,8 +12234,6 @@ func (ec *executionContext) fieldContext_IOTDeviceBlueprintEdge_node(ctx context return ec.fieldContext_IOTDeviceBlueprint_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeviceBlueprint_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeviceBlueprint_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDeviceBlueprint_id(ctx, field) case "lastUpdatedBy": @@ -12843,18 +12490,16 @@ func (ec *executionContext) fieldContext_IOTDeviceEdge_node(ctx context.Context, switch field.Name { case "accountName": return ec.fieldContext_IOTDevice_accountName(ctx, field) - case "blueprint": - return ec.fieldContext_IOTDevice_blueprint(ctx, field) case "createdBy": return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": return ec.fieldContext_IOTDevice_creationTime(ctx, field) case "deployment": return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": return ec.fieldContext_IOTDevice_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDevice_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDevice_id(ctx, field) case "ip": @@ -13034,7 +12679,7 @@ func (ec *executionContext) fieldContext_IOTDevicePaginatedRecords_totalCount(ct return fc, nil } -func (ec *executionContext) _IOTEnvironment_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_accountName(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_accountName(ctx, field) if err != nil { return graphql.Null @@ -13078,7 +12723,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_accountName(ctx context. return fc, nil } -func (ec *executionContext) _IOTEnvironment_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_createdBy(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_createdBy(ctx, field) if err != nil { return graphql.Null @@ -13104,9 +12749,9 @@ func (ec *executionContext) _IOTEnvironment_createdBy(ctx context.Context, field } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) + res := resTmp.(*common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_IOTEnvironment_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -13130,7 +12775,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_createdBy(ctx context.Co return fc, nil } -func (ec *executionContext) _IOTEnvironment_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_creationTime(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_creationTime(ctx, field) if err != nil { return graphql.Null @@ -13144,7 +12789,7 @@ func (ec *executionContext) _IOTEnvironment_creationTime(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.IOTEnvironment().CreationTime(rctx, obj) + return obj.CreationTime, nil }) if err != nil { ec.Error(ctx, err) @@ -13165,8 +12810,8 @@ func (ec *executionContext) fieldContext_IOTEnvironment_creationTime(ctx context fc = &graphql.FieldContext{ Object: "IOTEnvironment", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type Date does not have child fields") }, @@ -13174,7 +12819,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_creationTime(ctx context return fc, nil } -func (ec *executionContext) _IOTEnvironment_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_displayName(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_displayName(ctx, field) if err != nil { return graphql.Null @@ -13218,7 +12863,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_displayName(ctx context. return fc, nil } -func (ec *executionContext) _IOTEnvironment_id(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_id(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_id(ctx, field) if err != nil { return graphql.Null @@ -13232,7 +12877,7 @@ func (ec *executionContext) _IOTEnvironment_id(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Id, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -13262,7 +12907,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_id(ctx context.Context, return fc, nil } -func (ec *executionContext) _IOTEnvironment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_lastUpdatedBy(ctx, field) if err != nil { return graphql.Null @@ -13288,9 +12933,9 @@ func (ec *executionContext) _IOTEnvironment_lastUpdatedBy(ctx context.Context, f } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) + res := resTmp.(*common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_IOTEnvironment_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -13314,7 +12959,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_lastUpdatedBy(ctx contex return fc, nil } -func (ec *executionContext) _IOTEnvironment_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_markedForDeletion(ctx, field) if err != nil { return graphql.Null @@ -13355,7 +13000,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_markedForDeletion(ctx co return fc, nil } -func (ec *executionContext) _IOTEnvironment_name(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_name(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_name(ctx, field) if err != nil { return graphql.Null @@ -13399,7 +13044,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_name(ctx context.Context return fc, nil } -func (ec *executionContext) _IOTEnvironment_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_projectName(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_projectName(ctx, field) if err != nil { return graphql.Null @@ -13443,7 +13088,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_projectName(ctx context. return fc, nil } -func (ec *executionContext) _IOTEnvironment_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_recordVersion(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_recordVersion(ctx, field) if err != nil { return graphql.Null @@ -13487,7 +13132,7 @@ func (ec *executionContext) fieldContext_IOTEnvironment_recordVersion(ctx contex return fc, nil } -func (ec *executionContext) _IOTEnvironment_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.IOTEnvironment) (ret graphql.Marshaler) { +func (ec *executionContext) _IOTEnvironment_updateTime(ctx context.Context, field graphql.CollectedField, obj *model.IOTEnvironment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IOTEnvironment_updateTime(ctx, field) if err != nil { return graphql.Null @@ -13501,7 +13146,7 @@ func (ec *executionContext) _IOTEnvironment_updateTime(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.IOTEnvironment().UpdateTime(rctx, obj) + return obj.UpdateTime, nil }) if err != nil { ec.Error(ctx, err) @@ -13522,8 +13167,8 @@ func (ec *executionContext) fieldContext_IOTEnvironment_updateTime(ctx context.C fc = &graphql.FieldContext{ Object: "IOTEnvironment", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type Date does not have child fields") }, @@ -13601,9 +13246,9 @@ func (ec *executionContext) _IOTEnvironmentEdge_node(ctx context.Context, field } return graphql.Null } - res := resTmp.(*entities.IOTEnvironment) + res := resTmp.(*model.IOTEnvironment) fc.Result = res - return ec.marshalNIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx, field.Selections, res) + return ec.marshalNIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐIOTEnvironment(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_IOTEnvironmentEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -16013,8 +15658,8 @@ func (ec *executionContext) fieldContext_Mutation_iot_deleteProject(ctx context. return fc, nil } -func (ec *executionContext) _Mutation_iot_createEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_iot_createEnvironment(ctx, field) +func (ec *executionContext) _Mutation_iot_createDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_iot_createDevice(ctx, field) if err != nil { return graphql.Null } @@ -16028,7 +15673,7 @@ func (ec *executionContext) _Mutation_iot_createEnvironment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotCreateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.IOTEnvironment)) + return ec.resolvers.Mutation().IotCreateDevice(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["device"].(entities.IOTDevice)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16050,10 +15695,10 @@ func (ec *executionContext) _Mutation_iot_createEnvironment(ctx context.Context, if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.IOTEnvironment); ok { + if data, ok := tmp.(*entities.IOTDevice); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/entities.IOTEnvironment`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDevice`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -16062,12 +15707,12 @@ func (ec *executionContext) _Mutation_iot_createEnvironment(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.IOTEnvironment) + res := resTmp.(*entities.IOTDevice) fc.Result = res - return ec.marshalOIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx, field.Selections, res) + return ec.marshalOIOTDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_iot_createEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_iot_createDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -16076,29 +15721,43 @@ func (ec *executionContext) fieldContext_Mutation_iot_createEnvironment(ctx cont Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_IOTEnvironment_accountName(ctx, field) + return ec.fieldContext_IOTDevice_accountName(ctx, field) case "createdBy": - return ec.fieldContext_IOTEnvironment_createdBy(ctx, field) + return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_IOTEnvironment_creationTime(ctx, field) + return ec.fieldContext_IOTDevice_creationTime(ctx, field) + case "deployment": + return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": - return ec.fieldContext_IOTEnvironment_displayName(ctx, field) + return ec.fieldContext_IOTDevice_displayName(ctx, field) case "id": - return ec.fieldContext_IOTEnvironment_id(ctx, field) + return ec.fieldContext_IOTDevice_id(ctx, field) + case "ip": + return ec.fieldContext_IOTDevice_ip(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_IOTEnvironment_lastUpdatedBy(ctx, field) + return ec.fieldContext_IOTDevice_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_IOTEnvironment_markedForDeletion(ctx, field) + return ec.fieldContext_IOTDevice_markedForDeletion(ctx, field) case "name": - return ec.fieldContext_IOTEnvironment_name(ctx, field) + return ec.fieldContext_IOTDevice_name(ctx, field) + case "podCIDR": + return ec.fieldContext_IOTDevice_podCIDR(ctx, field) case "projectName": - return ec.fieldContext_IOTEnvironment_projectName(ctx, field) + return ec.fieldContext_IOTDevice_projectName(ctx, field) + case "publicKey": + return ec.fieldContext_IOTDevice_publicKey(ctx, field) case "recordVersion": - return ec.fieldContext_IOTEnvironment_recordVersion(ctx, field) + return ec.fieldContext_IOTDevice_recordVersion(ctx, field) + case "serviceCIDR": + return ec.fieldContext_IOTDevice_serviceCIDR(ctx, field) case "updateTime": - return ec.fieldContext_IOTEnvironment_updateTime(ctx, field) + return ec.fieldContext_IOTDevice_updateTime(ctx, field) + case "version": + return ec.fieldContext_IOTDevice_version(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type IOTEnvironment", field.Name) + return nil, fmt.Errorf("no field named %q was found under type IOTDevice", field.Name) }, } defer func() { @@ -16108,15 +15767,15 @@ func (ec *executionContext) fieldContext_Mutation_iot_createEnvironment(ctx cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_iot_createEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_iot_createDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_iot_updateEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_iot_updateEnvironment(ctx, field) +func (ec *executionContext) _Mutation_iot_updateDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_iot_updateDevice(ctx, field) if err != nil { return graphql.Null } @@ -16130,7 +15789,7 @@ func (ec *executionContext) _Mutation_iot_updateEnvironment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotUpdateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.IOTEnvironment)) + return ec.resolvers.Mutation().IotUpdateDevice(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["device"].(entities.IOTDevice)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16152,10 +15811,10 @@ func (ec *executionContext) _Mutation_iot_updateEnvironment(ctx context.Context, if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.IOTEnvironment); ok { + if data, ok := tmp.(*entities.IOTDevice); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/entities.IOTEnvironment`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDevice`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -16164,12 +15823,12 @@ func (ec *executionContext) _Mutation_iot_updateEnvironment(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.IOTEnvironment) + res := resTmp.(*entities.IOTDevice) fc.Result = res - return ec.marshalOIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx, field.Selections, res) + return ec.marshalOIOTDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_iot_updateEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_iot_updateDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -16178,29 +15837,43 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateEnvironment(ctx cont Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_IOTEnvironment_accountName(ctx, field) + return ec.fieldContext_IOTDevice_accountName(ctx, field) case "createdBy": - return ec.fieldContext_IOTEnvironment_createdBy(ctx, field) + return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_IOTEnvironment_creationTime(ctx, field) + return ec.fieldContext_IOTDevice_creationTime(ctx, field) + case "deployment": + return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": - return ec.fieldContext_IOTEnvironment_displayName(ctx, field) + return ec.fieldContext_IOTDevice_displayName(ctx, field) case "id": - return ec.fieldContext_IOTEnvironment_id(ctx, field) + return ec.fieldContext_IOTDevice_id(ctx, field) + case "ip": + return ec.fieldContext_IOTDevice_ip(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_IOTEnvironment_lastUpdatedBy(ctx, field) + return ec.fieldContext_IOTDevice_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_IOTEnvironment_markedForDeletion(ctx, field) + return ec.fieldContext_IOTDevice_markedForDeletion(ctx, field) case "name": - return ec.fieldContext_IOTEnvironment_name(ctx, field) + return ec.fieldContext_IOTDevice_name(ctx, field) + case "podCIDR": + return ec.fieldContext_IOTDevice_podCIDR(ctx, field) case "projectName": - return ec.fieldContext_IOTEnvironment_projectName(ctx, field) + return ec.fieldContext_IOTDevice_projectName(ctx, field) + case "publicKey": + return ec.fieldContext_IOTDevice_publicKey(ctx, field) case "recordVersion": - return ec.fieldContext_IOTEnvironment_recordVersion(ctx, field) + return ec.fieldContext_IOTDevice_recordVersion(ctx, field) + case "serviceCIDR": + return ec.fieldContext_IOTDevice_serviceCIDR(ctx, field) case "updateTime": - return ec.fieldContext_IOTEnvironment_updateTime(ctx, field) + return ec.fieldContext_IOTDevice_updateTime(ctx, field) + case "version": + return ec.fieldContext_IOTDevice_version(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type IOTEnvironment", field.Name) + return nil, fmt.Errorf("no field named %q was found under type IOTDevice", field.Name) }, } defer func() { @@ -16210,15 +15883,15 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateEnvironment(ctx cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_iot_updateEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_iot_updateDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_iot_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_iot_deleteEnvironment(ctx, field) +func (ec *executionContext) _Mutation_iot_deleteDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_iot_deleteDevice(ctx, field) if err != nil { return graphql.Null } @@ -16232,7 +15905,7 @@ func (ec *executionContext) _Mutation_iot_deleteEnvironment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotDeleteEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Mutation().IotDeleteDevice(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16274,7 +15947,7 @@ func (ec *executionContext) _Mutation_iot_deleteEnvironment(ctx context.Context, return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_iot_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_iot_deleteDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -16291,15 +15964,15 @@ func (ec *executionContext) fieldContext_Mutation_iot_deleteEnvironment(ctx cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_iot_deleteEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_iot_deleteDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_iot_createDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_iot_createDevice(ctx, field) +func (ec *executionContext) _Mutation_iot_addDeviceToDeployment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_iot_addDeviceToDeployment(ctx, field) if err != nil { return graphql.Null } @@ -16313,7 +15986,7 @@ func (ec *executionContext) _Mutation_iot_createDevice(ctx context.Context, fiel resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotCreateDevice(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["device"].(entities.IOTDevice)) + return ec.resolvers.Mutation().IotAddDeviceToDeployment(rctx, fc.Args["projectName"].(string), fc.Args["deploymentName"].(string), fc.Args["deviceName"].(string), fc.Args["deviceBlueprintName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16352,7 +16025,7 @@ func (ec *executionContext) _Mutation_iot_createDevice(ctx context.Context, fiel return ec.marshalOIOTDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_iot_createDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_iot_addDeviceToDeployment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -16362,18 +16035,16 @@ func (ec *executionContext) fieldContext_Mutation_iot_createDevice(ctx context.C switch field.Name { case "accountName": return ec.fieldContext_IOTDevice_accountName(ctx, field) - case "blueprint": - return ec.fieldContext_IOTDevice_blueprint(ctx, field) case "createdBy": return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": return ec.fieldContext_IOTDevice_creationTime(ctx, field) case "deployment": return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": return ec.fieldContext_IOTDevice_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDevice_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDevice_id(ctx, field) case "ip": @@ -16409,15 +16080,15 @@ func (ec *executionContext) fieldContext_Mutation_iot_createDevice(ctx context.C } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_iot_createDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_iot_addDeviceToDeployment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_iot_updateDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_iot_updateDevice(ctx, field) +func (ec *executionContext) _Mutation_iot_removeDeviceOfDeployment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_iot_removeDeviceOfDeployment(ctx, field) if err != nil { return graphql.Null } @@ -16431,7 +16102,7 @@ func (ec *executionContext) _Mutation_iot_updateDevice(ctx context.Context, fiel resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotUpdateDevice(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["device"].(entities.IOTDevice)) + return ec.resolvers.Mutation().IotRemoveDeviceOfDeployment(rctx, fc.Args["projectName"].(string), fc.Args["deploymentName"].(string), fc.Args["deviceName"].(string), fc.Args["deviceBlueprintName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16470,7 +16141,7 @@ func (ec *executionContext) _Mutation_iot_updateDevice(ctx context.Context, fiel return ec.marshalOIOTDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_iot_updateDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_iot_removeDeviceOfDeployment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -16480,18 +16151,16 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateDevice(ctx context.C switch field.Name { case "accountName": return ec.fieldContext_IOTDevice_accountName(ctx, field) - case "blueprint": - return ec.fieldContext_IOTDevice_blueprint(ctx, field) case "createdBy": return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": return ec.fieldContext_IOTDevice_creationTime(ctx, field) case "deployment": return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": return ec.fieldContext_IOTDevice_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDevice_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDevice_id(ctx, field) case "ip": @@ -16527,88 +16196,7 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateDevice(ctx context.C } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_iot_updateDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_iot_deleteDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_iot_deleteDevice(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotDeleteDevice(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_iot_deleteDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_iot_deleteDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_iot_removeDeviceOfDeployment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -16630,7 +16218,7 @@ func (ec *executionContext) _Mutation_iot_createDeviceBlueprint(ctx context.Cont resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotCreateDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprint"].(entities.IOTDeviceBlueprint)) + return ec.resolvers.Mutation().IotCreateDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprint"].(entities.IOTDeviceBlueprint)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16687,8 +16275,6 @@ func (ec *executionContext) fieldContext_Mutation_iot_createDeviceBlueprint(ctx return ec.fieldContext_IOTDeviceBlueprint_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeviceBlueprint_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeviceBlueprint_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDeviceBlueprint_id(ctx, field) case "lastUpdatedBy": @@ -16738,7 +16324,7 @@ func (ec *executionContext) _Mutation_iot_updateDeviceBlueprint(ctx context.Cont resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotUpdateDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprint"].(entities.IOTDeviceBlueprint)) + return ec.resolvers.Mutation().IotUpdateDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprint"].(entities.IOTDeviceBlueprint)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16795,8 +16381,6 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateDeviceBlueprint(ctx return ec.fieldContext_IOTDeviceBlueprint_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeviceBlueprint_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeviceBlueprint_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDeviceBlueprint_id(ctx, field) case "lastUpdatedBy": @@ -16846,7 +16430,7 @@ func (ec *executionContext) _Mutation_iot_deleteDeviceBlueprint(ctx context.Cont resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotDeleteDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Mutation().IotDeleteDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16927,7 +16511,7 @@ func (ec *executionContext) _Mutation_iot_createDeployment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotCreateDeployment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deployment"].(entities.IOTDeployment)) + return ec.resolvers.Mutation().IotCreateDeployment(rctx, fc.Args["projectName"].(string), fc.Args["deployment"].(entities.IOTDeployment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -16984,8 +16568,6 @@ func (ec *executionContext) fieldContext_Mutation_iot_createDeployment(ctx conte return ec.fieldContext_IOTDeployment_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeployment_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeployment_environmentName(ctx, field) case "exposedServices": return ec.fieldContext_IOTDeployment_exposedServices(ctx, field) case "id": @@ -17035,7 +16617,7 @@ func (ec *executionContext) _Mutation_iot_updateDeployment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotUpdateDeployment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deployment"].(entities.IOTDeployment)) + return ec.resolvers.Mutation().IotUpdateDeployment(rctx, fc.Args["projectName"].(string), fc.Args["deployment"].(entities.IOTDeployment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17092,8 +16674,6 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateDeployment(ctx conte return ec.fieldContext_IOTDeployment_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeployment_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeployment_environmentName(ctx, field) case "exposedServices": return ec.fieldContext_IOTDeployment_exposedServices(ctx, field) case "id": @@ -17143,7 +16723,7 @@ func (ec *executionContext) _Mutation_iot_deleteDeployment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotDeleteDeployment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Mutation().IotDeleteDeployment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17224,7 +16804,7 @@ func (ec *executionContext) _Mutation_iot_createApp(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotCreateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["app"].(entities.IOTApp)) + return ec.resolvers.Mutation().IotCreateApp(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["app"].(entities.IOTApp)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17285,8 +16865,6 @@ func (ec *executionContext) fieldContext_Mutation_iot_createApp(ctx context.Cont return ec.fieldContext_IOTApp_displayName(ctx, field) case "enabled": return ec.fieldContext_IOTApp_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_IOTApp_environmentName(ctx, field) case "id": return ec.fieldContext_IOTApp_id(ctx, field) case "kind": @@ -17340,7 +16918,7 @@ func (ec *executionContext) _Mutation_iot_updateApp(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotUpdateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["app"].(entities.IOTApp)) + return ec.resolvers.Mutation().IotUpdateApp(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["app"].(entities.IOTApp)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17401,8 +16979,6 @@ func (ec *executionContext) fieldContext_Mutation_iot_updateApp(ctx context.Cont return ec.fieldContext_IOTApp_displayName(ctx, field) case "enabled": return ec.fieldContext_IOTApp_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_IOTApp_environmentName(ctx, field) case "id": return ec.fieldContext_IOTApp_id(ctx, field) case "kind": @@ -17456,7 +17032,7 @@ func (ec *executionContext) _Mutation_iot_deleteApp(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().IotDeleteApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Mutation().IotDeleteApp(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17872,8 +17448,8 @@ func (ec *executionContext) fieldContext_Query_iot_getProject(ctx context.Contex return fc, nil } -func (ec *executionContext) _Query_iot_listEnvironments(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_iot_listEnvironments(ctx, field) +func (ec *executionContext) _Query_iot_listDevices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_iot_listDevices(ctx, field) if err != nil { return graphql.Null } @@ -17887,7 +17463,7 @@ func (ec *executionContext) _Query_iot_listEnvironments(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotListEnvironments(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchIOTEnvironments), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().IotListDevices(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["search"].(*model.SearchIOTDevices), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17909,10 +17485,10 @@ func (ec *executionContext) _Query_iot_listEnvironments(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.IOTEnvironmentPaginatedRecords); ok { + if data, ok := tmp.(*model.IOTDevicePaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/app/graph/model.IOTEnvironmentPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/app/graph/model.IOTDevicePaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -17921,12 +17497,12 @@ func (ec *executionContext) _Query_iot_listEnvironments(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*model.IOTEnvironmentPaginatedRecords) + res := resTmp.(*model.IOTDevicePaginatedRecords) fc.Result = res - return ec.marshalOIOTEnvironmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐIOTEnvironmentPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOIOTDevicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐIOTDevicePaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_iot_listEnvironments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_iot_listDevices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -17935,13 +17511,13 @@ func (ec *executionContext) fieldContext_Query_iot_listEnvironments(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_IOTEnvironmentPaginatedRecords_edges(ctx, field) + return ec.fieldContext_IOTDevicePaginatedRecords_edges(ctx, field) case "pageInfo": - return ec.fieldContext_IOTEnvironmentPaginatedRecords_pageInfo(ctx, field) + return ec.fieldContext_IOTDevicePaginatedRecords_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_IOTEnvironmentPaginatedRecords_totalCount(ctx, field) + return ec.fieldContext_IOTDevicePaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type IOTEnvironmentPaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type IOTDevicePaginatedRecords", field.Name) }, } defer func() { @@ -17951,15 +17527,15 @@ func (ec *executionContext) fieldContext_Query_iot_listEnvironments(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_iot_listEnvironments_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_iot_listDevices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_iot_getEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_iot_getEnvironment(ctx, field) +func (ec *executionContext) _Query_iot_getDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_iot_getDevice(ctx, field) if err != nil { return graphql.Null } @@ -17973,7 +17549,7 @@ func (ec *executionContext) _Query_iot_getEnvironment(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotGetEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().IotGetDevice(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -17995,10 +17571,10 @@ func (ec *executionContext) _Query_iot_getEnvironment(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.IOTEnvironment); ok { + if data, ok := tmp.(*entities.IOTDevice); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/entities.IOTEnvironment`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/iot-console/internal/entities.IOTDevice`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -18007,12 +17583,12 @@ func (ec *executionContext) _Query_iot_getEnvironment(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.IOTEnvironment) + res := resTmp.(*entities.IOTDevice) fc.Result = res - return ec.marshalOIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx, field.Selections, res) + return ec.marshalOIOTDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_iot_getEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_iot_getDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -18021,29 +17597,43 @@ func (ec *executionContext) fieldContext_Query_iot_getEnvironment(ctx context.Co Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_IOTEnvironment_accountName(ctx, field) + return ec.fieldContext_IOTDevice_accountName(ctx, field) case "createdBy": - return ec.fieldContext_IOTEnvironment_createdBy(ctx, field) + return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_IOTEnvironment_creationTime(ctx, field) + return ec.fieldContext_IOTDevice_creationTime(ctx, field) + case "deployment": + return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": - return ec.fieldContext_IOTEnvironment_displayName(ctx, field) + return ec.fieldContext_IOTDevice_displayName(ctx, field) case "id": - return ec.fieldContext_IOTEnvironment_id(ctx, field) + return ec.fieldContext_IOTDevice_id(ctx, field) + case "ip": + return ec.fieldContext_IOTDevice_ip(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_IOTEnvironment_lastUpdatedBy(ctx, field) + return ec.fieldContext_IOTDevice_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_IOTEnvironment_markedForDeletion(ctx, field) + return ec.fieldContext_IOTDevice_markedForDeletion(ctx, field) case "name": - return ec.fieldContext_IOTEnvironment_name(ctx, field) + return ec.fieldContext_IOTDevice_name(ctx, field) + case "podCIDR": + return ec.fieldContext_IOTDevice_podCIDR(ctx, field) case "projectName": - return ec.fieldContext_IOTEnvironment_projectName(ctx, field) + return ec.fieldContext_IOTDevice_projectName(ctx, field) + case "publicKey": + return ec.fieldContext_IOTDevice_publicKey(ctx, field) case "recordVersion": - return ec.fieldContext_IOTEnvironment_recordVersion(ctx, field) + return ec.fieldContext_IOTDevice_recordVersion(ctx, field) + case "serviceCIDR": + return ec.fieldContext_IOTDevice_serviceCIDR(ctx, field) case "updateTime": - return ec.fieldContext_IOTEnvironment_updateTime(ctx, field) + return ec.fieldContext_IOTDevice_updateTime(ctx, field) + case "version": + return ec.fieldContext_IOTDevice_version(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type IOTEnvironment", field.Name) + return nil, fmt.Errorf("no field named %q was found under type IOTDevice", field.Name) }, } defer func() { @@ -18053,15 +17643,15 @@ func (ec *executionContext) fieldContext_Query_iot_getEnvironment(ctx context.Co } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_iot_getEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_iot_getDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_iot_listDevices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_iot_listDevices(ctx, field) +func (ec *executionContext) _Query_iot_listDeploymentDevices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_iot_listDeploymentDevices(ctx, field) if err != nil { return graphql.Null } @@ -18075,7 +17665,7 @@ func (ec *executionContext) _Query_iot_listDevices(ctx context.Context, field gr resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotListDevices(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchIOTDevices), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().IotListDeploymentDevices(rctx, fc.Args["projectName"].(string), fc.Args["deploymentName"].(string), fc.Args["search"].(*model.SearchIOTDevices), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18114,7 +17704,7 @@ func (ec *executionContext) _Query_iot_listDevices(ctx context.Context, field gr return ec.marshalOIOTDevicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐIOTDevicePaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_iot_listDevices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_iot_listDeploymentDevices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -18139,15 +17729,15 @@ func (ec *executionContext) fieldContext_Query_iot_listDevices(ctx context.Conte } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_iot_listDevices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_iot_listDeploymentDevices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_iot_getDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_iot_getDevice(ctx, field) +func (ec *executionContext) _Query_iot_getDeploymentDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_iot_getDeploymentDevice(ctx, field) if err != nil { return graphql.Null } @@ -18161,7 +17751,7 @@ func (ec *executionContext) _Query_iot_getDevice(ctx context.Context, field grap resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotGetDevice(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().IotGetDeploymentDevice(rctx, fc.Args["projectName"].(string), fc.Args["deploymentName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18200,7 +17790,7 @@ func (ec *executionContext) _Query_iot_getDevice(ctx context.Context, field grap return ec.marshalOIOTDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_iot_getDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_iot_getDeploymentDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -18210,18 +17800,16 @@ func (ec *executionContext) fieldContext_Query_iot_getDevice(ctx context.Context switch field.Name { case "accountName": return ec.fieldContext_IOTDevice_accountName(ctx, field) - case "blueprint": - return ec.fieldContext_IOTDevice_blueprint(ctx, field) case "createdBy": return ec.fieldContext_IOTDevice_createdBy(ctx, field) case "creationTime": return ec.fieldContext_IOTDevice_creationTime(ctx, field) case "deployment": return ec.fieldContext_IOTDevice_deployment(ctx, field) + case "deviceBlueprintName": + return ec.fieldContext_IOTDevice_deviceBlueprintName(ctx, field) case "displayName": return ec.fieldContext_IOTDevice_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDevice_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDevice_id(ctx, field) case "ip": @@ -18257,7 +17845,7 @@ func (ec *executionContext) fieldContext_Query_iot_getDevice(ctx context.Context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_iot_getDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_iot_getDeploymentDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -18279,7 +17867,7 @@ func (ec *executionContext) _Query_iot_listDeviceBlueprints(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotListDeviceBlueprints(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchIOTDeviceBlueprints), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().IotListDeviceBlueprints(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchIOTDeviceBlueprints), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18365,7 +17953,7 @@ func (ec *executionContext) _Query_iot_getDeviceBlueprint(ctx context.Context, f resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotGetDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().IotGetDeviceBlueprint(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18422,8 +18010,6 @@ func (ec *executionContext) fieldContext_Query_iot_getDeviceBlueprint(ctx contex return ec.fieldContext_IOTDeviceBlueprint_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeviceBlueprint_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeviceBlueprint_environmentName(ctx, field) case "id": return ec.fieldContext_IOTDeviceBlueprint_id(ctx, field) case "lastUpdatedBy": @@ -18473,7 +18059,7 @@ func (ec *executionContext) _Query_iot_listDeployments(ctx context.Context, fiel resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotListDeployments(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchIOTDeployments), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().IotListDeployments(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchIOTDeployments), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18559,7 +18145,7 @@ func (ec *executionContext) _Query_iot_getDeployment(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotGetDeployment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().IotGetDeployment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18616,8 +18202,6 @@ func (ec *executionContext) fieldContext_Query_iot_getDeployment(ctx context.Con return ec.fieldContext_IOTDeployment_creationTime(ctx, field) case "displayName": return ec.fieldContext_IOTDeployment_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_IOTDeployment_environmentName(ctx, field) case "exposedServices": return ec.fieldContext_IOTDeployment_exposedServices(ctx, field) case "id": @@ -18667,7 +18251,7 @@ func (ec *executionContext) _Query_iot_listApps(ctx context.Context, field graph resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotListApps(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["search"].(*model.SearchIOTApps), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().IotListApps(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["search"].(*model.SearchIOTApps), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18753,7 +18337,7 @@ func (ec *executionContext) _Query_iot_getApp(ctx context.Context, field graphql resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().IotGetApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().IotGetApp(rctx, fc.Args["projectName"].(string), fc.Args["deviceBlueprintName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -18814,8 +18398,6 @@ func (ec *executionContext) fieldContext_Query_iot_getApp(ctx context.Context, f return ec.fieldContext_IOTApp_displayName(ctx, field) case "enabled": return ec.fieldContext_IOTApp_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_IOTApp_environmentName(ctx, field) case "id": return ec.fieldContext_IOTApp_id(ctx, field) case "kind": @@ -22012,22 +21594,13 @@ func (ec *executionContext) unmarshalInputIOTDeviceIn(ctx context.Context, obj i asMap[k] = v } - fieldsInOrder := [...]string{"blueprint", "deployment", "displayName", "ip", "name", "podCIDR", "publicKey", "serviceCIDR", "version"} + fieldsInOrder := [...]string{"deployment", "displayName", "ip", "name", "podCIDR", "publicKey", "serviceCIDR", "version"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "blueprint": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("blueprint")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Blueprint = data case "deployment": var err error @@ -22106,8 +21679,8 @@ func (ec *executionContext) unmarshalInputIOTDeviceIn(ctx context.Context, obj i return it, nil } -func (ec *executionContext) unmarshalInputIOTEnvironmentIn(ctx context.Context, obj interface{}) (entities.IOTEnvironment, error) { - var it entities.IOTEnvironment +func (ec *executionContext) unmarshalInputIOTEnvironmentIn(ctx context.Context, obj interface{}) (model.IOTEnvironmentIn, error) { + var it model.IOTEnvironmentIn asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v @@ -22728,62 +22301,6 @@ func (ec *executionContext) unmarshalInputSearchIOTDevices(ctx context.Context, return it, nil } -func (ec *executionContext) unmarshalInputSearchIOTEnvironments(ctx context.Context, obj interface{}) (model.SearchIOTEnvironments, error) { - var it model.SearchIOTEnvironments - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "projectName", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "projectName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.ProjectName = data - case "isReady": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputSearchIOTProjects(ctx context.Context, obj interface{}) (model.SearchIOTProjects, error) { var it model.SearchIOTProjects asMap := map[string]interface{}{} @@ -23978,11 +23495,6 @@ func (ec *executionContext) _IOTApp(ctx context.Context, sel ast.SelectionSet, o } case "enabled": out.Values[i] = ec._IOTApp_enabled(ctx, field, obj) - case "environmentName": - out.Values[i] = ec._IOTApp_environmentName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "id": out.Values[i] = ec._IOTApp_id(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -24297,11 +23809,6 @@ func (ec *executionContext) _IOTDeployment(ctx context.Context, sel ast.Selectio if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "environmentName": - out.Values[i] = ec._IOTDeployment_environmentName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "exposedServices": field := field @@ -24533,11 +24040,6 @@ func (ec *executionContext) _IOTDevice(ctx context.Context, sel ast.SelectionSet if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "blueprint": - out.Values[i] = ec._IOTDevice_blueprint(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "createdBy": out.Values[i] = ec._IOTDevice_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -24584,13 +24086,13 @@ func (ec *executionContext) _IOTDevice(ctx context.Context, sel ast.SelectionSet if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "displayName": - out.Values[i] = ec._IOTDevice_displayName(ctx, field, obj) + case "deviceBlueprintName": + out.Values[i] = ec._IOTDevice_deviceBlueprintName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "environmentName": - out.Values[i] = ec._IOTDevice_environmentName(ctx, field, obj) + case "displayName": + out.Values[i] = ec._IOTDevice_displayName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -24803,11 +24305,6 @@ func (ec *executionContext) _IOTDeviceBlueprint(ctx context.Context, sel ast.Sel if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "environmentName": - out.Values[i] = ec._IOTDeviceBlueprint_environmentName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "id": out.Values[i] = ec._IOTDeviceBlueprint_id(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -25087,7 +24584,7 @@ func (ec *executionContext) _IOTDevicePaginatedRecords(ctx context.Context, sel var iOTEnvironmentImplementors = []string{"IOTEnvironment"} -func (ec *executionContext) _IOTEnvironment(ctx context.Context, sel ast.SelectionSet, obj *entities.IOTEnvironment) graphql.Marshaler { +func (ec *executionContext) _IOTEnvironment(ctx context.Context, sel ast.SelectionSet, obj *model.IOTEnvironment) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, iOTEnvironmentImplementors) out := graphql.NewFieldSet(fields) @@ -25099,117 +24596,55 @@ func (ec *executionContext) _IOTEnvironment(ctx context.Context, sel ast.Selecti case "accountName": out.Values[i] = ec._IOTEnvironment_accountName(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "createdBy": out.Values[i] = ec._IOTEnvironment_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "creationTime": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._IOTEnvironment_creationTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue + out.Values[i] = ec._IOTEnvironment_creationTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "displayName": out.Values[i] = ec._IOTEnvironment_displayName(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "id": out.Values[i] = ec._IOTEnvironment_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "lastUpdatedBy": out.Values[i] = ec._IOTEnvironment_lastUpdatedBy(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "markedForDeletion": out.Values[i] = ec._IOTEnvironment_markedForDeletion(ctx, field, obj) case "name": out.Values[i] = ec._IOTEnvironment_name(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "projectName": out.Values[i] = ec._IOTEnvironment_projectName(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "recordVersion": out.Values[i] = ec._IOTEnvironment_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "updateTime": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._IOTEnvironment_updateTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue + out.Values[i] = ec._IOTEnvironment_updateTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26009,21 +25444,6 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } - case "iot_createEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_iot_createEnvironment(ctx, field) - }) - case "iot_updateEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_iot_updateEnvironment(ctx, field) - }) - case "iot_deleteEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_iot_deleteEnvironment(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } case "iot_createDevice": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_iot_createDevice(ctx, field) @@ -26039,6 +25459,14 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } + case "iot_addDeviceToDeployment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_iot_addDeviceToDeployment(ctx, field) + }) + case "iot_removeDeviceOfDeployment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_iot_removeDeviceOfDeployment(ctx, field) + }) case "iot_createDeviceBlueprint": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_iot_createDeviceBlueprint(ctx, field) @@ -26206,7 +25634,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "iot_listEnvironments": + case "iot_listDevices": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -26215,7 +25643,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_iot_listEnvironments(ctx, field) + res = ec._Query_iot_listDevices(ctx, field) return res } @@ -26225,7 +25653,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "iot_getEnvironment": + case "iot_getDevice": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -26234,7 +25662,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_iot_getEnvironment(ctx, field) + res = ec._Query_iot_getDevice(ctx, field) return res } @@ -26244,7 +25672,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "iot_listDevices": + case "iot_listDeploymentDevices": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -26253,7 +25681,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_iot_listDevices(ctx, field) + res = ec._Query_iot_listDeploymentDevices(ctx, field) return res } @@ -26263,7 +25691,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "iot_getDevice": + case "iot_getDeploymentDevice": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -26272,7 +25700,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_iot_getDevice(ctx, field) + res = ec._Query_iot_getDeploymentDevice(ctx, field) return res } @@ -26967,6 +26395,16 @@ func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__Crea return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v) } +func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v *common.CreatedOrUpdatedBy) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, v) +} + func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppContainer2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppContainerᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppContainer) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup @@ -27464,7 +26902,7 @@ func (ec *executionContext) unmarshalNIOTDeviceIn2githubᚗcomᚋkloudliteᚋapi return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx context.Context, sel ast.SelectionSet, v *entities.IOTEnvironment) graphql.Marshaler { +func (ec *executionContext) marshalNIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐIOTEnvironment(ctx context.Context, sel ast.SelectionSet, v *model.IOTEnvironment) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "the requested element is null which the schema does not allow") @@ -27528,11 +26966,6 @@ func (ec *executionContext) marshalNIOTEnvironmentEdge2ᚖgithubᚗcomᚋkloudli return ec._IOTEnvironmentEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNIOTEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx context.Context, v interface{}) (entities.IOTEnvironment, error) { - res, err := ec.unmarshalInputIOTEnvironmentIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNIOTProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTProject(ctx context.Context, sel ast.SelectionSet, v *entities.IOTProject) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -28074,7 +27507,7 @@ func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx contex return ret } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { if v == nil { return nil, nil } @@ -28082,7 +27515,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { if v == nil { return graphql.Null } @@ -28825,20 +28258,6 @@ func (ec *executionContext) marshalOIOTDevicePaginatedRecords2ᚖgithubᚗcomᚋ return ec._IOTDevicePaginatedRecords(ctx, sel, v) } -func (ec *executionContext) marshalOIOTEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTEnvironment(ctx context.Context, sel ast.SelectionSet, v *entities.IOTEnvironment) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._IOTEnvironment(ctx, sel, v) -} - -func (ec *executionContext) marshalOIOTEnvironmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐIOTEnvironmentPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.IOTEnvironmentPaginatedRecords) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._IOTEnvironmentPaginatedRecords(ctx, sel, v) -} - func (ec *executionContext) marshalOIOTProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋentitiesᚐIOTProject(ctx context.Context, sel ast.SelectionSet, v *entities.IOTProject) graphql.Marshaler { if v == nil { return graphql.Null @@ -29201,14 +28620,6 @@ func (ec *executionContext) unmarshalOSearchIOTDevices2ᚖgithubᚗcomᚋkloudli return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOSearchIOTEnvironments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTEnvironments(ctx context.Context, v interface{}) (*model.SearchIOTEnvironments, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputSearchIOTEnvironments(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) unmarshalOSearchIOTProjects2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchIOTProjects(ctx context.Context, v interface{}) (*model.SearchIOTProjects, error) { if v == nil { return nil, nil diff --git a/apps/iot-console/internal/app/graph/iotenvironment.resolvers.go b/apps/iot-console/internal/app/graph/iotenvironment.resolvers.go deleted file mode 100644 index ead586753..000000000 --- a/apps/iot-console/internal/app/graph/iotenvironment.resolvers.go +++ /dev/null @@ -1,36 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.39 - -import ( - "context" - "time" - - "github.com/kloudlite/api/apps/iot-console/internal/app/graph/generated" - "github.com/kloudlite/api/apps/iot-console/internal/entities" -) - -// CreationTime is the resolver for the creationTime field. -func (r *iOTEnvironmentResolver) CreationTime(ctx context.Context, obj *entities.IOTEnvironment) (string, error) { - if obj == nil { - return "", errNilEnvironment - } - return obj.CreationTime.Format(time.RFC3339), nil -} - -// UpdateTime is the resolver for the updateTime field. -func (r *iOTEnvironmentResolver) UpdateTime(ctx context.Context, obj *entities.IOTEnvironment) (string, error) { - if obj == nil { - return "", errNilEnvironment - } - return obj.UpdateTime.Format(time.RFC3339), nil -} - -// IOTEnvironment returns generated.IOTEnvironmentResolver implementation. -func (r *Resolver) IOTEnvironment() generated.IOTEnvironmentResolver { - return &iOTEnvironmentResolver{r} -} - -type iOTEnvironmentResolver struct{ *Resolver } diff --git a/apps/iot-console/internal/app/graph/model/models_gen.go b/apps/iot-console/internal/app/graph/model/models_gen.go index bd4779580..38a934fa1 100644 --- a/apps/iot-console/internal/app/graph/model/models_gen.go +++ b/apps/iot-console/internal/app/graph/model/models_gen.go @@ -8,6 +8,7 @@ import ( "strconv" "github.com/kloudlite/api/apps/iot-console/internal/entities" + "github.com/kloudlite/api/common" "github.com/kloudlite/api/pkg/repos" ) @@ -314,9 +315,28 @@ type IOTDevicePaginatedRecords struct { TotalCount int `json:"totalCount"` } +type IOTEnvironment struct { + AccountName string `json:"accountName"` + CreatedBy *common.CreatedOrUpdatedBy `json:"createdBy"` + CreationTime string `json:"creationTime"` + DisplayName string `json:"displayName"` + ID repos.ID `json:"id"` + LastUpdatedBy *common.CreatedOrUpdatedBy `json:"lastUpdatedBy"` + MarkedForDeletion *bool `json:"markedForDeletion,omitempty"` + Name string `json:"name"` + ProjectName string `json:"projectName"` + RecordVersion int `json:"recordVersion"` + UpdateTime string `json:"updateTime"` +} + type IOTEnvironmentEdge struct { - Cursor string `json:"cursor"` - Node *entities.IOTEnvironment `json:"node"` + Cursor string `json:"cursor"` + Node *IOTEnvironment `json:"node"` +} + +type IOTEnvironmentIn struct { + DisplayName string `json:"displayName"` + Name string `json:"name"` } type IOTEnvironmentPaginatedRecords struct { @@ -427,13 +447,6 @@ type SearchIOTDevices struct { MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` } -type SearchIOTEnvironments struct { - Text *repos.MatchFilter `json:"text,omitempty"` - ProjectName *repos.MatchFilter `json:"projectName,omitempty"` - IsReady *repos.MatchFilter `json:"isReady,omitempty"` - MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` -} - type SearchIOTProjects struct { Text *repos.MatchFilter `json:"text,omitempty"` IsReady *repos.MatchFilter `json:"isReady,omitempty"` diff --git a/apps/iot-console/internal/app/graph/resolver-utils.go b/apps/iot-console/internal/app/graph/resolver-utils.go index 71cc244e5..76b0aca6e 100644 --- a/apps/iot-console/internal/app/graph/resolver-utils.go +++ b/apps/iot-console/internal/app/graph/resolver-utils.go @@ -46,16 +46,14 @@ func toIOTConsoleContext(ctx context.Context) (domain.IotConsoleContext, error) var ( errNilDeployment = errors.Newf("deployment object is nil") errNilProject = errors.Newf("project object is nil") - errNilEnvironment = errors.Newf("environment object is nil") errNilDevice = errors.Newf("device object is nil") errNilDeviceBlueprint = errors.Newf("device group object is nil") errNilApp = errors.Newf("app object is nil") ) -func newIOTResourceContext(ctx domain.IotConsoleContext, projectName string, environmentName string) domain.IotResourceContext { +func newIOTResourceContext(ctx domain.IotConsoleContext, projectName string) domain.IotResourceContext { return domain.IotResourceContext{ IotConsoleContext: ctx, ProjectName: projectName, - EnvironmentName: environmentName, } } diff --git a/apps/iot-console/internal/app/graph/schema.graphqls b/apps/iot-console/internal/app/graph/schema.graphqls index 8c7f44178..35f31aa94 100644 --- a/apps/iot-console/internal/app/graph/schema.graphqls +++ b/apps/iot-console/internal/app/graph/schema.graphqls @@ -8,13 +8,6 @@ input SearchIOTProjects { markedForDeletion: MatchFilterIn } -input SearchIOTEnvironments { - text: MatchFilterIn - projectName: MatchFilterIn - isReady: MatchFilterIn - markedForDeletion: MatchFilterIn -} - input SearchIOTDeployments { text: MatchFilterIn isReady: MatchFilterIn @@ -43,20 +36,20 @@ type Query { iot_listProjects(search: SearchIOTProjects, pq: CursorPaginationIn): IOTProjectPaginatedRecords @isLoggedInAndVerified @hasAccount iot_getProject(name: String!): IOTProject @isLoggedInAndVerified @hasAccount - iot_listEnvironments(projectName: String!,search: SearchIOTEnvironments, pq: CursorPaginationIn): IOTEnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getEnvironment(projectName: String!, name: String!): IOTEnvironment @isLoggedInAndVerified @hasAccount + iot_listDevices(projectName: String!, deviceBlueprintName: String!, search: SearchIOTDevices, pq: CursorPaginationIn): IOTDevicePaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDevice(projectName: String!, deviceBlueprintName: String!, name: String!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_listDevices(projectName: String!, envName: String!,search: SearchIOTDevices, pq: CursorPaginationIn): IOTDevicePaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getDevice(projectName: String!, envName: String!, name: String!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_listDeploymentDevices(projectName: String!, deploymentName: String!, search: SearchIOTDevices, pq: CursorPaginationIn): IOTDevicePaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDeploymentDevice(projectName: String!, deploymentName: String!, name: String!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_listDeviceBlueprints(projectName: String!, envName: String!,search: SearchIOTDeviceBlueprints, pq: CursorPaginationIn): IOTDeviceBlueprintPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getDeviceBlueprint(projectName: String!, envName: String!, name: String!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount + iot_listDeviceBlueprints(projectName: String!,search: SearchIOTDeviceBlueprints, pq: CursorPaginationIn): IOTDeviceBlueprintPaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDeviceBlueprint(projectName: String!, name: String!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount - iot_listDeployments(projectName: String!, envName: String!,search: SearchIOTDeployments, pq: CursorPaginationIn): IOTDeploymentPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getDeployment(projectName: String!, envName: String!, name: String!): IOTDeployment @isLoggedInAndVerified @hasAccount + iot_listDeployments(projectName: String!,search: SearchIOTDeployments, pq: CursorPaginationIn): IOTDeploymentPaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getDeployment(projectName: String!, name: String!): IOTDeployment @isLoggedInAndVerified @hasAccount - iot_listApps(projectName: String!, envName: String!, deviceBlueprintName: String!,search: SearchIOTApps, pq: CursorPaginationIn): IOTAppPaginatedRecords @isLoggedInAndVerified @hasAccount - iot_getApp(projectName: String!, envName: String!, deviceBlueprintName: String!, name: String!): IOTApp @isLoggedInAndVerified @hasAccount + iot_listApps(projectName: String!, deviceBlueprintName: String!,search: SearchIOTApps, pq: CursorPaginationIn): IOTAppPaginatedRecords @isLoggedInAndVerified @hasAccount + iot_getApp(projectName: String!, deviceBlueprintName: String!, name: String!): IOTApp @isLoggedInAndVerified @hasAccount } type Mutation { @@ -64,23 +57,22 @@ type Mutation { iot_updateProject(project: IOTProjectIn!): IOTProject @isLoggedInAndVerified @hasAccount iot_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createEnvironment(projectName: String!,env: IOTEnvironmentIn!): IOTEnvironment @isLoggedInAndVerified @hasAccount - iot_updateEnvironment(projectName: String!,env: IOTEnvironmentIn!): IOTEnvironment @isLoggedInAndVerified @hasAccount - iot_deleteEnvironment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createDevice(projectName: String!, deviceBlueprintName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_updateDevice(projectName: String!, deviceBlueprintName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_deleteDevice(projectName: String!, deviceBlueprintName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createDevice(projectName: String!, envName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_updateDevice(projectName: String!, envName: String!, device: IOTDeviceIn!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_deleteDevice(projectName: String!, envName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_addDeviceToDeployment(projectName: String!,deploymentName: String!, deviceName: String!, deviceBlueprintName: String!): IOTDevice @isLoggedInAndVerified @hasAccount + iot_removeDeviceOfDeployment(projectName: String!,deploymentName: String!, deviceName: String!, deviceBlueprintName: String!): IOTDevice @isLoggedInAndVerified @hasAccount - iot_createDeviceBlueprint(projectName: String!, envName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount - iot_updateDeviceBlueprint(projectName: String!, envName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount - iot_deleteDeviceBlueprint(projectName: String!, envName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createDeviceBlueprint(projectName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount + iot_updateDeviceBlueprint(projectName: String!, deviceBlueprint: IOTDeviceBlueprintIn!): IOTDeviceBlueprint @isLoggedInAndVerified @hasAccount + iot_deleteDeviceBlueprint(projectName: String!,name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createDeployment(projectName: String!, envName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount - iot_updateDeployment(projectName: String!, envName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount - iot_deleteDeployment(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createDeployment(projectName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount + iot_updateDeployment(projectName: String!, deployment: IOTDeploymentIn!): IOTDeployment @isLoggedInAndVerified @hasAccount + iot_deleteDeployment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - iot_createApp(projectName: String!, envName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount - iot_updateApp(projectName: String!, envName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount - iot_deleteApp(projectName: String!, envName: String!, deviceBlueprintName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + iot_createApp(projectName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount + iot_updateApp(projectName: String!, deviceBlueprintName: String!, app: IOTAppIn!): IOTApp @isLoggedInAndVerified @hasAccount + iot_deleteApp(projectName: String!, deviceBlueprintName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount } diff --git a/apps/iot-console/internal/app/graph/schema.resolvers.go b/apps/iot-console/internal/app/graph/schema.resolvers.go index 7774bf54d..c89a4de8c 100644 --- a/apps/iot-console/internal/app/graph/schema.resolvers.go +++ b/apps/iot-console/internal/app/graph/schema.resolvers.go @@ -44,151 +44,139 @@ func (r *mutationResolver) IotDeleteProject(ctx context.Context, name string) (b return true, nil } -// IotCreateEnvironment is the resolver for the iot_createEnvironment field. -func (r *mutationResolver) IotCreateEnvironment(ctx context.Context, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) { +// IotCreateDevice is the resolver for the iot_createDevice field. +func (r *mutationResolver) IotCreateDevice(ctx context.Context, projectName string, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateEnvironment(ic, projectName, env) + return r.Domain.CreateDevice(newIOTResourceContext(ic, projectName), deviceBlueprintName, device) } -// IotUpdateEnvironment is the resolver for the iot_updateEnvironment field. -func (r *mutationResolver) IotUpdateEnvironment(ctx context.Context, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) { +// IotUpdateDevice is the resolver for the iot_updateDevice field. +func (r *mutationResolver) IotUpdateDevice(ctx context.Context, projectName string, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateEnvironment(ic, projectName, env) + return r.Domain.UpdateDevice(newIOTResourceContext(ic, projectName), deviceBlueprintName, device) } -// IotDeleteEnvironment is the resolver for the iot_deleteEnvironment field. -func (r *mutationResolver) IotDeleteEnvironment(ctx context.Context, projectName string, name string) (bool, error) { +// IotDeleteDevice is the resolver for the iot_deleteDevice field. +func (r *mutationResolver) IotDeleteDevice(ctx context.Context, projectName string, deviceBlueprintName string, name string) (bool, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteEnvironment(ic, projectName, name); err != nil { + if err := r.Domain.DeleteDevice(newIOTResourceContext(ic, projectName), deviceBlueprintName, name); err != nil { return false, errors.NewE(err) } return true, nil } -// IotCreateDevice is the resolver for the iot_createDevice field. -func (r *mutationResolver) IotCreateDevice(ctx context.Context, projectName string, envName string, device entities.IOTDevice) (*entities.IOTDevice, error) { +// IotAddDeviceToDeployment is the resolver for the iot_addDeviceToDeployment field. +func (r *mutationResolver) IotAddDeviceToDeployment(ctx context.Context, projectName string, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateDevice(newIOTResourceContext(ic, projectName, envName), device) + return r.Domain.AddDeviceToDeployment(newIOTResourceContext(ic, projectName), deploymentName, deviceName, deviceBlueprintName) } -// IotUpdateDevice is the resolver for the iot_updateDevice field. -func (r *mutationResolver) IotUpdateDevice(ctx context.Context, projectName string, envName string, device entities.IOTDevice) (*entities.IOTDevice, error) { +// IotRemoveDeviceOfDeployment is the resolver for the iot_removeDeviceOfDeployment field. +func (r *mutationResolver) IotRemoveDeviceOfDeployment(ctx context.Context, projectName string, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateDevice(newIOTResourceContext(ic, projectName, envName), device) -} - -// IotDeleteDevice is the resolver for the iot_deleteDevice field. -func (r *mutationResolver) IotDeleteDevice(ctx context.Context, projectName string, envName string, name string) (bool, error) { - ic, err := toIOTConsoleContext(ctx) - if err != nil { - return false, errors.NewE(err) - } - if err := r.Domain.DeleteDevice(newIOTResourceContext(ic, projectName, envName), name); err != nil { - return false, errors.NewE(err) - } - return true, nil + return r.Domain.RemoveDeviceOfDeployment(newIOTResourceContext(ic, projectName), deploymentName, deviceName, deviceBlueprintName) } // IotCreateDeviceBlueprint is the resolver for the iot_createDeviceBlueprint field. -func (r *mutationResolver) IotCreateDeviceBlueprint(ctx context.Context, projectName string, envName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) { +func (r *mutationResolver) IotCreateDeviceBlueprint(ctx context.Context, projectName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateDeviceBlueprint(newIOTResourceContext(ic, projectName, envName), deviceBlueprint) + return r.Domain.CreateDeviceBlueprint(newIOTResourceContext(ic, projectName), deviceBlueprint) } // IotUpdateDeviceBlueprint is the resolver for the iot_updateDeviceBlueprint field. -func (r *mutationResolver) IotUpdateDeviceBlueprint(ctx context.Context, projectName string, envName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) { +func (r *mutationResolver) IotUpdateDeviceBlueprint(ctx context.Context, projectName string, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateDeviceBlueprint(newIOTResourceContext(ic, projectName, envName), deviceBlueprint) + return r.Domain.UpdateDeviceBlueprint(newIOTResourceContext(ic, projectName), deviceBlueprint) } // IotDeleteDeviceBlueprint is the resolver for the iot_deleteDeviceBlueprint field. -func (r *mutationResolver) IotDeleteDeviceBlueprint(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *mutationResolver) IotDeleteDeviceBlueprint(ctx context.Context, projectName string, name string) (bool, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteDeviceBlueprint(newIOTResourceContext(ic, projectName, envName), name); err != nil { + if err := r.Domain.DeleteDeviceBlueprint(newIOTResourceContext(ic, projectName), name); err != nil { return false, errors.NewE(err) } return true, nil } // IotCreateDeployment is the resolver for the iot_createDeployment field. -func (r *mutationResolver) IotCreateDeployment(ctx context.Context, projectName string, envName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { +func (r *mutationResolver) IotCreateDeployment(ctx context.Context, projectName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateDeployment(newIOTResourceContext(ic, projectName, envName), deployment) + return r.Domain.CreateDeployment(newIOTResourceContext(ic, projectName), deployment) } // IotUpdateDeployment is the resolver for the iot_updateDeployment field. -func (r *mutationResolver) IotUpdateDeployment(ctx context.Context, projectName string, envName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { +func (r *mutationResolver) IotUpdateDeployment(ctx context.Context, projectName string, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateDeployment(newIOTResourceContext(ic, projectName, envName), deployment) + return r.Domain.UpdateDeployment(newIOTResourceContext(ic, projectName), deployment) } // IotDeleteDeployment is the resolver for the iot_deleteDeployment field. -func (r *mutationResolver) IotDeleteDeployment(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *mutationResolver) IotDeleteDeployment(ctx context.Context, projectName string, name string) (bool, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteDeployment(newIOTResourceContext(ic, projectName, envName), name); err != nil { + if err := r.Domain.DeleteDeployment(newIOTResourceContext(ic, projectName), name); err != nil { return false, errors.NewE(err) } return true, nil } // IotCreateApp is the resolver for the iot_createApp field. -func (r *mutationResolver) IotCreateApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) { +func (r *mutationResolver) IotCreateApp(ctx context.Context, projectName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateApp(newIOTResourceContext(ic, projectName, envName), deviceBlueprintName, app) + return r.Domain.CreateApp(newIOTResourceContext(ic, projectName), deviceBlueprintName, app) } // IotUpdateApp is the resolver for the iot_updateApp field. -func (r *mutationResolver) IotUpdateApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) { +func (r *mutationResolver) IotUpdateApp(ctx context.Context, projectName string, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateApp(newIOTResourceContext(ic, projectName, envName), deviceBlueprintName, app) + return r.Domain.UpdateApp(newIOTResourceContext(ic, projectName), deviceBlueprintName, app) } // IotDeleteApp is the resolver for the iot_deleteApp field. -func (r *mutationResolver) IotDeleteApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, name string) (bool, error) { +func (r *mutationResolver) IotDeleteApp(ctx context.Context, projectName string, deviceBlueprintName string, name string) (bool, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteApp(newIOTResourceContext(ic, projectName, envName), deviceBlueprintName, name); err != nil { + if err := r.Domain.DeleteApp(newIOTResourceContext(ic, projectName), deviceBlueprintName, name); err != nil { return false, errors.NewE(err) } return true, nil @@ -224,8 +212,8 @@ func (r *queryResolver) IotGetProject(ctx context.Context, name string) (*entiti return r.Domain.GetProject(ic, name) } -// IotListEnvironments is the resolver for the iot_listEnvironments field. -func (r *queryResolver) IotListEnvironments(ctx context.Context, projectName string, search *model.SearchIOTEnvironments, pq *repos.CursorPagination) (*model.IOTEnvironmentPaginatedRecords, error) { +// IotListDevices is the resolver for the iot_listDevices field. +func (r *queryResolver) IotListDevices(ctx context.Context, projectName string, deviceBlueprintName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) (*model.IOTDevicePaginatedRecords, error) { filter := map[string]repos.MatchFilter{} if search != nil { if search.Text != nil { @@ -237,26 +225,25 @@ func (r *queryResolver) IotListEnvironments(ctx context.Context, projectName str return nil, errors.NewE(err) } - e, err := r.Domain.ListEnvironments(ic, projectName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + e, err := r.Domain.ListDevices(newIOTResourceContext(ic, projectName), deviceBlueprintName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } - return fn.JsonConvertP[model.IOTEnvironmentPaginatedRecords](e) + return fn.JsonConvertP[model.IOTDevicePaginatedRecords](e) } -// IotGetEnvironment is the resolver for the iot_getEnvironment field. -func (r *queryResolver) IotGetEnvironment(ctx context.Context, projectName string, name string) (*entities.IOTEnvironment, error) { +// IotGetDevice is the resolver for the iot_getDevice field. +func (r *queryResolver) IotGetDevice(ctx context.Context, projectName string, deviceBlueprintName string, name string) (*entities.IOTDevice, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - - return r.Domain.GetEnvironment(ic, projectName, name) + return r.Domain.GetDevice(newIOTResourceContext(ic, projectName), name, deviceBlueprintName) } -// IotListDevices is the resolver for the iot_listDevices field. -func (r *queryResolver) IotListDevices(ctx context.Context, projectName string, envName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) (*model.IOTDevicePaginatedRecords, error) { +// IotListDeploymentDevices is the resolver for the iot_listDeploymentDevices field. +func (r *queryResolver) IotListDeploymentDevices(ctx context.Context, projectName string, deploymentName string, search *model.SearchIOTDevices, pq *repos.CursorPagination) (*model.IOTDevicePaginatedRecords, error) { filter := map[string]repos.MatchFilter{} if search != nil { if search.Text != nil { @@ -268,7 +255,7 @@ func (r *queryResolver) IotListDevices(ctx context.Context, projectName string, return nil, errors.NewE(err) } - e, err := r.Domain.ListDevices(newIOTResourceContext(ic, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + e, err := r.Domain.ListDeploymentDevices(newIOTResourceContext(ic, projectName), deploymentName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -276,17 +263,17 @@ func (r *queryResolver) IotListDevices(ctx context.Context, projectName string, return fn.JsonConvertP[model.IOTDevicePaginatedRecords](e) } -// IotGetDevice is the resolver for the iot_getDevice field. -func (r *queryResolver) IotGetDevice(ctx context.Context, projectName string, envName string, name string) (*entities.IOTDevice, error) { +// IotGetDeploymentDevice is the resolver for the iot_getDeploymentDevice field. +func (r *queryResolver) IotGetDeploymentDevice(ctx context.Context, projectName string, deploymentName string, name string) (*entities.IOTDevice, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetDevice(newIOTResourceContext(ic, projectName, envName), name) + return r.Domain.GetDeploymentDevice(newIOTResourceContext(ic, projectName), name, deploymentName) } // IotListDeviceBlueprints is the resolver for the iot_listDeviceBlueprints field. -func (r *queryResolver) IotListDeviceBlueprints(ctx context.Context, projectName string, envName string, search *model.SearchIOTDeviceBlueprints, pq *repos.CursorPagination) (*model.IOTDeviceBlueprintPaginatedRecords, error) { +func (r *queryResolver) IotListDeviceBlueprints(ctx context.Context, projectName string, search *model.SearchIOTDeviceBlueprints, pq *repos.CursorPagination) (*model.IOTDeviceBlueprintPaginatedRecords, error) { filter := map[string]repos.MatchFilter{} if search != nil { if search.Text != nil { @@ -298,7 +285,7 @@ func (r *queryResolver) IotListDeviceBlueprints(ctx context.Context, projectName return nil, errors.NewE(err) } - e, err := r.Domain.ListDeviceBlueprints(newIOTResourceContext(ic, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + e, err := r.Domain.ListDeviceBlueprints(newIOTResourceContext(ic, projectName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -307,16 +294,16 @@ func (r *queryResolver) IotListDeviceBlueprints(ctx context.Context, projectName } // IotGetDeviceBlueprint is the resolver for the iot_getDeviceBlueprint field. -func (r *queryResolver) IotGetDeviceBlueprint(ctx context.Context, projectName string, envName string, name string) (*entities.IOTDeviceBlueprint, error) { +func (r *queryResolver) IotGetDeviceBlueprint(ctx context.Context, projectName string, name string) (*entities.IOTDeviceBlueprint, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetDeviceBlueprint(newIOTResourceContext(ic, projectName, envName), name) + return r.Domain.GetDeviceBlueprint(newIOTResourceContext(ic, projectName), name) } // IotListDeployments is the resolver for the iot_listDeployments field. -func (r *queryResolver) IotListDeployments(ctx context.Context, projectName string, envName string, search *model.SearchIOTDeployments, pq *repos.CursorPagination) (*model.IOTDeploymentPaginatedRecords, error) { +func (r *queryResolver) IotListDeployments(ctx context.Context, projectName string, search *model.SearchIOTDeployments, pq *repos.CursorPagination) (*model.IOTDeploymentPaginatedRecords, error) { filter := map[string]repos.MatchFilter{} if search != nil { if search.Text != nil { @@ -328,7 +315,7 @@ func (r *queryResolver) IotListDeployments(ctx context.Context, projectName stri return nil, errors.NewE(err) } - d, err := r.Domain.ListDeployments(newIOTResourceContext(ic, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + d, err := r.Domain.ListDeployments(newIOTResourceContext(ic, projectName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -337,16 +324,16 @@ func (r *queryResolver) IotListDeployments(ctx context.Context, projectName stri } // IotGetDeployment is the resolver for the iot_getDeployment field. -func (r *queryResolver) IotGetDeployment(ctx context.Context, projectName string, envName string, name string) (*entities.IOTDeployment, error) { +func (r *queryResolver) IotGetDeployment(ctx context.Context, projectName string, name string) (*entities.IOTDeployment, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetDeployment(newIOTResourceContext(ic, projectName, envName), name) + return r.Domain.GetDeployment(newIOTResourceContext(ic, projectName), name) } // IotListApps is the resolver for the iot_listApps field. -func (r *queryResolver) IotListApps(ctx context.Context, projectName string, envName string, deviceBlueprintName string, search *model.SearchIOTApps, pq *repos.CursorPagination) (*model.IOTAppPaginatedRecords, error) { +func (r *queryResolver) IotListApps(ctx context.Context, projectName string, deviceBlueprintName string, search *model.SearchIOTApps, pq *repos.CursorPagination) (*model.IOTAppPaginatedRecords, error) { filter := map[string]repos.MatchFilter{} if search != nil { if search.Text != nil { @@ -358,7 +345,7 @@ func (r *queryResolver) IotListApps(ctx context.Context, projectName string, env return nil, errors.NewE(err) } - d, err := r.Domain.ListApps(newIOTResourceContext(ic, projectName, envName), deviceBlueprintName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + d, err := r.Domain.ListApps(newIOTResourceContext(ic, projectName), deviceBlueprintName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -367,12 +354,12 @@ func (r *queryResolver) IotListApps(ctx context.Context, projectName string, env } // IotGetApp is the resolver for the iot_getApp field. -func (r *queryResolver) IotGetApp(ctx context.Context, projectName string, envName string, deviceBlueprintName string, name string) (*entities.IOTApp, error) { +func (r *queryResolver) IotGetApp(ctx context.Context, projectName string, deviceBlueprintName string, name string) (*entities.IOTApp, error) { ic, err := toIOTConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetApp(newIOTResourceContext(ic, projectName, envName), deviceBlueprintName, name) + return r.Domain.GetApp(newIOTResourceContext(ic, projectName), deviceBlueprintName, name) } // Mutation returns generated.MutationResolver implementation. diff --git a/apps/iot-console/internal/app/graph/struct-to-graphql/iotapp.graphqls b/apps/iot-console/internal/app/graph/struct-to-graphql/iotapp.graphqls index d29c88fdb..29b9d3ffe 100644 --- a/apps/iot-console/internal/app/graph/struct-to-graphql/iotapp.graphqls +++ b/apps/iot-console/internal/app/graph/struct-to-graphql/iotapp.graphqls @@ -6,7 +6,6 @@ type IOTApp @shareable { deviceBlueprintName: String! displayName: String! enabled: Boolean - environmentName: String! id: ID! kind: String lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! diff --git a/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeployment.graphqls b/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeployment.graphqls index a09e48d33..422b33dc2 100644 --- a/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeployment.graphqls +++ b/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeployment.graphqls @@ -4,7 +4,6 @@ type IOTDeployment @shareable { createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! - environmentName: String! exposedServices: [Github__com___kloudlite___api___apps___iot____console___internal___entities__ExposedService!]! id: ID! lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! diff --git a/apps/iot-console/internal/app/graph/struct-to-graphql/iotdevice.graphqls b/apps/iot-console/internal/app/graph/struct-to-graphql/iotdevice.graphqls index 3da9969a3..f96060f7f 100644 --- a/apps/iot-console/internal/app/graph/struct-to-graphql/iotdevice.graphqls +++ b/apps/iot-console/internal/app/graph/struct-to-graphql/iotdevice.graphqls @@ -1,11 +1,10 @@ type IOTDevice @shareable { accountName: String! - blueprint: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! deployment: String! + deviceBlueprintName: String! displayName: String! - environmentName: String! id: ID! ip: String! lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! @@ -32,7 +31,6 @@ type IOTDevicePaginatedRecords @shareable { } input IOTDeviceIn { - blueprint: String! deployment: String! displayName: String! ip: String! diff --git a/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeviceblueprint.graphqls b/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeviceblueprint.graphqls index 24cfc927d..1b82a687a 100644 --- a/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeviceblueprint.graphqls +++ b/apps/iot-console/internal/app/graph/struct-to-graphql/iotdeviceblueprint.graphqls @@ -4,7 +4,6 @@ type IOTDeviceBlueprint @shareable { createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! - environmentName: String! id: ID! lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean diff --git a/apps/iot-console/internal/domain/api.go b/apps/iot-console/internal/domain/api.go index 1250bfda5..f1d9e8721 100644 --- a/apps/iot-console/internal/domain/api.go +++ b/apps/iot-console/internal/domain/api.go @@ -18,15 +18,14 @@ type IotConsoleContext struct { type IotResourceContext struct { IotConsoleContext - ProjectName string - EnvironmentName string + ProjectName string + //EnvironmentName string } func (r IotResourceContext) IOTConsoleDBFilters() repos.Filter { return repos.Filter{ - fields.AccountName: r.AccountName, - fields.ProjectName: r.ProjectName, - fields.EnvironmentName: r.EnvironmentName, + fields.AccountName: r.AccountName, + fields.ProjectName: r.ProjectName, } } @@ -49,13 +48,6 @@ type Domain interface { UpdateProject(ctx IotConsoleContext, project entities.IOTProject) (*entities.IOTProject, error) DeleteProject(ctx IotConsoleContext, name string) error - ListEnvironments(ctx IotConsoleContext, projectName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTEnvironment], error) - GetEnvironment(ctx IotConsoleContext, projectName string, name string) (*entities.IOTEnvironment, error) - - CreateEnvironment(ctx IotConsoleContext, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) - UpdateEnvironment(ctx IotConsoleContext, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) - DeleteEnvironment(ctx IotConsoleContext, projectName string, name string) error - ListDeployments(ctx IotResourceContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDeployment], error) GetDeployment(ctx IotResourceContext, name string) (*entities.IOTDeployment, error) @@ -63,12 +55,17 @@ type Domain interface { UpdateDeployment(ctx IotResourceContext, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) DeleteDeployment(ctx IotResourceContext, name string) error - ListDevices(ctx IotResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDevice], error) - GetDevice(ctx IotResourceContext, name string) (*entities.IOTDevice, error) + ListDevices(ctx IotResourceContext, deviceBlueprintName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDevice], error) + GetDevice(ctx IotResourceContext, name string, deviceBlueprintName string) (*entities.IOTDevice, error) + ListDeploymentDevices(ctx IotResourceContext, deploymentName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDevice], error) + GetDeploymentDevice(ctx IotResourceContext, name string, deploymentName string) (*entities.IOTDevice, error) + + CreateDevice(ctx IotResourceContext, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) + UpdateDevice(ctx IotResourceContext, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) + DeleteDevice(ctx IotResourceContext, deviceBlueprintName string, name string) error - CreateDevice(ctx IotResourceContext, device entities.IOTDevice) (*entities.IOTDevice, error) - UpdateDevice(ctx IotResourceContext, device entities.IOTDevice) (*entities.IOTDevice, error) - DeleteDevice(ctx IotResourceContext, name string) error + AddDeviceToDeployment(ctx IotResourceContext, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) + RemoveDeviceOfDeployment(ctx IotResourceContext, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) ListDeviceBlueprints(ctx IotResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDeviceBlueprint], error) GetDeviceBlueprint(ctx IotResourceContext, name string) (*entities.IOTDeviceBlueprint, error) diff --git a/apps/iot-console/internal/domain/domain.go b/apps/iot-console/internal/domain/domain.go index a626c07f3..805815cd1 100644 --- a/apps/iot-console/internal/domain/domain.go +++ b/apps/iot-console/internal/domain/domain.go @@ -15,7 +15,6 @@ type domain struct { logger logging.Logger iotProjectRepo repos.DbRepo[*entities.IOTProject] - iotEnvironmentRepo repos.DbRepo[*entities.IOTEnvironment] iotDeploymentRepo repos.DbRepo[*entities.IOTDeployment] iotDeviceRepo repos.DbRepo[*entities.IOTDevice] iotDeviceBlueprintRepo repos.DbRepo[*entities.IOTDeviceBlueprint] @@ -32,7 +31,6 @@ var Module = fx.Module("domain", logger logging.Logger, iotProjectRepo repos.DbRepo[*entities.IOTProject], - iotEnvironmentRepo repos.DbRepo[*entities.IOTEnvironment], iotDeploymentRepo repos.DbRepo[*entities.IOTDeployment], iotDeviceRepo repos.DbRepo[*entities.IOTDevice], iotDeviceBlueprintRepo repos.DbRepo[*entities.IOTDeviceBlueprint], @@ -44,7 +42,6 @@ var Module = fx.Module("domain", k8sClient: k8sClient, logger: logger, iotProjectRepo: iotProjectRepo, - iotEnvironmentRepo: iotEnvironmentRepo, iotDeploymentRepo: iotDeploymentRepo, iotDeviceRepo: iotDeviceRepo, iotDeviceBlueprintRepo: iotDeviceBlueprintRepo, diff --git a/apps/iot-console/internal/domain/iot-app.go b/apps/iot-console/internal/domain/iot-app.go index fea7e6e5d..161b23b85 100644 --- a/apps/iot-console/internal/domain/iot-app.go +++ b/apps/iot-console/internal/domain/iot-app.go @@ -36,7 +36,6 @@ func (d *domain) GetApp(ctx IotResourceContext, deviceBlueprintName string, name func (d *domain) CreateApp(ctx IotResourceContext, deviceBlueprintName string, app entities.IOTApp) (*entities.IOTApp, error) { app.ProjectName = ctx.ProjectName app.AccountName = ctx.AccountName - app.EnvironmentName = ctx.EnvironmentName app.CreatedBy = common.CreatedOrUpdatedBy{ UserId: ctx.UserId, UserName: ctx.UserName, diff --git a/apps/iot-console/internal/domain/iot-deployment.go b/apps/iot-console/internal/domain/iot-deployment.go index cb796f9a1..d79344722 100644 --- a/apps/iot-console/internal/domain/iot-deployment.go +++ b/apps/iot-console/internal/domain/iot-deployment.go @@ -20,19 +20,18 @@ func (d *domain) findDeployment(ctx IotResourceContext, name string) (*entities. return prj, nil } -func (d domain) ListDeployments(ctx IotResourceContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDeployment], error) { +func (d *domain) ListDeployments(ctx IotResourceContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDeployment], error) { filter := ctx.IOTConsoleDBFilters() return d.iotDeploymentRepo.FindPaginated(ctx, d.iotDeploymentRepo.MergeMatchFilters(filter, search), pagination) } -func (d domain) GetDeployment(ctx IotResourceContext, name string) (*entities.IOTDeployment, error) { +func (d *domain) GetDeployment(ctx IotResourceContext, name string) (*entities.IOTDeployment, error) { return d.findDeployment(ctx, name) } -func (d domain) CreateDeployment(ctx IotResourceContext, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { +func (d *domain) CreateDeployment(ctx IotResourceContext, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { deployment.AccountName = ctx.AccountName deployment.ProjectName = ctx.ProjectName - deployment.EnvironmentName = ctx.EnvironmentName deployment.CreatedBy = common.CreatedOrUpdatedBy{ UserId: ctx.UserId, UserName: ctx.UserName, @@ -48,7 +47,7 @@ func (d domain) CreateDeployment(ctx IotResourceContext, deployment entities.IOT return dep, nil } -func (d domain) UpdateDeployment(ctx IotResourceContext, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { +func (d *domain) UpdateDeployment(ctx IotResourceContext, deployment entities.IOTDeployment) (*entities.IOTDeployment, error) { patchForUpdate := repos.Document{ fields.DisplayName: deployment.DisplayName, fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ @@ -72,7 +71,7 @@ func (d domain) UpdateDeployment(ctx IotResourceContext, deployment entities.IOT return upDep, nil } -func (d domain) DeleteDeployment(ctx IotResourceContext, name string) error { +func (d *domain) DeleteDeployment(ctx IotResourceContext, name string) error { err := d.iotDeploymentRepo.DeleteOne( ctx, ctx.IOTConsoleDBFilters().Add(fc.IOTDeploymentName, name), diff --git a/apps/iot-console/internal/domain/iot-device-blueprint.go b/apps/iot-console/internal/domain/iot-device-blueprint.go index f9114fbdb..50d0a76fa 100644 --- a/apps/iot-console/internal/domain/iot-device-blueprint.go +++ b/apps/iot-console/internal/domain/iot-device-blueprint.go @@ -34,7 +34,6 @@ func (d *domain) GetDeviceBlueprint(ctx IotResourceContext, name string) (*entit func (d *domain) CreateDeviceBlueprint(ctx IotResourceContext, deviceBlueprint entities.IOTDeviceBlueprint) (*entities.IOTDeviceBlueprint, error) { deviceBlueprint.ProjectName = ctx.ProjectName deviceBlueprint.AccountName = ctx.AccountName - deviceBlueprint.EnvironmentName = ctx.EnvironmentName deviceBlueprint.CreatedBy = common.CreatedOrUpdatedBy{ UserId: ctx.UserId, UserName: ctx.UserName, diff --git a/apps/iot-console/internal/domain/iot-device.go b/apps/iot-console/internal/domain/iot-device.go index 7b12c09b5..8e90d3a7a 100644 --- a/apps/iot-console/internal/domain/iot-device.go +++ b/apps/iot-console/internal/domain/iot-device.go @@ -9,10 +9,11 @@ import ( "github.com/kloudlite/api/pkg/repos" ) -func (d *domain) findDevice(ctx IotResourceContext, name string) (*entities.IOTDevice, error) { +func (d *domain) findDevice(ctx IotResourceContext, name string, deviceBlueprintName string) (*entities.IOTDevice, error) { filter := ctx.IOTConsoleDBFilters() - filter.Add("name", name) - dev, err := d.iotDeviceRepo.FindOne(ctx, ctx.IOTConsoleDBFilters().Add(fc.IOTDeviceName, name)) + filter.Add(fc.IOTDeviceDeviceBlueprintName, deviceBlueprintName) + filter.Add(fc.IOTDeviceName, name) + dev, err := d.iotDeviceRepo.FindOne(ctx, filter) if err != nil { return nil, errors.NewE(err) } @@ -22,25 +23,51 @@ func (d *domain) findDevice(ctx IotResourceContext, name string) (*entities.IOTD return dev, nil } -func (d *domain) ListDevices(ctx IotResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDevice], error) { +func (d *domain) findDeploymentDevice(ctx IotResourceContext, name string, deploymentName string) (*entities.IOTDevice, error) { filter := ctx.IOTConsoleDBFilters() + filter.Add(fc.IOTDeviceDeployment, deploymentName) + filter.Add(fc.IOTDeviceName, name) + dev, err := d.iotDeviceRepo.FindOne(ctx, filter) + if err != nil { + return nil, errors.NewE(err) + } + if dev == nil { + return nil, errors.Newf("no deployment device with name=%q found", name) + } + return dev, nil +} + +func (d *domain) ListDevices(ctx IotResourceContext, deviceBlueprintName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDevice], error) { + //filter := ctx.IOTConsoleDBFilters() + filter := ctx.IOTConsoleDBFilters() + filter.Add(fc.IOTDeviceDeviceBlueprintName, deviceBlueprintName) return d.iotDeviceRepo.FindPaginated(ctx, d.iotDeviceRepo.MergeMatchFilters(filter, search), pq) } -func (d *domain) GetDevice(ctx IotResourceContext, name string) (*entities.IOTDevice, error) { - return d.findDevice(ctx, name) +func (d *domain) ListDeploymentDevices(ctx IotResourceContext, deploymentName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTDevice], error) { + filter := ctx.IOTConsoleDBFilters() + filter.Add(fc.IOTDeviceDeployment, deploymentName) + return d.iotDeviceRepo.FindPaginated(ctx, d.iotDeviceRepo.MergeMatchFilters(filter, search), pq) +} + +func (d *domain) GetDevice(ctx IotResourceContext, name string, deviceBlueprintName string) (*entities.IOTDevice, error) { + return d.findDevice(ctx, name, deviceBlueprintName) +} + +func (d *domain) GetDeploymentDevice(ctx IotResourceContext, name string, deploymentName string) (*entities.IOTDevice, error) { + return d.findDeploymentDevice(ctx, name, deploymentName) } -func (d *domain) CreateDevice(ctx IotResourceContext, device entities.IOTDevice) (*entities.IOTDevice, error) { +func (d *domain) CreateDevice(ctx IotResourceContext, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) { device.ProjectName = ctx.ProjectName device.AccountName = ctx.AccountName - device.EnvironmentName = ctx.EnvironmentName device.CreatedBy = common.CreatedOrUpdatedBy{ UserId: ctx.UserId, UserName: ctx.UserName, UserEmail: ctx.UserEmail, } device.LastUpdatedBy = device.CreatedBy + device.DeviceBlueprintName = deviceBlueprintName nDevice, err := d.iotDeviceRepo.Create(ctx, &device) if err != nil { @@ -50,7 +77,60 @@ func (d *domain) CreateDevice(ctx IotResourceContext, device entities.IOTDevice) return nDevice, nil } -func (d *domain) UpdateDevice(ctx IotResourceContext, device entities.IOTDevice) (*entities.IOTDevice, error) { +func (d *domain) AddDeviceToDeployment(ctx IotResourceContext, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) { + patchForUpdate := repos.Document{ + fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.GetUserId(), + UserName: ctx.GetUserName(), + UserEmail: ctx.GetUserEmail(), + }, + fc.IOTDeviceDeployment: deploymentName, + } + + patchFilter := ctx.IOTConsoleDBFilters() + patchFilter.Add(fc.IOTDeviceDeviceBlueprintName, deviceBlueprintName) + patchFilter.Add(fc.IOTDeviceName, deviceName) + + upDev, err := d.iotDeviceRepo.Patch( + ctx, + patchFilter, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + + return upDev, nil +} + +func (d *domain) RemoveDeviceOfDeployment(ctx IotResourceContext, deploymentName string, deviceName string, deviceBlueprintName string) (*entities.IOTDevice, error) { + patchForUpdate := repos.Document{ + fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ + UserId: ctx.GetUserId(), + UserName: ctx.GetUserName(), + UserEmail: ctx.GetUserEmail(), + }, + fc.IOTDeviceDeployment: "", + } + + patchFilter := ctx.IOTConsoleDBFilters() + patchFilter.Add(fc.IOTDeviceDeviceBlueprintName, deviceBlueprintName) + patchFilter.Add(fc.IOTDeviceName, deviceName) + patchFilter.Add(fc.IOTDeviceDeployment, deploymentName) + + upDev, err := d.iotDeviceRepo.Patch( + ctx, + patchFilter, + patchForUpdate, + ) + if err != nil { + return nil, errors.NewE(err) + } + + return upDev, nil +} + +func (d *domain) UpdateDevice(ctx IotResourceContext, deviceBlueprintName string, device entities.IOTDevice) (*entities.IOTDevice, error) { patchForUpdate := repos.Document{ fields.DisplayName: device.DisplayName, fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ @@ -60,7 +140,9 @@ func (d *domain) UpdateDevice(ctx IotResourceContext, device entities.IOTDevice) }, } - patchFilter := ctx.IOTConsoleDBFilters().Add(fc.IOTDeviceName, device.Name) + patchFilter := ctx.IOTConsoleDBFilters() + patchFilter.Add(fc.IOTDeviceDeviceBlueprintName, deviceBlueprintName) + patchFilter.Add(fc.IOTDeviceName, device.Name) upDev, err := d.iotDeviceRepo.Patch( ctx, @@ -74,10 +156,13 @@ func (d *domain) UpdateDevice(ctx IotResourceContext, device entities.IOTDevice) return upDev, nil } -func (d *domain) DeleteDevice(ctx IotResourceContext, name string) error { +func (d *domain) DeleteDevice(ctx IotResourceContext, deviceBlueprintName string, name string) error { + filter := ctx.IOTConsoleDBFilters() + filter.Add(fc.IOTDeviceDeviceBlueprintName, deviceBlueprintName) + filter.Add(fc.IOTDeviceName, name) err := d.iotDeviceRepo.DeleteOne( ctx, - ctx.IOTConsoleDBFilters().Add(fc.IOTDeviceName, name), + filter, ) if err != nil { return errors.NewE(err) diff --git a/apps/iot-console/internal/domain/iot-environment.go b/apps/iot-console/internal/domain/iot-environment.go deleted file mode 100644 index 45c6675eb..000000000 --- a/apps/iot-console/internal/domain/iot-environment.go +++ /dev/null @@ -1,96 +0,0 @@ -package domain - -import ( - "github.com/kloudlite/api/apps/iot-console/internal/entities" - fc "github.com/kloudlite/api/apps/iot-console/internal/entities/field-constants" - "github.com/kloudlite/api/common" - "github.com/kloudlite/api/common/fields" - "github.com/kloudlite/api/pkg/errors" - "github.com/kloudlite/api/pkg/repos" -) - -func (d *domain) findEnvironment(ctx IotConsoleContext, projectName string, name string) (*entities.IOTEnvironment, error) { - env, err := d.iotEnvironmentRepo.FindOne(ctx, repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ProjectName: projectName, - fc.IOTEnvironmentName: name, - }) - if err != nil { - return nil, errors.NewE(err) - } - if env == nil { - return nil, errors.Newf("no environment with name (%s) and project (%s)", name, projectName) - } - return env, nil -} - -func (d *domain) ListEnvironments(ctx IotConsoleContext, projectName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.IOTEnvironment], error) { - filter := repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ProjectName: projectName, - } - return d.iotEnvironmentRepo.FindPaginated(ctx, d.iotEnvironmentRepo.MergeMatchFilters(filter, search), pq) -} - -func (d *domain) GetEnvironment(ctx IotConsoleContext, projectName string, name string) (*entities.IOTEnvironment, error) { - return d.findEnvironment(ctx, projectName, name) -} - -func (d *domain) CreateEnvironment(ctx IotConsoleContext, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) { - env.ProjectName = projectName - env.AccountName = ctx.AccountName - env.CreatedBy = common.CreatedOrUpdatedBy{ - UserId: ctx.UserId, - UserName: ctx.UserName, - UserEmail: ctx.UserEmail, - } - env.LastUpdatedBy = env.CreatedBy - - nEnv, err := d.iotEnvironmentRepo.Create(ctx, &env) - if err != nil { - return nil, errors.NewE(err) - } - - return nEnv, nil -} - -func (d *domain) UpdateEnvironment(ctx IotConsoleContext, projectName string, env entities.IOTEnvironment) (*entities.IOTEnvironment, error) { - patchForUpdate := repos.Document{ - fields.DisplayName: env.DisplayName, - fields.LastUpdatedBy: common.CreatedOrUpdatedBy{ - UserId: ctx.GetUserId(), - UserName: ctx.GetUserName(), - UserEmail: ctx.GetUserEmail(), - }, - } - - upEnv, err := d.iotEnvironmentRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ProjectName: projectName, - fc.IOTEnvironmentName: env.Name, - }, - patchForUpdate, - ) - if err != nil { - return nil, errors.NewE(err) - } - - return upEnv, nil -} - -func (d *domain) DeleteEnvironment(ctx IotConsoleContext, projectName string, name string) error { - err := d.iotEnvironmentRepo.DeleteOne( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ProjectName: projectName, - fc.IOTEnvironmentName: name, - }, - ) - if err != nil { - return errors.NewE(err) - } - return nil -} diff --git a/apps/iot-console/internal/entities/field-constants/generated_constants.go b/apps/iot-console/internal/entities/field-constants/generated_constants.go index 59544cc7b..adffba152 100644 --- a/apps/iot-console/internal/entities/field-constants/generated_constants.go +++ b/apps/iot-console/internal/entities/field-constants/generated_constants.go @@ -45,15 +45,15 @@ const ( // constant vars generated for struct IOTDevice const ( - IOTDeviceBlueprint = "blueprint" - IOTDeviceDeployment = "deployment" - IOTDeviceIp = "ip" - IOTDeviceMarkedForDeletion = "markedForDeletion" - IOTDeviceName = "name" - IOTDevicePodCIDR = "podCIDR" - IOTDevicePublicKey = "publicKey" - IOTDeviceServiceCIDR = "serviceCIDR" - IOTDeviceVersion = "version" + IOTDeviceDeployment = "deployment" + IOTDeviceDeviceBlueprintName = "deviceBlueprintName" + IOTDeviceIp = "ip" + IOTDeviceMarkedForDeletion = "markedForDeletion" + IOTDeviceName = "name" + IOTDevicePodCIDR = "podCIDR" + IOTDevicePublicKey = "publicKey" + IOTDeviceServiceCIDR = "serviceCIDR" + IOTDeviceVersion = "version" ) // constant vars generated for struct IOTDeviceBlueprint @@ -64,14 +64,54 @@ const ( IOTDeviceBlueprintVersion = "version" ) -// constant vars generated for struct IOTEnvironment -const ( - IOTEnvironmentMarkedForDeletion = "markedForDeletion" - IOTEnvironmentName = "name" -) - // constant vars generated for struct IOTProject const ( IOTProjectMarkedForDeletion = "markedForDeletion" IOTProjectName = "name" ) + +// constant vars generated for struct +const ( + AccountName = "accountName" + ApiVersion = "apiVersion" + CreatedBy = "createdBy" + CreatedByUserEmail = "createdBy.userEmail" + CreatedByUserId = "createdBy.userId" + CreatedByUserName = "createdBy.userName" + CreationTime = "creationTime" + DisplayName = "displayName" + Id = "id" + Kind = "kind" + LastUpdatedBy = "lastUpdatedBy" + LastUpdatedByUserEmail = "lastUpdatedBy.userEmail" + LastUpdatedByUserId = "lastUpdatedBy.userId" + LastUpdatedByUserName = "lastUpdatedBy.userName" + Metadata = "metadata" + MetadataAnnotations = "metadata.annotations" + MetadataCreationTimestamp = "metadata.creationTimestamp" + MetadataDeletionGracePeriodSeconds = "metadata.deletionGracePeriodSeconds" + MetadataDeletionTimestamp = "metadata.deletionTimestamp" + MetadataFinalizers = "metadata.finalizers" + MetadataGenerateName = "metadata.generateName" + MetadataGeneration = "metadata.generation" + MetadataLabels = "metadata.labels" + MetadataManagedFields = "metadata.managedFields" + MetadataName = "metadata.name" + MetadataNamespace = "metadata.namespace" + MetadataOwnerReferences = "metadata.ownerReferences" + MetadataResourceVersion = "metadata.resourceVersion" + MetadataSelfLink = "metadata.selfLink" + MetadataUid = "metadata.uid" + ProjectName = "projectName" + RecordVersion = "recordVersion" + Status = "status" + StatusCheckList = "status.checkList" + StatusChecks = "status.checks" + StatusIsReady = "status.isReady" + StatusLastReadyGeneration = "status.lastReadyGeneration" + StatusLastReconcileTime = "status.lastReconcileTime" + StatusMessage = "status.message" + StatusMessageItems = "status.message.items" + StatusResources = "status.resources" + UpdateTime = "updateTime" +) diff --git a/apps/iot-console/internal/entities/iot-app.go b/apps/iot-console/internal/entities/iot-app.go index d45647b5f..6eec19b9d 100644 --- a/apps/iot-console/internal/entities/iot-app.go +++ b/apps/iot-console/internal/entities/iot-app.go @@ -15,7 +15,6 @@ type IOTApp struct { AccountName string `json:"accountName" graphql:"noinput"` ProjectName string `json:"projectName" graphql:"noinput"` - EnvironmentName string `json:"environmentName" graphql:"noinput"` DeviceBlueprintName string `json:"deviceBlueprintName" graphql:"noinput"` } diff --git a/apps/iot-console/internal/entities/iot-deployment.go b/apps/iot-console/internal/entities/iot-deployment.go index 6ce87816b..66b7ce53f 100644 --- a/apps/iot-console/internal/entities/iot-deployment.go +++ b/apps/iot-console/internal/entities/iot-deployment.go @@ -11,7 +11,6 @@ type IOTDeployment struct { Name string `json:"name"` AccountName string `json:"accountName" graphql:"noinput"` ProjectName string `json:"projectName" graphql:"noinput"` - EnvironmentName string `json:"environmentName" graphql:"noinput"` CIDR string `json:"CIDR"` ExposedServices []ExposedService `json:"exposedServices"` diff --git a/apps/iot-console/internal/entities/iot-device-blueprint.go b/apps/iot-console/internal/entities/iot-device-blueprint.go index 2e0ca8a27..5e93fc4ef 100644 --- a/apps/iot-console/internal/entities/iot-device-blueprint.go +++ b/apps/iot-console/internal/entities/iot-device-blueprint.go @@ -17,12 +17,11 @@ type IOTDeviceBlueprint struct { repos.BaseEntity `json:",inline" graphql:"noinput"` common.ResourceMetadata `json:",inline"` - Name string `json:"name"` - AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` - EnvironmentName string `json:"environmentName" graphql:"noinput"` - BluePrintType BluePrintType `json:"bluePrintType"` - Version string `json:"version"` + Name string `json:"name"` + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + BluePrintType BluePrintType `json:"bluePrintType"` + Version string `json:"version"` } var IOTDeviceBlueprintIndexes = []repos.IndexField{ diff --git a/apps/iot-console/internal/entities/iot-device.go b/apps/iot-console/internal/entities/iot-device.go index 527140839..f18f9a4d6 100644 --- a/apps/iot-console/internal/entities/iot-device.go +++ b/apps/iot-console/internal/entities/iot-device.go @@ -10,17 +10,16 @@ type IOTDevice struct { repos.BaseEntity `json:",inline" graphql:"noinput"` common.ResourceMetadata `json:",inline"` - Name string `json:"name"` - AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` - EnvironmentName string `json:"environmentName" graphql:"noinput"` - PublicKey string `json:"publicKey"` - ServiceCIDR string `json:"serviceCIDR"` - PodCIDR string `json:"podCIDR"` - IP string `json:"ip"` - Blueprint string `json:"blueprint"` - Deployment string `json:"deployment"` - Version string `json:"version"` + Name string `json:"name"` + AccountName string `json:"accountName" graphql:"noinput"` + ProjectName string `json:"projectName" graphql:"noinput"` + PublicKey string `json:"publicKey"` + ServiceCIDR string `json:"serviceCIDR"` + PodCIDR string `json:"podCIDR"` + IP string `json:"ip"` + DeviceBlueprintName string `json:"deviceBlueprintName" graphql:"noinput"` + Deployment string `json:"deployment"` + Version string `json:"version"` } var IOTDeviceIndexes = []repos.IndexField{ diff --git a/apps/iot-console/internal/entities/iot-environment.go b/apps/iot-console/internal/entities/iot-environment.go deleted file mode 100644 index 9d59dfbfb..000000000 --- a/apps/iot-console/internal/entities/iot-environment.go +++ /dev/null @@ -1,35 +0,0 @@ -package entities - -import ( - "github.com/kloudlite/api/common" - "github.com/kloudlite/api/common/fields" - "github.com/kloudlite/api/pkg/repos" -) - -type IOTEnvironment struct { - repos.BaseEntity `json:",inline" graphql:"noinput"` - - Name string `json:"name"` - AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` - - common.ResourceMetadata `json:",inline"` -} - -var IOTEnvironmentIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: fields.Id, Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - { - Key: "name", - Value: repos.IndexAsc, - }, - }, - Unique: true, - }, -} diff --git a/apps/iot-console/internal/env/env.go b/apps/iot-console/internal/env/env.go index 0357f3cd3..78c06a788 100644 --- a/apps/iot-console/internal/env/env.go +++ b/apps/iot-console/internal/env/env.go @@ -15,20 +15,14 @@ type Env struct { ClusterCookieName string `env:"CLUSTER_COOKIE_NAME" required:"true"` // NATS:start - NatsURL string `env:"NATS_URL" required:"true"` - NatsResourceSyncStream string `env:"NATS_RESOURCE_STREAM" required:"true"` + NatsURL string `env:"NATS_URL" required:"true"` // NATS:end - DefaultProjectWorkspaceName string `env:"DEFAULT_PROJECT_WORKSPACE_NAME" required:"true"` - - PromHttpAddr string `env:"PROM_HTTP_ADDR" required:"true"` IsDev bool KubernetesApiProxy string `env:"KUBERNETES_API_PROXY"` - SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` - ConsoleCacheKVBucket string `env:"CONSOLE_CACHE_KV_BUCKET" required:"true"` - - DeviceNamespace string `env:"DEVICE_NAMESPACE" required:"true"` + SessionKVBucket string `env:"SESSION_KV_BUCKET" required:"true"` + IOTConsoleCacheKVBucket string `env:"IOT_CONSOLE_CACHE_KV_BUCKET" required:"true"` } func LoadEnv() (*Env, error) { diff --git a/apps/iot-console/internal/framework/framework.go b/apps/iot-console/internal/framework/framework.go index 0d8ef42cf..b4daacb32 100644 --- a/apps/iot-console/internal/framework/framework.go +++ b/apps/iot-console/internal/framework/framework.go @@ -52,7 +52,7 @@ var Module = fx.Module("framework", fx.Provide( func(ev *env.Env, jc *nats.JetstreamClient) (domain.IOTConsoleCacheStore, error) { - return kv.NewNatsKVBinaryRepo(context.TODO(), ev.ConsoleCacheKVBucket, jc) + return kv.NewNatsKVBinaryRepo(context.TODO(), ev.IOTConsoleCacheKVBucket, jc) }, ),