Skip to content

Commit

Permalink
feat(entities): add support for tags in EntityOutline types
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-new-relic committed Jun 4, 2024
1 parent a955753 commit 60ba48a
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 21 deletions.
64 changes: 64 additions & 0 deletions pkg/entities/entities_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/entities/entity_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func TestIntegrationSearchEntitiesByQuery(t *testing.T) {

require.NoError(t, err)
require.Greater(t, len(actual.Results.Entities), 0)
require.Greater(t, len(actual.Results.Entities[0].GetTags()), 0)
}

func TestIntegrationSearchEntities_domain(t *testing.T) {
Expand Down
41 changes: 21 additions & 20 deletions pkg/entities/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5254,6 +5254,11 @@ type ApmApplicationEntityOutline struct {
UiTemplates []EntityDashboardTemplatesUi `json:"uiTemplates"`
}

// GetTags returns a pointer to the value of Tags from ApmApplicationEntityOutline
func (x ApmApplicationEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetAccount returns a pointer to the value of Account from ApmApplicationEntityOutline
func (x ApmApplicationEntityOutline) GetAccount() accounts.AccountOutline {
return x.Account
Expand Down Expand Up @@ -5384,11 +5389,6 @@ func (x ApmApplicationEntityOutline) GetSummaryMetrics() []EntitySummaryMetric {
return x.SummaryMetrics
}

// GetTags returns a pointer to the value of Tags from ApmApplicationEntityOutline
func (x ApmApplicationEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetType returns a pointer to the value of Type from ApmApplicationEntityOutline
func (x ApmApplicationEntityOutline) GetType() string {
return x.Type
Expand Down Expand Up @@ -5819,6 +5819,11 @@ type ApmDatabaseInstanceEntityOutline struct {
Vendor string `json:"vendor,omitempty"`
}

// GetTags returns a pointer to the value of Tags from ApmDatabaseInstanceEntityOutline
func (x ApmDatabaseInstanceEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetAccount returns a pointer to the value of Account from ApmDatabaseInstanceEntityOutline
func (x ApmDatabaseInstanceEntityOutline) GetAccount() accounts.AccountOutline {
return x.Account
Expand Down Expand Up @@ -5929,11 +5934,6 @@ func (x ApmDatabaseInstanceEntityOutline) GetSummaryMetrics() []EntitySummaryMet
return x.SummaryMetrics
}

// GetTags returns a pointer to the value of Tags from ApmDatabaseInstanceEntityOutline
func (x ApmDatabaseInstanceEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetType returns a pointer to the value of Type from ApmDatabaseInstanceEntityOutline
func (x ApmDatabaseInstanceEntityOutline) GetType() string {
return x.Type
Expand Down Expand Up @@ -9715,6 +9715,11 @@ type ExternalEntityOutline struct {
UiTemplates []EntityDashboardTemplatesUi `json:"uiTemplates"`
}

// GetTags returns a pointer to the value of Tags from ExternalEntityOutline
func (x ExternalEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetAccount returns a pointer to the value of Account from ExternalEntityOutline
func (x ExternalEntityOutline) GetAccount() accounts.AccountOutline {
return x.Account
Expand Down Expand Up @@ -9815,11 +9820,6 @@ func (x ExternalEntityOutline) GetSummaryMetrics() []EntitySummaryMetric {
return x.SummaryMetrics
}

// GetTags returns a pointer to the value of Tags from ExternalEntityOutline
func (x ExternalEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetType returns a pointer to the value of Type from ExternalEntityOutline
func (x ExternalEntityOutline) GetType() string {
return x.Type
Expand Down Expand Up @@ -10146,6 +10146,11 @@ type GenericEntityOutline struct {
UiTemplates []EntityDashboardTemplatesUi `json:"uiTemplates"`
}

// GetTags returns a pointer to the value of Tags from GenericEntityOutline
func (x GenericEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetAccount returns a pointer to the value of Account from GenericEntityOutline
func (x GenericEntityOutline) GetAccount() accounts.AccountOutline {
return x.Account
Expand Down Expand Up @@ -10246,11 +10251,6 @@ func (x GenericEntityOutline) GetSummaryMetrics() []EntitySummaryMetric {
return x.SummaryMetrics
}

// GetTags returns a pointer to the value of Tags from GenericEntityOutline
func (x GenericEntityOutline) GetTags() []EntityTag {
return x.Tags
}

// GetType returns a pointer to the value of Type from GenericEntityOutline
func (x GenericEntityOutline) GetType() string {
return x.Type
Expand Down Expand Up @@ -17345,6 +17345,7 @@ type EntityOutlineInterface interface {
GetGUID() common.EntityGUID
GetName() string
GetType() string
GetTags() []EntityTag
}

// UnmarshalEntityOutlineInterface unmarshals the interface into the correct type
Expand Down
1 change: 0 additions & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ require (
github.com/xanzy/go-gitlab v0.105.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xen0n/gosmopolitan v1.2.1 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yagipy/maintidx v1.0.0 // indirect
github.com/yeya24/promlinter v0.2.0 // indirect
Expand Down

0 comments on commit 60ba48a

Please sign in to comment.