Skip to content

Commit

Permalink
Cleanup and TD form improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hspaay committed Jul 20, 2024
1 parent 9b9376b commit 0cc1b77
Show file tree
Hide file tree
Showing 26 changed files with 1,014 additions and 909 deletions.
50 changes: 25 additions & 25 deletions api/go/authn/authnAdmin.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package authn with types and interfaces for using this service with agent 'authn'
// DO NOT EDIT. This file is auto generated by tdd2api. Any changes will be overwritten.
// Generated 14 Jul 24 20:51 PDT.
// Generated 19 Jul 24 19:42 PDT.
package authn

import "errors"
Expand Down Expand Up @@ -222,27 +222,11 @@ func NewAdminHandler(svc IAdminService) func(*things.ThingMessage) hubclient.Del
var resp interface{}
var senderID = msg.SenderID
switch msg.Key {
case "getClientProfile":
var args string
err = msg.Decode(&args)
if err == nil {
resp, err = svc.GetClientProfile(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "getProfiles":
if err == nil {
resp, err = svc.GetProfiles(senderID)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "removeClient":
case "newAuthToken":
var args string
err = msg.Decode(&args)
if err == nil {
err = svc.RemoveClient(senderID, args)
resp, err = svc.NewAuthToken(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
Expand Down Expand Up @@ -274,20 +258,18 @@ func NewAdminHandler(svc IAdminService) func(*things.ThingMessage) hubclient.Del
err = errors.New("bad function argument: " + err.Error())
}
break
case "addService":
args := AdminAddServiceArgs{}
err = msg.Decode(&args)
case "getProfiles":
if err == nil {
resp, err = svc.AddService(senderID, args)
resp, err = svc.GetProfiles(senderID)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "newAuthToken":
case "removeClient":
var args string
err = msg.Decode(&args)
if err == nil {
resp, err = svc.NewAuthToken(senderID, args)
err = svc.RemoveClient(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
Expand All @@ -301,6 +283,24 @@ func NewAdminHandler(svc IAdminService) func(*things.ThingMessage) hubclient.Del
err = errors.New("bad function argument: " + err.Error())
}
break
case "addService":
args := AdminAddServiceArgs{}
err = msg.Decode(&args)
if err == nil {
resp, err = svc.AddService(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "getClientProfile":
var args string
err = msg.Decode(&args)
if err == nil {
resp, err = svc.GetClientProfile(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
default:
err = errors.New("Unknown Method '" + msg.Key + "' of service '" + msg.ThingID + "'")
stat.DeliveryFailed(msg, err)
Expand Down
16 changes: 8 additions & 8 deletions api/go/authn/authnUser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package authn with types and interfaces for using this service with agent 'authn'
// DO NOT EDIT. This file is auto generated by tdd2api. Any changes will be overwritten.
// Generated 14 Jul 24 20:51 PDT.
// Generated 19 Jul 24 19:42 PDT.
package authn

import "errors"
Expand Down Expand Up @@ -284,6 +284,13 @@ func NewUserHandler(svc IUserService) func(*things.ThingMessage) hubclient.Deliv
var resp interface{}
var senderID = msg.SenderID
switch msg.Key {
case "getProfile":
if err == nil {
resp, err = svc.GetProfile(senderID)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "login":
args := UserLoginArgs{}
err = msg.Decode(&args)
Expand Down Expand Up @@ -338,13 +345,6 @@ func NewUserHandler(svc IUserService) func(*things.ThingMessage) hubclient.Deliv
err = errors.New("bad function argument: " + err.Error())
}
break
case "getProfile":
if err == nil {
resp, err = svc.GetProfile(senderID)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
default:
err = errors.New("Unknown Method '" + msg.Key + "' of service '" + msg.ThingID + "'")
stat.DeliveryFailed(msg, err)
Expand Down
2 changes: 1 addition & 1 deletion api/go/authz/authzAdmin.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package authz with types and interfaces for using this service with agent 'authz'
// DO NOT EDIT. This file is auto generated by tdd2api. Any changes will be overwritten.
// Generated 14 Jul 24 20:51 PDT.
// Generated 19 Jul 24 19:42 PDT.
package authz

import "errors"
Expand Down
2 changes: 1 addition & 1 deletion api/go/authz/authzUser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package authz with types and interfaces for using this service with agent 'authz'
// DO NOT EDIT. This file is auto generated by tdd2api. Any changes will be overwritten.
// Generated 14 Jul 24 20:51 PDT.
// Generated 19 Jul 24 19:42 PDT.
package authz

import "errors"
Expand Down
28 changes: 14 additions & 14 deletions api/go/digitwin/digitwinDirectory.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package digitwin with types and interfaces for using this service with agent 'digitwin'
// DO NOT EDIT. This file is auto generated by tdd2api. Any changes will be overwritten.
// Generated 14 Jul 24 20:51 PDT.
// Generated 19 Jul 24 19:42 PDT.
package digitwin

import "errors"
Expand Down Expand Up @@ -142,47 +142,47 @@ func NewDirectoryHandler(svc IDirectoryService) func(*things.ThingMessage) hubcl
var resp interface{}
var senderID = msg.SenderID
switch msg.Key {
case "updateTD":
case "removeTD":
var args string
err = msg.Decode(&args)
if err == nil {
err = svc.UpdateTD(senderID, args)
err = svc.RemoveTD(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "readTD":
var args string
case "queryTDs":
args := DirectoryQueryTDsArgs{}
err = msg.Decode(&args)
if err == nil {
resp, err = svc.ReadTD(senderID, args)
resp, err = svc.QueryTDs(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "readTDs":
args := DirectoryReadTDsArgs{}
case "updateTD":
var args string
err = msg.Decode(&args)
if err == nil {
resp, err = svc.ReadTDs(senderID, args)
err = svc.UpdateTD(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "removeTD":
case "readTD":
var args string
err = msg.Decode(&args)
if err == nil {
err = svc.RemoveTD(senderID, args)
resp, err = svc.ReadTD(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
break
case "queryTDs":
args := DirectoryQueryTDsArgs{}
case "readTDs":
args := DirectoryReadTDsArgs{}
err = msg.Decode(&args)
if err == nil {
resp, err = svc.QueryTDs(senderID, args)
resp, err = svc.ReadTDs(senderID, args)
} else {
err = errors.New("bad function argument: " + err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion api/go/digitwin/digitwinInbox.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package digitwin with types and interfaces for using this service with agent 'digitwin'
// DO NOT EDIT. This file is auto generated by tdd2api. Any changes will be overwritten.
// Generated 14 Jul 24 20:51 PDT.
// Generated 19 Jul 24 19:42 PDT.
package digitwin

import "errors"
Expand Down
Loading

0 comments on commit 0cc1b77

Please sign in to comment.