From e03c6babd77bef66618231cd2c30e282984a8865 Mon Sep 17 00:00:00 2001 From: Todd Date: Tue, 16 Apr 2024 16:53:03 -0700 Subject: [PATCH] Update templates to remove Response from the resource structs --- api/accounts/account.gen.go | 2 -- api/aliases/alias.gen.go | 2 -- api/authmethods/authmethods.gen.go | 2 -- api/authtokens/authtokens.gen.go | 2 -- api/credentiallibraries/credential_library.gen.go | 2 -- api/credentials/credential.gen.go | 2 -- api/credentialstores/credential_store.gen.go | 2 -- api/groups/group.gen.go | 2 -- api/hostcatalogs/host_catalog.gen.go | 2 -- api/hosts/host.gen.go | 2 -- api/hostsets/host_set.gen.go | 2 -- api/managedgroups/managedgroups.gen.go | 2 -- api/policies/policy.gen.go | 2 -- api/roles/role.gen.go | 2 -- api/scopes/scope.gen.go | 2 -- api/sessionrecordings/session_recording.gen.go | 2 -- api/sessions/session.gen.go | 2 -- api/storagebuckets/storage_bucket.gen.go | 2 -- api/targets/target.gen.go | 2 -- api/users/user.gen.go | 2 -- api/workers/certificate_authority.gen.go | 2 -- api/workers/worker.gen.go | 2 -- internal/api/genapi/templates.go | 4 +--- 23 files changed, 1 insertion(+), 47 deletions(-) diff --git a/api/accounts/account.gen.go b/api/accounts/account.gen.go index 86b6d0390e..a0d0b2b012 100644 --- a/api/accounts/account.gen.go +++ b/api/accounts/account.gen.go @@ -30,8 +30,6 @@ type Account struct { Attributes map[string]interface{} `json:"attributes,omitempty"` ManagedGroupIds []string `json:"managed_group_ids,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type AccountReadResult struct { diff --git a/api/aliases/alias.gen.go b/api/aliases/alias.gen.go index c5eae1ab8b..06ac52e80a 100644 --- a/api/aliases/alias.gen.go +++ b/api/aliases/alias.gen.go @@ -31,8 +31,6 @@ type Alias struct { Type string `json:"type,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type AliasReadResult struct { diff --git a/api/authmethods/authmethods.gen.go b/api/authmethods/authmethods.gen.go index ea616bde2e..95e050093e 100644 --- a/api/authmethods/authmethods.gen.go +++ b/api/authmethods/authmethods.gen.go @@ -31,8 +31,6 @@ type AuthMethod struct { IsPrimary bool `json:"is_primary,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` AuthorizedCollectionActions map[string][]string `json:"authorized_collection_actions,omitempty"` - - Response *api.Response } type AuthMethodReadResult struct { diff --git a/api/authtokens/authtokens.gen.go b/api/authtokens/authtokens.gen.go index 67ac273958..4ab525d5a8 100644 --- a/api/authtokens/authtokens.gen.go +++ b/api/authtokens/authtokens.gen.go @@ -29,8 +29,6 @@ type AuthToken struct { ApproximateLastUsedTime time.Time `json:"approximate_last_used_time,omitempty"` ExpirationTime time.Time `json:"expiration_time,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type AuthTokenReadResult struct { diff --git a/api/credentiallibraries/credential_library.gen.go b/api/credentiallibraries/credential_library.gen.go index 11e621f742..3aeba3b04d 100644 --- a/api/credentiallibraries/credential_library.gen.go +++ b/api/credentiallibraries/credential_library.gen.go @@ -31,8 +31,6 @@ type CredentialLibrary struct { AuthorizedActions []string `json:"authorized_actions,omitempty"` CredentialType string `json:"credential_type,omitempty"` CredentialMappingOverrides map[string]interface{} `json:"credential_mapping_overrides,omitempty"` - - Response *api.Response } type CredentialLibraryReadResult struct { diff --git a/api/credentials/credential.gen.go b/api/credentials/credential.gen.go index 3ff1f19101..283be1513e 100644 --- a/api/credentials/credential.gen.go +++ b/api/credentials/credential.gen.go @@ -29,8 +29,6 @@ type Credential struct { Type string `json:"type,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type CredentialReadResult struct { diff --git a/api/credentialstores/credential_store.gen.go b/api/credentialstores/credential_store.gen.go index 4ad1ea25f5..1e430bec4d 100644 --- a/api/credentialstores/credential_store.gen.go +++ b/api/credentialstores/credential_store.gen.go @@ -30,8 +30,6 @@ type CredentialStore struct { Attributes map[string]interface{} `json:"attributes,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` AuthorizedCollectionActions map[string][]string `json:"authorized_collection_actions,omitempty"` - - Response *api.Response } type CredentialStoreReadResult struct { diff --git a/api/groups/group.gen.go b/api/groups/group.gen.go index 285be0505f..3ebfd5a51d 100644 --- a/api/groups/group.gen.go +++ b/api/groups/group.gen.go @@ -29,8 +29,6 @@ type Group struct { MemberIds []string `json:"member_ids,omitempty"` Members []*Member `json:"members,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type GroupReadResult struct { diff --git a/api/hostcatalogs/host_catalog.gen.go b/api/hostcatalogs/host_catalog.gen.go index 85e30f0915..7e6e7c3e24 100644 --- a/api/hostcatalogs/host_catalog.gen.go +++ b/api/hostcatalogs/host_catalog.gen.go @@ -35,8 +35,6 @@ type HostCatalog struct { SecretsHmac string `json:"secrets_hmac,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` AuthorizedCollectionActions map[string][]string `json:"authorized_collection_actions,omitempty"` - - Response *api.Response } type HostCatalogReadResult struct { diff --git a/api/hosts/host.gen.go b/api/hosts/host.gen.go index 322178a969..a6d12477e5 100644 --- a/api/hosts/host.gen.go +++ b/api/hosts/host.gen.go @@ -36,8 +36,6 @@ type Host struct { ExternalId string `json:"external_id,omitempty"` ExternalName string `json:"external_name,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type HostReadResult struct { diff --git a/api/hostsets/host_set.gen.go b/api/hostsets/host_set.gen.go index c4d4ca9ea8..3afbd31acf 100644 --- a/api/hostsets/host_set.gen.go +++ b/api/hostsets/host_set.gen.go @@ -34,8 +34,6 @@ type HostSet struct { SyncIntervalSeconds int32 `json:"sync_interval_seconds,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type HostSetReadResult struct { diff --git a/api/managedgroups/managedgroups.gen.go b/api/managedgroups/managedgroups.gen.go index c731c4be0a..1329a64d74 100644 --- a/api/managedgroups/managedgroups.gen.go +++ b/api/managedgroups/managedgroups.gen.go @@ -30,8 +30,6 @@ type ManagedGroup struct { Attributes map[string]interface{} `json:"attributes,omitempty"` MemberIds []string `json:"member_ids,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type ManagedGroupReadResult struct { diff --git a/api/policies/policy.gen.go b/api/policies/policy.gen.go index 340507c6a9..742612b946 100644 --- a/api/policies/policy.gen.go +++ b/api/policies/policy.gen.go @@ -29,8 +29,6 @@ type Policy struct { Version uint32 `json:"version,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type PolicyReadResult struct { diff --git a/api/roles/role.gen.go b/api/roles/role.gen.go index a4f14515d4..30685b4e8c 100644 --- a/api/roles/role.gen.go +++ b/api/roles/role.gen.go @@ -33,8 +33,6 @@ type Role struct { GrantStrings []string `json:"grant_strings,omitempty"` Grants []*Grant `json:"grants,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type RoleReadResult struct { diff --git a/api/scopes/scope.gen.go b/api/scopes/scope.gen.go index a85856eca6..c6ec9e1bbd 100644 --- a/api/scopes/scope.gen.go +++ b/api/scopes/scope.gen.go @@ -30,8 +30,6 @@ type Scope struct { AuthorizedActions []string `json:"authorized_actions,omitempty"` AuthorizedCollectionActions map[string][]string `json:"authorized_collection_actions,omitempty"` StoragePolicyId string `json:"storage_policy_id,omitempty"` - - Response *api.Response } type ScopeReadResult struct { diff --git a/api/sessionrecordings/session_recording.gen.go b/api/sessionrecordings/session_recording.gen.go index a90c3e1852..c0195ca2cb 100644 --- a/api/sessionrecordings/session_recording.gen.go +++ b/api/sessionrecordings/session_recording.gen.go @@ -38,8 +38,6 @@ type SessionRecording struct { AuthorizedActions []string `json:"authorized_actions,omitempty"` RetainUntil time.Time `json:"retain_until,omitempty"` DeleteAfter time.Time `json:"delete_after,omitempty"` - - Response *api.Response } type SessionRecordingReadResult struct { diff --git a/api/sessions/session.gen.go b/api/sessions/session.gen.go index 86a9af4e6b..aaa503d0a0 100644 --- a/api/sessions/session.gen.go +++ b/api/sessions/session.gen.go @@ -37,8 +37,6 @@ type Session struct { TerminationReason string `json:"termination_reason,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` Connections []*Connection `json:"connections,omitempty"` - - Response *api.Response } type SessionReadResult struct { diff --git a/api/storagebuckets/storage_bucket.gen.go b/api/storagebuckets/storage_bucket.gen.go index b2614901f7..557d1c7b62 100644 --- a/api/storagebuckets/storage_bucket.gen.go +++ b/api/storagebuckets/storage_bucket.gen.go @@ -37,8 +37,6 @@ type StorageBucket struct { SecretsHmac string `json:"secrets_hmac,omitempty"` WorkerFilter string `json:"worker_filter,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` - - Response *api.Response } type StorageBucketReadResult struct { diff --git a/api/targets/target.gen.go b/api/targets/target.gen.go index 68c890fe8e..ec2450de01 100644 --- a/api/targets/target.gen.go +++ b/api/targets/target.gen.go @@ -43,8 +43,6 @@ type Target struct { Address string `json:"address,omitempty"` Aliases []*Alias `json:"aliases,omitempty"` WithAliases []*Alias `json:"with_aliases,omitempty"` - - Response *api.Response } type TargetReadResult struct { diff --git a/api/users/user.gen.go b/api/users/user.gen.go index 10826e95d8..4cd8962670 100644 --- a/api/users/user.gen.go +++ b/api/users/user.gen.go @@ -33,8 +33,6 @@ type User struct { FullName string `json:"full_name,omitempty"` Email string `json:"email,omitempty"` PrimaryAccountId string `json:"primary_account_id,omitempty"` - - Response *api.Response } type UserReadResult struct { diff --git a/api/workers/certificate_authority.gen.go b/api/workers/certificate_authority.gen.go index 9dbfaa66ee..5d52b73d0a 100644 --- a/api/workers/certificate_authority.gen.go +++ b/api/workers/certificate_authority.gen.go @@ -10,8 +10,6 @@ import ( type CertificateAuthority struct { Certs []*Certificate `json:"certs,omitempty"` - - Response *api.Response } type CertificateAuthorityReadResult struct { diff --git a/api/workers/worker.gen.go b/api/workers/worker.gen.go index c27ab1b23e..ee998588e9 100644 --- a/api/workers/worker.gen.go +++ b/api/workers/worker.gen.go @@ -39,8 +39,6 @@ type Worker struct { DirectlyConnectedDownstreamWorkers []string `json:"directly_connected_downstream_workers,omitempty"` AuthorizedActions []string `json:"authorized_actions,omitempty"` LocalStorageState string `json:"local_storage_state,omitempty"` - - Response *api.Response } type WorkerReadResult struct { diff --git a/internal/api/genapi/templates.go b/internal/api/genapi/templates.go index e6e2c38e4f..6749c88bae 100644 --- a/internal/api/genapi/templates.go +++ b/internal/api/genapi/templates.go @@ -719,9 +719,7 @@ import ( type {{ .Name }} struct { {{ range .Fields }} {{ .Name }} {{ .FieldType }} `, "`json:\"{{ .ProtoName }}{{ if ( ne ( len ( .JsonTags ) ) 0 ) }},{{ stringsjoin .JsonTags \",\" }}{{ end }}{{ if ( not .AllowEmpty ) }},omitempty{{ end }}\"`", `{{ end }} -{{ if ( not ( eq ( len ( .CreateResponseTypes ) ) 0 ) )}} - Response *api.Response -{{ else if ( eq .Name "Error" ) }} +{{ if ( eq .Name "Error" ) }} response *Response {{ end }} }