refactor(api module): enforce typed definitions (#2238)
This commit is contained in:
1 parent
d6c1402223
commit
c2bfcc0664
79 files changed
+906
-551
No files matched your search
@@ -34,7 +34,7 @@ type AccountReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n AccountReadResult) GetItem() interface{} {
|
||||
func (n AccountReadResult) GetItem() *Account {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ type AccountListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n AccountListResult) GetItems() interface{} {
|
||||
func (n AccountListResult) GetItems() []*Account {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ type AuthMethodReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n AuthMethodReadResult) GetItem() interface{} {
|
||||
func (n AuthMethodReadResult) GetItem() *AuthMethod {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ type AuthMethodListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n AuthMethodListResult) GetItems() interface{} {
|
||||
func (n AuthMethodListResult) GetItems() []*AuthMethod {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type AuthTokenReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n AuthTokenReadResult) GetItem() interface{} {
|
||||
func (n AuthTokenReadResult) GetItem() *AuthToken {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ type AuthTokenListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n AuthTokenListResult) GetItems() interface{} {
|
||||
func (n AuthTokenListResult) GetItems() []*AuthToken {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ type CredentialLibraryReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n CredentialLibraryReadResult) GetItem() interface{} {
|
||||
func (n CredentialLibraryReadResult) GetItem() *CredentialLibrary {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ type CredentialLibraryListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n CredentialLibraryListResult) GetItems() interface{} {
|
||||
func (n CredentialLibraryListResult) GetItems() []*CredentialLibrary {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type CredentialReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n CredentialReadResult) GetItem() interface{} {
|
||||
func (n CredentialReadResult) GetItem() *Credential {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ type CredentialListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n CredentialListResult) GetItems() interface{} {
|
||||
func (n CredentialListResult) GetItems() []*Credential {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ type CredentialStoreReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n CredentialStoreReadResult) GetItem() interface{} {
|
||||
func (n CredentialStoreReadResult) GetItem() *CredentialStore {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ type CredentialStoreListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n CredentialStoreListResult) GetItems() interface{} {
|
||||
func (n CredentialStoreListResult) GetItems() []*CredentialStore {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type GroupReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n GroupReadResult) GetItem() interface{} {
|
||||
func (n GroupReadResult) GetItem() *Group {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ type GroupListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n GroupListResult) GetItems() interface{} {
|
||||
func (n GroupListResult) GetItems() []*Group {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ type HostCatalogReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n HostCatalogReadResult) GetItem() interface{} {
|
||||
func (n HostCatalogReadResult) GetItem() *HostCatalog {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ type HostCatalogListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n HostCatalogListResult) GetItems() interface{} {
|
||||
func (n HostCatalogListResult) GetItems() []*HostCatalog {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ type HostReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n HostReadResult) GetItem() interface{} {
|
||||
func (n HostReadResult) GetItem() *Host {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ type HostListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n HostListResult) GetItems() interface{} {
|
||||
func (n HostListResult) GetItems() []*Host {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ type HostSetReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n HostSetReadResult) GetItem() interface{} {
|
||||
func (n HostSetReadResult) GetItem() *HostSet {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ type HostSetListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n HostSetListResult) GetItems() interface{} {
|
||||
func (n HostSetListResult) GetItems() []*HostSet {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ type ManagedGroupReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n ManagedGroupReadResult) GetItem() interface{} {
|
||||
func (n ManagedGroupReadResult) GetItem() *ManagedGroup {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ type ManagedGroupListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n ManagedGroupListResult) GetItems() interface{} {
|
||||
func (n ManagedGroupListResult) GetItems() []*ManagedGroup {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ type RoleReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n RoleReadResult) GetItem() interface{} {
|
||||
func (n RoleReadResult) GetItem() *Role {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ type RoleListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n RoleListResult) GetItems() interface{} {
|
||||
func (n RoleListResult) GetItems() []*Role {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type ScopeReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n ScopeReadResult) GetItem() interface{} {
|
||||
func (n ScopeReadResult) GetItem() *Scope {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ type ScopeListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n ScopeListResult) GetItems() interface{} {
|
||||
func (n ScopeListResult) GetItems() []*Scope {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ type SessionReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n SessionReadResult) GetItem() interface{} {
|
||||
func (n SessionReadResult) GetItem() *Session {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ type SessionListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n SessionListResult) GetItems() interface{} {
|
||||
func (n SessionListResult) GetItems() []*Session {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ type TargetReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n TargetReadResult) GetItem() interface{} {
|
||||
func (n TargetReadResult) GetItem() *Target {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ type TargetListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n TargetListResult) GetItems() interface{} {
|
||||
func (n TargetListResult) GetItems() []*Target {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ type UserReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n UserReadResult) GetItem() interface{} {
|
||||
func (n UserReadResult) GetItem() *User {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ type UserListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n UserListResult) GetItems() interface{} {
|
||||
func (n UserListResult) GetItems() []*User {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package api
|
||||
|
||||
type GenericResult interface {
|
||||
GetItem() interface{}
|
||||
GetResponse() *Response
|
||||
}
|
||||
|
||||
type GenericDeleteResult interface {
|
||||
GetResponse() *Response
|
||||
}
|
||||
|
||||
type GenericListResult interface {
|
||||
GetItems() interface{}
|
||||
GetResponse() *Response
|
||||
}
|
||||
@@ -39,7 +39,7 @@ type WorkerReadResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n WorkerReadResult) GetItem() interface{} {
|
||||
func (n WorkerReadResult) GetItem() *Worker {
|
||||
return n.Item
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ type WorkerListResult struct {
|
||||
response *api.Response
|
||||
}
|
||||
|
||||
func (n WorkerListResult) GetItems() interface{} {
|
||||
func (n WorkerListResult) GetItems() []*Worker {
|
||||
return n.Items
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user