diff --git a/.tutone.yml b/.tutone.yml index 7bbafb315..77dcceab9 100644 --- a/.tutone.yml +++ b/.tutone.yml @@ -1811,7 +1811,7 @@ packages: - name: entityManagementUpdatePipelineCloudRule max_query_field_depth: 3 - name: entityManagementDelete - max_query_field_depth: 3 + max_query_field_depth: 3 types: - name: EntityManagementEntity include_implementations: @@ -1824,6 +1824,51 @@ packages: skip_type_create: true # nrtime imports + - name: DateTime + field_type_override: nrtime.DateTime + skip_type_create: true + - name: EpochSeconds + field_type_override: nrtime.EpochSeconds + skip_type_create: true + - name: EpochMilliseconds + field_type_override: "*nrtime.EpochMilliseconds" + skip_type_create: true + - name: Minutes + field_type_override: nrtime.Minutes + skip_type_create: true + - name: Seconds + field_type_override: nrtime.Seconds + skip_type_create: true + + - name: federatedLogs + path: pkg/federatedlogs + import_path: github.com/newrelic/newrelic-client-go/v2/pkg/federatedlogs + generators: + - typegen + - nerdgraphclient + imports: + - github.com/newrelic/newrelic-client-go/v2/pkg/accounts + - github.com/newrelic/newrelic-client-go/v2/pkg/common + - github.com/newrelic/newrelic-client-go/v2/pkg/nrtime + - github.com/newrelic/newrelic-client-go/v2/pkg/users + mutations: + - name: entityManagementCreateFederatedLogSetup + max_query_field_depth: 4 + - name: entityManagementCreateAwsConnection + max_query_field_depth: 3 + - name: entityManagementCreateFederatedLogPartition + max_query_field_depth: 4 + - name: entityManagementUpdateFederatedLogPartition + max_query_field_depth: 4 + - name: entityManagementUpdateFederatedLogSetup + max_query_field_depth: 4 + types: + - name: ID + field_type_override: string + skip_type_create: true + - name: Nrql + field_type_override: nrdb.NRQL + skip_type_create: true - name: DateTime field_type_override: nrtime.DateTime skip_type_create: true diff --git a/newrelic/newrelic.go b/newrelic/newrelic.go index 4dc34a2f4..952733463 100644 --- a/newrelic/newrelic.go +++ b/newrelic/newrelic.go @@ -24,6 +24,7 @@ import ( "github.com/newrelic/newrelic-client-go/v2/pkg/entities" "github.com/newrelic/newrelic-client-go/v2/pkg/events" "github.com/newrelic/newrelic-client-go/v2/pkg/eventstometrics" + "github.com/newrelic/newrelic-client-go/v2/pkg/federatedlogs" "github.com/newrelic/newrelic-client-go/v2/pkg/installevents" "github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction" "github.com/newrelic/newrelic-client-go/v2/pkg/logconfigurations" @@ -62,6 +63,7 @@ type NewRelic struct { Entities entities.Entities Events events.Events EventsToMetrics eventstometrics.EventsToMetrics + FederatedLogs federatedlogs.FederatedLogs InstallEvents installevents.Installevents Logs logs.Logs Logconfigurations logconfigurations.Logconfigurations @@ -113,6 +115,7 @@ func New(opts ...ConfigOption) (*NewRelic, error) { Entities: entities.New(cfg), Events: events.New(cfg), EventsToMetrics: eventstometrics.New(cfg), + FederatedLogs: federatedlogs.New(cfg), InstallEvents: installevents.New(cfg), Logs: logs.New(cfg), Logconfigurations: logconfigurations.New(cfg), diff --git a/pkg/cloud/cloud_api_unit_test.go b/pkg/cloud/cloud_api_unit_test.go index 5f55e97bc..e1f435163 100644 --- a/pkg/cloud/cloud_api_unit_test.go +++ b/pkg/cloud/cloud_api_unit_test.go @@ -64,8 +64,8 @@ var ( } } }` - linkedAccountID = fmt.Sprintf("%06d", rand.Int63n(1e6)) - nrAccountID = fmt.Sprintf("%06d", rand.Int63n(1e6)) + linkedAccountID = fmt.Sprintf("%d", rand.Int63n(1e6-1e5)+1e5) + nrAccountID = fmt.Sprintf("%d", rand.Int63n(1e6-1e5)+1e5) testUpdateAzureLinkAccount = ` { diff --git a/pkg/federatedlogs/federatedLogs_api.go b/pkg/federatedlogs/federatedLogs_api.go new file mode 100644 index 000000000..08751d36c --- /dev/null +++ b/pkg/federatedlogs/federatedLogs_api.go @@ -0,0 +1,514 @@ +// Code generated by tutone: DO NOT EDIT +package federatedlogs + +import "context" + +// Creates an entity of type AwsConnectionEntity. +func (a *FederatedLogs) EntityManagementCreateAwsConnection( + awsConnectionEntity EntityManagementAwsConnectionEntityCreateInput, +) (*EntityManagementAwsConnectionEntityCreateResult, error) { + return a.EntityManagementCreateAwsConnectionWithContext(context.Background(), + awsConnectionEntity, + ) +} + +// Creates an entity of type AwsConnectionEntity. +func (a *FederatedLogs) EntityManagementCreateAwsConnectionWithContext( + ctx context.Context, + awsConnectionEntity EntityManagementAwsConnectionEntityCreateInput, +) (*EntityManagementAwsConnectionEntityCreateResult, error) { + + resp := EntityManagementCreateAwsConnectionQueryResponse{} + vars := map[string]interface{}{ + "awsConnectionEntity": awsConnectionEntity, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementCreateAwsConnectionMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementAwsConnectionEntityCreateResult, nil +} + +type EntityManagementCreateAwsConnectionQueryResponse struct { + EntityManagementAwsConnectionEntityCreateResult EntityManagementAwsConnectionEntityCreateResult `json:"EntityManagementCreateAwsConnection"` +} + +const EntityManagementCreateAwsConnectionMutation = `mutation( + $awsConnectionEntity: EntityManagementAwsConnectionEntityCreateInput!, +) { entityManagementCreateAwsConnection( + awsConnectionEntity: $awsConnectionEntity, +) { + entity { + credential { + assumeRole { + externalId + roleArn + } + } + description + enabled + externalId + id + metadata { + createdAt + createdBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + updatedAt + updatedBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + version + } + name + region + scope { + id + type + } + settings { + key + value + } + tags { + key + values + } + type + } +} }` + +// Creates an entity of type FederatedLogPartitionEntity. +func (a *FederatedLogs) EntityManagementCreateFederatedLogPartition( + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityCreateInput, +) (*EntityManagementFederatedLogPartitionEntityCreateResult, error) { + return a.EntityManagementCreateFederatedLogPartitionWithContext(context.Background(), + federatedLogPartitionEntity, + ) +} + +// Creates an entity of type FederatedLogPartitionEntity. +func (a *FederatedLogs) EntityManagementCreateFederatedLogPartitionWithContext( + ctx context.Context, + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityCreateInput, +) (*EntityManagementFederatedLogPartitionEntityCreateResult, error) { + + resp := EntityManagementCreateFederatedLogPartitionQueryResponse{} + vars := map[string]interface{}{ + "federatedLogPartitionEntity": federatedLogPartitionEntity, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementCreateFederatedLogPartitionMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogPartitionEntityCreateResult, nil +} + +type EntityManagementCreateFederatedLogPartitionQueryResponse struct { + EntityManagementFederatedLogPartitionEntityCreateResult EntityManagementFederatedLogPartitionEntityCreateResult `json:"EntityManagementCreateFederatedLogPartition"` +} + +// NOTE: This mutation has been simplified to avoid exceeding the GraphQL API's grammar token limit +// and to avoid FieldsConflict errors from inline fragments with conflicting nullability shapes. +// This simplified version only queries fields specific to FederatedLogPartitionEntity. +const EntityManagementCreateFederatedLogPartitionMutation = `mutation( + $federatedLogPartitionEntity: EntityManagementFederatedLogPartitionEntityCreateInput!, +) { entityManagementCreateFederatedLogPartition( + federatedLogPartitionEntity: $federatedLogPartitionEntity, +) { + entity { + dataLocationURI + description + id + isDefault + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + name + nrAccountId + partitionDatabase + partitionTable + retentionPolicy { + duration + unit + } + scope { + id + type + } + status + tags { + key + values + } + type + } +} }` + +// Creates an entity of type FederatedLogSetupEntity. +func (a *FederatedLogs) EntityManagementCreateFederatedLogSetup( + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityCreateInput, +) (*EntityManagementFederatedLogSetupEntityCreateResult, error) { + return a.EntityManagementCreateFederatedLogSetupWithContext(context.Background(), + federatedLogSetupEntity, + ) +} + +// Creates an entity of type FederatedLogSetupEntity. +func (a *FederatedLogs) EntityManagementCreateFederatedLogSetupWithContext( + ctx context.Context, + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityCreateInput, +) (*EntityManagementFederatedLogSetupEntityCreateResult, error) { + + resp := EntityManagementCreateFederatedLogSetupQueryResponse{} + vars := map[string]interface{}{ + "federatedLogSetupEntity": federatedLogSetupEntity, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementCreateFederatedLogSetupMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogSetupEntityCreateResult, nil +} + +type EntityManagementCreateFederatedLogSetupQueryResponse struct { + EntityManagementFederatedLogSetupEntityCreateResult EntityManagementFederatedLogSetupEntityCreateResult `json:"EntityManagementCreateFederatedLogSetup"` +} + +// NOTE: This mutation has been simplified to avoid exceeding the GraphQL API's 15,000 grammar token limit. +// The original auto-generated mutation (~14,490 lines) included inline fragments for all entity types, +// which was unnecessary for FederatedLogSetupEntity and caused the error: +// "More than 15,000 'grammar' tokens have been presented. To prevent Denial Of Service attacks, parsing has been cancelled." +// +// This simplified version only queries fields specific to FederatedLogSetupEntity. +const EntityManagementCreateFederatedLogSetupMutation = `mutation( + $federatedLogSetupEntity: EntityManagementFederatedLogSetupEntityCreateInput!, +) { entityManagementCreateFederatedLogSetup( + federatedLogSetupEntity: $federatedLogSetupEntity, +) { + entity { + __typename + id + name + type + cloudProvider + cloudProviderRegion + dataLocationBucket + description + nrAccountId + nrRegion + status + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + queryConnection { + __typename + id + name + type + } + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + scope { + id + type + } + tags { + key + values + } + } +} }` + + +// Updates an entity of type FederatedLogPartitionEntity. +func (a *FederatedLogs) EntityManagementUpdateFederatedLogPartition( + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogPartitionEntityUpdateResult, error) { + return a.EntityManagementUpdateFederatedLogPartitionWithContext(context.Background(), + federatedLogPartitionEntity, + iD, + version, + ) +} + +// Updates an entity of type FederatedLogPartitionEntity. +func (a *FederatedLogs) EntityManagementUpdateFederatedLogPartitionWithContext( + ctx context.Context, + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogPartitionEntityUpdateResult, error) { + + resp := EntityManagementUpdateFederatedLogPartitionQueryResponse{} + vars := map[string]interface{}{ + "federatedLogPartitionEntity": federatedLogPartitionEntity, + "id": iD, + "version": version, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementUpdateFederatedLogPartitionMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogPartitionEntityUpdateResult, nil +} + +type EntityManagementUpdateFederatedLogPartitionQueryResponse struct { + EntityManagementFederatedLogPartitionEntityUpdateResult EntityManagementFederatedLogPartitionEntityUpdateResult `json:"EntityManagementUpdateFederatedLogPartition"` +} + +const EntityManagementUpdateFederatedLogPartitionMutation = `mutation( + $federatedLogPartitionEntity: EntityManagementFederatedLogPartitionEntityUpdateInput!, + $id: ID!, + $version: Int, +) { entityManagementUpdateFederatedLogPartition( + federatedLogPartitionEntity: $federatedLogPartitionEntity, + id: $id, + version: $version, +) { + entity { + + description + id + isDefault + metadata { + createdAt + createdBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + updatedAt + updatedBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + version + } + name + nrAccountId + partitionDatabase + partitionTable + retentionPolicy { + duration + unit + } + scope { + id + type + } + setup { + cloudProvider + cloudProviderRegion + dataLocationBucket + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + description + id + metadata { + createdAt + updatedAt + version + } + name + nrAccountId + nrRegion + queryConnection { + __typename + id + name + type + } + scope { + id + type + } + status + tags { + key + values + } + type + } + status + tags { + key + values + } + type + } +} }` + +// Updates an entity of type FederatedLogSetupEntity. +func (a *FederatedLogs) EntityManagementUpdateFederatedLogSetup( + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogSetupEntityUpdateResult, error) { + return a.EntityManagementUpdateFederatedLogSetupWithContext(context.Background(), + federatedLogSetupEntity, + iD, + version, + ) +} + +// Updates an entity of type FederatedLogSetupEntity. +func (a *FederatedLogs) EntityManagementUpdateFederatedLogSetupWithContext( + ctx context.Context, + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogSetupEntityUpdateResult, error) { + + resp := EntityManagementUpdateFederatedLogSetupQueryResponse{} + vars := map[string]interface{}{ + "federatedLogSetupEntity": federatedLogSetupEntity, + "id": iD, + "version": version, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementUpdateFederatedLogSetupMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogSetupEntityUpdateResult, nil +} + +type EntityManagementUpdateFederatedLogSetupQueryResponse struct { + EntityManagementFederatedLogSetupEntityUpdateResult EntityManagementFederatedLogSetupEntityUpdateResult `json:"EntityManagementUpdateFederatedLogSetup"` +} + + +const EntityManagementUpdateFederatedLogSetupMutation = `mutation( + $federatedLogSetupEntity: EntityManagementFederatedLogSetupEntityUpdateInput!, + $id: ID!, + $version: Int, +) { entityManagementUpdateFederatedLogSetup( + federatedLogSetupEntity: $federatedLogSetupEntity, + id: $id, + version: $version, +) { + entity { + __typename + id + name + type + cloudProvider + cloudProviderRegion + dataLocationBucket + description + nrAccountId + nrRegion + status + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + queryConnection { + __typename + id + name + type + } + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + scope { + id + type + } + tags { + key + values + } + } +} }` diff --git a/pkg/federatedlogs/federatedLogs_test.go b/pkg/federatedlogs/federatedLogs_test.go new file mode 100644 index 000000000..bcd317d29 --- /dev/null +++ b/pkg/federatedlogs/federatedLogs_test.go @@ -0,0 +1,21 @@ +//go:build unit || integration +// +build unit integration + +package federatedlogs + +import ( + "testing" + + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" +) + +func newMockClient(t *testing.T, mockJSONResponse string, statusCode int) FederatedLogs { + ts := mock.NewMockServer(t, mockJSONResponse, statusCode) + tc := mock.NewTestConfig(t, ts) + return New(tc) +} + +func newIntegrationTestClient(t *testing.T) FederatedLogs { + tc := mock.NewIntegrationTestConfig(t) + return New(tc) +} diff --git a/pkg/federatedlogs/federatedLogs_unit_test.go b/pkg/federatedlogs/federatedLogs_unit_test.go new file mode 100644 index 000000000..201ba3296 --- /dev/null +++ b/pkg/federatedlogs/federatedLogs_unit_test.go @@ -0,0 +1,388 @@ +//go:build unit +// +build unit + +package federatedlogs + +import ( + "context" + "net/http" + "testing" + + "github.com/stretchr/testify/require" +) + +var ( + testAccountID = "12345" + testSetupID = "MXxGRURFUkFURURfTE9HX1NFVFVQX0VOVElUWXwxMjM0NXw1Njc4OQ" + testPartitionID = "MXxGRURFUkFURURfTE9HX1BBUlRJVElPTl9FTlRJVFl8MTIzNDV8OTg3NjU" + testAwsConnectionID = "MXxBV1NfQ09OTkVDVElPTl9FTlRJVFl8MTIzNDV8MTExMTE" + testDataProcessingConnID = "MXxEQVRBX1BST0NFU1NJTkdfQ09OTkVDVElPTnwxMjM0NXwyMjIyMg" + testQueryConnectionID = "MXxRVUVSWV9DT05ORUNUSU9OfDEyMzQ1fDMzMzMz" + + testCreateAwsConnectionResponseJSON = ` + { + "data": { + "entityManagementCreateAwsConnection": { + "entity": { + "id": "MXxBV1NfQ09OTkVDVElPTl9FTlRJVFl8MTIzNDV8MTExMTE", + "name": "Test AWS Connection", + "description": "Test AWS Connection for Federated Logs", + "enabled": true, + "externalId": "arn:aws:iam::123456789012:role/NewRelicRole", + "region": "us-east-1", + "type": "AwsConnectionEntity", + "metadata": { + "version": 1 + } + } + } + } + }` + + testCreateFederatedLogSetupResponseJSON = ` + { + "data": { + "entityManagementCreateFederatedLogSetup": { + "entity": { + "id": "MXxGRURFUkFURURfTE9HX1NFVFVQX0VOVElUWXwxMjM0NXw1Njc4OQ", + "name": "Test Federated Log Setup", + "description": "Test Federated Log Setup for S3", + "cloudProvider": "AWS", + "cloudProviderRegion": "us-east-1", + "dataLocationBucket": "s3://my-log-bucket", + "metadata": { + "version": 1 + } + } + } + } + }` + + testCreateFederatedLogPartitionResponseJSON = ` + { + "data": { + "entityManagementCreateFederatedLogPartition": { + "entity": { + "id": "MXxGRURFUkFURURfTE9HX1BBUlRJVElPTl9FTlRJVFl8MTIzNDV8OTg3NjU", + "name": "Test Log Partition", + "description": "Test Federated Log Partition", + "dataLocationURI": "s3://my-log-bucket/partition-path", + "isDefault": false, + "partitionTable": "logs_partition_table", + "status": "ACTIVE", + "metadata": { + "version": 1 + } + } + } + } + }` + + testUpdateFederatedLogSetupResponseJSON = ` + { + "data": { + "entityManagementUpdateFederatedLogSetup": { + "entity": { + "id": "MXxGRURFUkFURURfTE9HX1NFVFVQX0VOVElUWXwxMjM0NXw1Njc4OQ", + "name": "Test Federated Log Setup Updated", + "description": "Updated Test Federated Log Setup", + "cloudProvider": "AWS", + "cloudProviderRegion": "us-west-2", + "dataLocationBucket": "s3://my-updated-log-bucket", + "metadata": { + "version": 2 + } + } + } + } + }` + + testUpdateFederatedLogPartitionResponseJSON = ` + { + "data": { + "entityManagementUpdateFederatedLogPartition": { + "entity": { + "id": "MXxGRURFUkFURURfTE9HX1BBUlRJVElPTl9FTlRJVFl8MTIzNDV8OTg3NjU", + "name": "Test Log Partition Updated", + "description": "Updated Test Federated Log Partition", + "isDefault": true, + "partitionTable": "logs_partition_table_v2", + "metadata": { + "version": 2 + } + } + } + } + }` +) + +func TestUnitEntityManagement_CreateAwsConnection(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateAwsConnectionResponseJSON, http.StatusOK) + + createInput := EntityManagementAwsConnectionEntityCreateInput{ + Name: "Test AWS Connection", + Description: "Test AWS Connection for Federated Logs", + Enabled: true, + ExternalId: "arn:aws:iam::123456789012:role/NewRelicRole", + Region: "us-east-1", + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateAwsConnection(createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testAwsConnectionID, result.Entity.ID) + require.Equal(t, "Test AWS Connection", result.Entity.Name) + require.Equal(t, true, result.Entity.Enabled) + require.Equal(t, "us-east-1", result.Entity.Region) +} + +func TestUnitEntityManagement_CreateAwsConnectionWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateAwsConnectionResponseJSON, http.StatusOK) + + createInput := EntityManagementAwsConnectionEntityCreateInput{ + Name: "Test AWS Connection", + Description: "Test AWS Connection for Federated Logs", + Enabled: true, + ExternalId: "arn:aws:iam::123456789012:role/NewRelicRole", + Region: "us-east-1", + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + ctx := context.Background() + result, err := client.EntityManagementCreateAwsConnectionWithContext(ctx, createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testAwsConnectionID, result.Entity.ID) + require.Equal(t, "Test AWS Connection", result.Entity.Name) +} + +func TestUnitEntityManagement_CreateFederatedLogSetup(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogSetupResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: "Test Federated Log Setup", + Description: "Test Federated Log Setup for S3", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: "s3://my-log-bucket", + DataProcessingConnectionId: testDataProcessingConnID, + PartitionDatabase: "federated_logs_db", + QueryConnectionId: testQueryConnectionID, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateFederatedLogSetup(createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup", result.Entity.Name) + require.Equal(t, "AWS", string(result.Entity.CloudProvider)) + require.Equal(t, "s3://my-log-bucket", result.Entity.DataLocationBucket) +} + +func TestUnitEntityManagement_CreateFederatedLogSetupWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogSetupResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: "Test Federated Log Setup", + Description: "Test Federated Log Setup for S3", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: "s3://my-log-bucket", + DataProcessingConnectionId: testDataProcessingConnID, + PartitionDatabase: "federated_logs_db", + QueryConnectionId: testQueryConnectionID, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + ctx := context.Background() + result, err := client.EntityManagementCreateFederatedLogSetupWithContext(ctx, createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup", result.Entity.Name) +} + +func TestUnitEntityManagement_CreateFederatedLogPartition(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogPartitionResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogPartitionEntityCreateInput{ + Name: "Test Log Partition", + Description: "Test Federated Log Partition", + DataLocationUri: "s3://my-log-bucket/partition-path", + IsDefault: false, + PartitionTable: "logs_partition_table", + SetupId: testSetupID, + Status: EntityManagementLogPartitionStatusTypes.ACTIVE, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + RetentionPolicy: EntityManagementRetentionPolicyCreateInput{ + Duration: 30, + Unit: "DAYS", + }, + } + + result, err := client.EntityManagementCreateFederatedLogPartition(createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testPartitionID, result.Entity.ID) + require.Equal(t, "Test Log Partition", result.Entity.Name) + require.Equal(t, false, result.Entity.IsDefault) + require.Equal(t, "logs_partition_table", result.Entity.PartitionTable) +} + +func TestUnitEntityManagement_CreateFederatedLogPartitionWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogPartitionResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogPartitionEntityCreateInput{ + Name: "Test Log Partition", + Description: "Test Federated Log Partition", + DataLocationUri: "s3://my-log-bucket/partition-path", + IsDefault: false, + PartitionTable: "logs_partition_table", + SetupId: testSetupID, + Status: EntityManagementLogPartitionStatusTypes.ACTIVE, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + ctx := context.Background() + result, err := client.EntityManagementCreateFederatedLogPartitionWithContext(ctx, createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testPartitionID, result.Entity.ID) + require.Equal(t, "Test Log Partition", result.Entity.Name) +} + +func TestUnitEntityManagement_UpdateFederatedLogSetup(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogSetupResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogSetupEntityUpdateInput{ + Name: "Test Federated Log Setup Updated", + Description: "Updated Test Federated Log Setup", + CloudProviderRegion: "us-west-2", + DataLocationBucket: "s3://my-updated-log-bucket", + } + + result, err := client.EntityManagementUpdateFederatedLogSetup( + updateInput, + testSetupID, + 2, + ) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup Updated", result.Entity.Name) + require.Equal(t, "us-west-2", result.Entity.CloudProviderRegion) + require.Equal(t, "s3://my-updated-log-bucket", result.Entity.DataLocationBucket) +} + +func TestUnitEntityManagement_UpdateFederatedLogSetupWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogSetupResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogSetupEntityUpdateInput{ + Name: "Test Federated Log Setup Updated", + Description: "Updated Test Federated Log Setup", + CloudProviderRegion: "us-west-2", + DataLocationBucket: "s3://my-updated-log-bucket", + } + + ctx := context.Background() + result, err := client.EntityManagementUpdateFederatedLogSetupWithContext( + ctx, + updateInput, + testSetupID, + 2, + ) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup Updated", result.Entity.Name) +} + +func TestUnitEntityManagement_UpdateFederatedLogPartition(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogPartitionResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogPartitionEntityUpdateInput{ + Name: "Test Log Partition Updated", + Description: "Updated Test Federated Log Partition", + IsDefault: true, + PartitionTable: "logs_partition_table_v2", + RetentionPolicy: EntityManagementRetentionPolicyUpdateInput{ + Duration: 60, + Unit: "DAYS", + }, + } + + result, err := client.EntityManagementUpdateFederatedLogPartition( + updateInput, + testPartitionID, + 2, + ) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testPartitionID, result.Entity.ID) + require.Equal(t, "Test Log Partition Updated", result.Entity.Name) + require.Equal(t, true, result.Entity.IsDefault) + require.Equal(t, "logs_partition_table_v2", result.Entity.PartitionTable) +} + +func TestUnitEntityManagement_UpdateFederatedLogPartitionWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogPartitionResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogPartitionEntityUpdateInput{ + Name: "Test Log Partition Updated", + Description: "Updated Test Federated Log Partition", + IsDefault: true, + PartitionTable: "logs_partition_table_v2", + } + + ctx := context.Background() + result, err := client.EntityManagementUpdateFederatedLogPartitionWithContext( + ctx, + updateInput, + testPartitionID, + 2, + ) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testPartitionID, result.Entity.ID) + require.Equal(t, "Test Log Partition Updated", result.Entity.Name) +} diff --git a/pkg/federatedlogs/federatedlogs.go b/pkg/federatedlogs/federatedlogs.go new file mode 100644 index 000000000..7c3033d7c --- /dev/null +++ b/pkg/federatedlogs/federatedlogs.go @@ -0,0 +1,23 @@ +package federatedlogs + +import ( + "github.com/newrelic/newrelic-client-go/v2/internal/http" + "github.com/newrelic/newrelic-client-go/v2/pkg/config" + "github.com/newrelic/newrelic-client-go/v2/pkg/logging" +) + +type FederatedLogs struct { + client http.Client + logger logging.Logger + config config.Config +} + +func New(config config.Config) FederatedLogs { + client := http.NewClient(config) + pkg := FederatedLogs{ + client: client, + logger: config.GetLogger(), + config: config, + } + return pkg +} diff --git a/pkg/federatedlogs/types.go b/pkg/federatedlogs/types.go new file mode 100644 index 000000000..54885a570 --- /dev/null +++ b/pkg/federatedlogs/types.go @@ -0,0 +1,6702 @@ +// Code generated by tutone: DO NOT EDIT +package federatedlogs + +import ( + "encoding/json" + "fmt" + + "github.com/newrelic/newrelic-client-go/v2/pkg/nrdb" + "github.com/newrelic/newrelic-client-go/v2/pkg/nrtime" +) + +// EntityManagementAiToolParameterType - Enum for AiToolParameter +type EntityManagementAiToolParameterType string + +var EntityManagementAiToolParameterTypeTypes = struct { + // when the parameter type is boolean + BOOLEAN EntityManagementAiToolParameterType + // when the parameter type is integer + INTEGER EntityManagementAiToolParameterType + // when the parameter type is list + LIST EntityManagementAiToolParameterType + // when the parameter type is object/dict + OBJECT EntityManagementAiToolParameterType + // when the parameter type is String + STRING EntityManagementAiToolParameterType +}{ + // when the parameter type is boolean + BOOLEAN: "BOOLEAN", + // when the parameter type is integer + INTEGER: "INTEGER", + // when the parameter type is list + LIST: "LIST", + // when the parameter type is object/dict + OBJECT: "OBJECT", + // when the parameter type is String + STRING: "STRING", +} + +// EntityManagementAiToolType - Enum for first class citizen tools on the agentic-platform +type EntityManagementAiToolType string + +var EntityManagementAiToolTypeTypes = struct { + // when tool type is knowledge base + KNOWLEDGE_BASE EntityManagementAiToolType + // when tool type is nerdgraph query + NERDGRAPH EntityManagementAiToolType + // when tool type is workflow tools + WORKFLOW EntityManagementAiToolType +}{ + // when tool type is knowledge base + KNOWLEDGE_BASE: "KNOWLEDGE_BASE", + // when tool type is nerdgraph query + NERDGRAPH: "NERDGRAPH", + // when tool type is workflow tools + WORKFLOW: "WORKFLOW", +} + +// EntityManagementArrayOperator - Enum defining the supported array operators. +type EntityManagementArrayOperator string + +var EntityManagementArrayOperatorTypes = struct { + // Checks for empty array. + IS_EMPTY EntityManagementArrayOperator + // Checks for non-empty array. + IS_NOT_EMPTY EntityManagementArrayOperator +}{ + // Checks for empty array. + IS_EMPTY: "IS_EMPTY", + // Checks for non-empty array. + IS_NOT_EMPTY: "IS_NOT_EMPTY", +} + +// EntityManagementAssignmentType - Work Item assignment type +type EntityManagementAssignmentType string + +var EntityManagementAssignmentTypeTypes = struct { + // New Relic team ID + NEW_RELIC_TEAM_ID EntityManagementAssignmentType + // New Relic user ID + NEW_RELIC_USER_ID EntityManagementAssignmentType +}{ + // New Relic team ID + NEW_RELIC_TEAM_ID: "NEW_RELIC_TEAM_ID", + // New Relic user ID + NEW_RELIC_USER_ID: "NEW_RELIC_USER_ID", +} + +// EntityManagementBackgroundProcessingType - At rest background processing types +type EntityManagementBackgroundProcessingType string + +var EntityManagementBackgroundProcessingTypeTypes = struct { + // Data mutation + DATA_MUTATION EntityManagementBackgroundProcessingType + // Exporting processing type + EXPORT EntityManagementBackgroundProcessingType + // Importing processing type + IMPORT EntityManagementBackgroundProcessingType + // Index rule + INDEX EntityManagementBackgroundProcessingType + // Materialized view rule + MATERIALIZED_VIEW EntityManagementBackgroundProcessingType + // Schedule a query to be executed + SCHEDULED_QUERY_RESULT EntityManagementBackgroundProcessingType +}{ + // Data mutation + DATA_MUTATION: "DATA_MUTATION", + // Exporting processing type + EXPORT: "EXPORT", + // Importing processing type + IMPORT: "IMPORT", + // Index rule + INDEX: "INDEX", + // Materialized view rule + MATERIALIZED_VIEW: "MATERIALIZED_VIEW", + // Schedule a query to be executed + SCHEDULED_QUERY_RESULT: "SCHEDULED_QUERY_RESULT", +} + +// EntityManagementBudgetType - Defines possible budget types. +type EntityManagementBudgetType string + +var EntityManagementBudgetTypeTypes = struct { + // Compute Budget. + COMPUTE EntityManagementBudgetType + // Ingest Budget. + INGEST EntityManagementBudgetType +}{ + // Compute Budget. + COMPUTE: "COMPUTE", + // Ingest Budget. + INGEST: "INGEST", +} + +// EntityManagementCategoryScopeType - Category scope can of two types: Account scope and Global scope +type EntityManagementCategoryScopeType string + +var EntityManagementCategoryScopeTypeTypes = struct { + // Account scope + ACCOUNT EntityManagementCategoryScopeType + // Global scope + GLOBAL EntityManagementCategoryScopeType +}{ + // Account scope + ACCOUNT: "ACCOUNT", + // Global scope + GLOBAL: "GLOBAL", +} + +// EntityManagementChannelType - Enum for Channel +type EntityManagementChannelType string + +var EntityManagementChannelTypeTypes = struct { + // Browser + BROWSER EntityManagementChannelType + // Mobile + MOBILE EntityManagementChannelType +}{ + // Browser + BROWSER: "BROWSER", + // Mobile + MOBILE: "MOBILE", +} + +// EntityManagementCloudProvider - Supported cloud providers for federated log deployments. +type EntityManagementCloudProvider string + +var EntityManagementCloudProviderTypes = struct { + // Amazon Web Services + AWS EntityManagementCloudProvider + // Microsoft Azure + AZURE EntityManagementCloudProvider + // Google Cloud Platform + GCP EntityManagementCloudProvider + // Oracle Cloud Infrastructure + OCI EntityManagementCloudProvider +}{ + // Amazon Web Services + AWS: "AWS", + // Microsoft Azure + AZURE: "AZURE", + // Google Cloud Platform + GCP: "GCP", + // Oracle Cloud Infrastructure + OCI: "OCI", +} + +// EntityManagementCommunicationMode - CommunicationMode represents the mode of communication for an incident. +type EntityManagementCommunicationMode string + +var EntityManagementCommunicationModeTypes = struct { + // For Private status page communication. + ACCOUNT_STATUS EntityManagementCommunicationMode + // For Publicstatus page communication. + GLOBAL_STATUS EntityManagementCommunicationMode +}{ + // For Private status page communication. + ACCOUNT_STATUS: "ACCOUNT_STATUS", + // For Publicstatus page communication. + GLOBAL_STATUS: "GLOBAL_STATUS", +} + +// EntityManagementCommunicationStatus - CommunicationStatus represents the status of the communication for an incident. +type EntityManagementCommunicationStatus string + +var EntityManagementCommunicationStatusTypes = struct { + // Incident root cause has been identified. + IDENTIFIED EntityManagementCommunicationStatus + // Incident is being investigated. + INVESTIGATING EntityManagementCommunicationStatus + // Incident in Monitoring phase. + MONITORING EntityManagementCommunicationStatus + // Incident has been resolved. + RESOLVED EntityManagementCommunicationStatus +}{ + // Incident root cause has been identified. + IDENTIFIED: "IDENTIFIED", + // Incident is being investigated. + INVESTIGATING: "INVESTIGATING", + // Incident in Monitoring phase. + MONITORING: "MONITORING", + // Incident has been resolved. + RESOLVED: "RESOLVED", +} + +// EntityManagementConsumptionMetric - Defines possible consumption metrics for a budget. +type EntityManagementConsumptionMetric string + +var EntityManagementConsumptionMetricTypes = struct { + // Advanced CCU metric. + ADVANCED_CCU EntityManagementConsumptionMetric + // Legacy CCU metric. + CCU EntityManagementConsumptionMetric + // Core CCU metric. + CORE_CCU EntityManagementConsumptionMetric + // Gigabytes Ingested metric. + GIGABYTES_INGESTED EntityManagementConsumptionMetric +}{ + // Advanced CCU metric. + ADVANCED_CCU: "ADVANCED_CCU", + // Legacy CCU metric. + CCU: "CCU", + // Core CCU metric. + CORE_CCU: "CORE_CCU", + // Gigabytes Ingested metric. + GIGABYTES_INGESTED: "GIGABYTES_INGESTED", +} + +// EntityManagementCorrelationAttributeConditionOperator - Enum defining attribute matching operators. +type EntityManagementCorrelationAttributeConditionOperator string + +var EntityManagementCorrelationAttributeConditionOperatorTypes = struct { + // Contains substring. + CONTAINS EntityManagementCorrelationAttributeConditionOperator + // Exact equality match. + EQUALS EntityManagementCorrelationAttributeConditionOperator + // Regular expression match. + REGEX EntityManagementCorrelationAttributeConditionOperator + // Starts with prefix. + STARTS_WITH EntityManagementCorrelationAttributeConditionOperator +}{ + // Contains substring. + CONTAINS: "CONTAINS", + // Exact equality match. + EQUALS: "EQUALS", + // Regular expression match. + REGEX: "REGEX", + // Starts with prefix. + STARTS_WITH: "STARTS_WITH", +} + +// EntityManagementCorrelationMatchingAlgorithm - Enum defining ML algorithms for probabilistic matching. +type EntityManagementCorrelationMatchingAlgorithm string + +var EntityManagementCorrelationMatchingAlgorithmTypes = struct { + // Attribute similarity scoring. + ATTRIBUTE_SIMILARITY EntityManagementCorrelationMatchingAlgorithm + // BERT-based embedding similarity. + BERT_EMBEDDING EntityManagementCorrelationMatchingAlgorithm + // Historical pattern analysis. + HISTORICAL_PATTERNS EntityManagementCorrelationMatchingAlgorithm + // Incident Root Cause Analysis. + IRCA EntityManagementCorrelationMatchingAlgorithm +}{ + // Attribute similarity scoring. + ATTRIBUTE_SIMILARITY: "ATTRIBUTE_SIMILARITY", + // BERT-based embedding similarity. + BERT_EMBEDDING: "BERT_EMBEDDING", + // Historical pattern analysis. + HISTORICAL_PATTERNS: "HISTORICAL_PATTERNS", + // Incident Root Cause Analysis. + IRCA: "IRCA", +} + +// EntityManagementCorrelationOverrideAction - Enum defining user override actions for correlation links. +type EntityManagementCorrelationOverrideAction string + +var EntityManagementCorrelationOverrideActionTypes = struct { + // User confirmed the correlation. + CONFIRMED EntityManagementCorrelationOverrideAction + // User unlinked the correlation. + UNLINKED EntityManagementCorrelationOverrideAction +}{ + // User confirmed the correlation. + CONFIRMED: "CONFIRMED", + // User unlinked the correlation. + UNLINKED: "UNLINKED", +} + +// EntityManagementCorrelationSubjectType - Enum defining the type of correlation subject. +type EntityManagementCorrelationSubjectType string + +var EntityManagementCorrelationSubjectTypeTypes = struct { + // Entity-based subject. + ENTITY EntityManagementCorrelationSubjectType + // Event-based subject. + EVENT EntityManagementCorrelationSubjectType +}{ + // Entity-based subject. + ENTITY: "ENTITY", + // Event-based subject. + EVENT: "EVENT", +} + +// EntityManagementDateOperator - Enum defining the supported date operators. +type EntityManagementDateOperator string + +var EntityManagementDateOperatorTypes = struct { + // Date after the specified value. + AFTER EntityManagementDateOperator + // Date before the specified value. + BEFORE EntityManagementDateOperator + // Date within the specified range. + IN_RANGE EntityManagementDateOperator +}{ + // Date after the specified value. + AFTER: "AFTER", + // Date before the specified value. + BEFORE: "BEFORE", + // Date within the specified range. + IN_RANGE: "IN_RANGE", +} + +// EntityManagementEncodingName - The Encoding names options +type EntityManagementEncodingName string + +var EntityManagementEncodingNameTypes = struct { + // for gpt 4 + CL100_K_BASE EntityManagementEncodingName + // For gpt 3 + GPT_3_5_TURBO EntityManagementEncodingName + // For gpt4 + O200_K_BASE EntityManagementEncodingName +}{ + // for gpt 4 + CL100_K_BASE: "CL100_K_BASE", + // For gpt 3 + GPT_3_5_TURBO: "GPT_3_5_TURBO", + // For gpt4 + O200_K_BASE: "O200_K_BASE", +} + +// EntityManagementEncodingType - Encoding type enum +type EntityManagementEncodingType string + +var EntityManagementEncodingTypeTypes = struct { + // BASE64 encoding type + BASE64 EntityManagementEncodingType + // UTF8 encoding type + UTF8 EntityManagementEncodingType +}{ + // BASE64 encoding type + BASE64: "BASE64", + // UTF8 encoding type + UTF8: "UTF8", +} + +// EntityManagementEntityScope - The list of possible scopes of an entity. +type EntityManagementEntityScope string + +var EntityManagementEntityScopeTypes = struct { + // Account scope. + ACCOUNT EntityManagementEntityScope + // Organization scope. + ORGANIZATION EntityManagementEntityScope +}{ + // Account scope. + ACCOUNT: "ACCOUNT", + // Organization scope. + ORGANIZATION: "ORGANIZATION", +} + +// EntityManagementEvaluationParameter - Parameters that can be used in custom evaluations +type EntityManagementEvaluationParameter string + +var EntityManagementEvaluationParameterTypes = struct { + // Actual generated output + ACTUAL_OUTPUT EntityManagementEvaluationParameter + // Contextual information + CONTEXT EntityManagementEvaluationParameter + // Expected output for comparison + EXPECTED_OUTPUT EntityManagementEvaluationParameter + // Expected tools that should have been called + EXPECTED_TOOLS EntityManagementEvaluationParameter + // Input prompt or query + INPUT EntityManagementEvaluationParameter + // Retrieved context from RAG systems + RETRIEVAL_CONTEXT EntityManagementEvaluationParameter + // Tools that were called during execution + TOOLS_CALLED EntityManagementEvaluationParameter +}{ + // Actual generated output + ACTUAL_OUTPUT: "ACTUAL_OUTPUT", + // Contextual information + CONTEXT: "CONTEXT", + // Expected output for comparison + EXPECTED_OUTPUT: "EXPECTED_OUTPUT", + // Expected tools that should have been called + EXPECTED_TOOLS: "EXPECTED_TOOLS", + // Input prompt or query + INPUT: "INPUT", + // Retrieved context from RAG systems + RETRIEVAL_CONTEXT: "RETRIEVAL_CONTEXT", + // Tools that were called during execution + TOOLS_CALLED: "TOOLS_CALLED", +} + +// EntityManagementEventBridgeEventSourceType - An enum representing the different event source systems. +type EntityManagementEventBridgeEventSourceType string + +var EntityManagementEventBridgeEventSourceTypeTypes = struct { + // Events originating from the entity pipeline. + ENTITY EntityManagementEventBridgeEventSourceType +}{ + // Events originating from the entity pipeline. + ENTITY: "ENTITY", +} + +// EntityManagementEventBridgeTargetType - Enum defining the supported types of target actions. +type EntityManagementEventBridgeTargetType string + +var EntityManagementEventBridgeTargetTypeTypes = struct { + // Target type WORKFLOW + WORKFLOW EntityManagementEventBridgeTargetType +}{ + // Target type WORKFLOW + WORKFLOW: "WORKFLOW", +} + +// EntityManagementEventBridgeWorkflowDefinitionScopeType - Specifies the scope at which the workflow is defined. +type EntityManagementEventBridgeWorkflowDefinitionScopeType string + +var EntityManagementEventBridgeWorkflowDefinitionScopeTypeTypes = struct { + // Account scope + ACCOUNT EntityManagementEventBridgeWorkflowDefinitionScopeType + // Organization scope. + ORGANIZATION EntityManagementEventBridgeWorkflowDefinitionScopeType +}{ + // Account scope + ACCOUNT: "ACCOUNT", + // Organization scope. + ORGANIZATION: "ORGANIZATION", +} + +// EntityManagementExecutionStatus - Rule execution status +type EntityManagementExecutionStatus string + +var EntityManagementExecutionStatusTypes = struct { + // Rule execution failed due to an error. + FAILED EntityManagementExecutionStatus + // Rule executed with partial success, some issues occurred. + PARTIAL_SUCCESS EntityManagementExecutionStatus + // Rule executed successfully without any issues. + SUCCESS EntityManagementExecutionStatus +}{ + // Rule execution failed due to an error. + FAILED: "FAILED", + // Rule executed with partial success, some issues occurred. + PARTIAL_SUCCESS: "PARTIAL_SUCCESS", + // Rule executed successfully without any issues. + SUCCESS: "SUCCESS", +} + +// EntityManagementExternalOwnerType - List of possible owner types of the repository. +type EntityManagementExternalOwnerType string + +var EntityManagementExternalOwnerTypeTypes = struct { + // group if the source is gitlab + GROUP EntityManagementExternalOwnerType + // organization if the source is github + ORGANIZATION EntityManagementExternalOwnerType + // Default value when the owner type cannot be found + OTHER EntityManagementExternalOwnerType + // individual user + USER EntityManagementExternalOwnerType + // workspace if the source is bitbucket + WORKSPACE EntityManagementExternalOwnerType +}{ + // group if the source is gitlab + GROUP: "GROUP", + // organization if the source is github + ORGANIZATION: "ORGANIZATION", + // Default value when the owner type cannot be found + OTHER: "OTHER", + // individual user + USER: "USER", + // workspace if the source is bitbucket + WORKSPACE: "WORKSPACE", +} + +// EntityManagementFederatedLogSetupStatus - Status of a federated log setup. +type EntityManagementFederatedLogSetupStatus string + +var EntityManagementFederatedLogSetupStatusTypes = struct { + // Indicates the federated log setup is active. + ACTIVE EntityManagementFederatedLogSetupStatus + // Indicates the federated log setup is being created. + CREATING EntityManagementFederatedLogSetupStatus + // Indicates the federated log setup is in an error state. + ERROR EntityManagementFederatedLogSetupStatus + // Indicates the federated log setup is inactive. + INACTIVE EntityManagementFederatedLogSetupStatus +}{ + // Indicates the federated log setup is active. + ACTIVE: "ACTIVE", + // Indicates the federated log setup is being created. + CREATING: "CREATING", + // Indicates the federated log setup is in an error state. + ERROR: "ERROR", + // Indicates the federated log setup is inactive. + INACTIVE: "INACTIVE", +} + +// EntityManagementFleetDeploymentPhase - Phases a fleet deployment can have +type EntityManagementFleetDeploymentPhase string + +var EntityManagementFleetDeploymentPhaseTypes = struct { + // Deployment rollout completed + COMPLETED EntityManagementFleetDeploymentPhase + // Deployment is in editable phase + CREATED EntityManagementFleetDeploymentPhase + // Indicates a deployment failed to deploy to all agents + FAILED EntityManagementFleetDeploymentPhase + // Indicates an internal failure in the deployment process + INTERNAL_FAILURE EntityManagementFleetDeploymentPhase + // Deployment is under rollout + IN_PROGRESS EntityManagementFleetDeploymentPhase +}{ + // Deployment rollout completed + COMPLETED: "COMPLETED", + // Deployment is in editable phase + CREATED: "CREATED", + // Indicates a deployment failed to deploy to all agents + FAILED: "FAILED", + // Indicates an internal failure in the deployment process + INTERNAL_FAILURE: "INTERNAL_FAILURE", + // Deployment is under rollout + IN_PROGRESS: "IN_PROGRESS", +} + +// EntityManagementHostingPlatform - List of possible hosting platforms of the repository. +type EntityManagementHostingPlatform string + +var EntityManagementHostingPlatformTypes = struct { + // when the hosting platform is bitbucket + BITBUCKET EntityManagementHostingPlatform + // when the hosting platform is devlake + DEVLAKE EntityManagementHostingPlatform + // when the hosting platform is github + GITHUB EntityManagementHostingPlatform + // when the hosting platform is gitlab + GITLAB EntityManagementHostingPlatform + // Default value when the hosting platform cannot be found + OTHER EntityManagementHostingPlatform +}{ + // when the hosting platform is bitbucket + BITBUCKET: "BITBUCKET", + // when the hosting platform is devlake + DEVLAKE: "DEVLAKE", + // when the hosting platform is github + GITHUB: "GITHUB", + // when the hosting platform is gitlab + GITLAB: "GITLAB", + // Default value when the hosting platform cannot be found + OTHER: "OTHER", +} + +// EntityManagementIncidentSource - Defines the possible sources for an incident record. +type EntityManagementIncidentSource string + +var EntityManagementIncidentSourceTypes = struct { + // The source representing manual entry. + MANUAL EntityManagementIncidentSource + // The source representing New Relic Agent. + NEW_RELIC_AGENT EntityManagementIncidentSource + // The source representing Slack. + NEW_RELIC_SLACK EntityManagementIncidentSource + // The source representing New Relic. + NEW_RELIC_UI EntityManagementIncidentSource +}{ + // The source representing manual entry. + MANUAL: "MANUAL", + // The source representing New Relic Agent. + NEW_RELIC_AGENT: "NEW_RELIC_AGENT", + // The source representing Slack. + NEW_RELIC_SLACK: "NEW_RELIC_SLACK", + // The source representing New Relic. + NEW_RELIC_UI: "NEW_RELIC_UI", +} + +// EntityManagementIncidentStatus - IncidentStatus represents the status of an incident. +type EntityManagementIncidentStatus string + +var EntityManagementIncidentStatusTypes = struct { + // The incident is closed. + CLOSED EntityManagementIncidentStatus + // The incident is ongoing. + ONGOING EntityManagementIncidentStatus +}{ + // The incident is closed. + CLOSED: "CLOSED", + // The incident is ongoing. + ONGOING: "ONGOING", +} + +// EntityManagementIncidentTimelineSource - Defines the possible timeline sources for an incident record. +type EntityManagementIncidentTimelineSource string + +var EntityManagementIncidentTimelineSourceTypes = struct { + // The source representing manual entry. + MANUAL EntityManagementIncidentTimelineSource + // The source representing New Relic Agent. + NEW_RELIC_AGENT EntityManagementIncidentTimelineSource + // The source representing Slack. + NEW_RELIC_SLACK EntityManagementIncidentTimelineSource + // The source representing New Relic. + NEW_RELIC_UI EntityManagementIncidentTimelineSource +}{ + // The source representing manual entry. + MANUAL: "MANUAL", + // The source representing New Relic Agent. + NEW_RELIC_AGENT: "NEW_RELIC_AGENT", + // The source representing Slack. + NEW_RELIC_SLACK: "NEW_RELIC_SLACK", + // The source representing New Relic. + NEW_RELIC_UI: "NEW_RELIC_UI", +} + +// EntityManagementInstallationSource - Source of github integration installation +type EntityManagementInstallationSource string + +var EntityManagementInstallationSourceTypes = struct { + // GitHub Cloud installation + GITHUB_CLOUD EntityManagementInstallationSource + // GitHub Enterprise installation + GITHUB_ENTERPRISE EntityManagementInstallationSource +}{ + // GitHub Cloud installation + GITHUB_CLOUD: "GITHUB_CLOUD", + // GitHub Enterprise installation + GITHUB_ENTERPRISE: "GITHUB_ENTERPRISE", +} + +// EntityManagementInstallationStatus - List of possible installation statuses. +type EntityManagementInstallationStatus string + +var EntityManagementInstallationStatusTypes = struct { + // App currently active and running + INSTALLED EntityManagementInstallationStatus + // Uninstallation process has begun. + UNINSTALLATION_IN_PROGRESS EntityManagementInstallationStatus + // App has been uninstalled. + UNINSTALLED EntityManagementInstallationStatus +}{ + // App currently active and running + INSTALLED: "INSTALLED", + // Uninstallation process has begun. + UNINSTALLATION_IN_PROGRESS: "UNINSTALLATION_IN_PROGRESS", + // App has been uninstalled. + UNINSTALLED: "UNINSTALLED", +} + +// EntityManagementIssueType - Top level type for Inbox +type EntityManagementIssueType string + +var EntityManagementIssueTypeTypes = struct { + // Error issue + ERROR EntityManagementIssueType + // Performance issue + PERFORMANCE EntityManagementIssueType +}{ + // Error issue + ERROR: "ERROR", + // Performance issue + PERFORMANCE: "PERFORMANCE", +} + +// EntityManagementJiraIssueType - Jira issue type to be used in Jira Sync Configuration +type EntityManagementJiraIssueType string + +var EntityManagementJiraIssueTypeTypes = struct { + // Bug issue type in Jira + BUG EntityManagementJiraIssueType + // Story issue type in Jira + STORY EntityManagementJiraIssueType + // Task issue type in Jira + TASK EntityManagementJiraIssueType +}{ + // Bug issue type in Jira + BUG: "BUG", + // Story issue type in Jira + STORY: "STORY", + // Task issue type in Jira + TASK: "TASK", +} + +// EntityManagementKeyType - Base credentials type for New Relic +type EntityManagementKeyType string + +var EntityManagementKeyTypeTypes = struct { + // Ingest API key + INGEST EntityManagementKeyType + // User API key + USER EntityManagementKeyType +}{ + // Ingest API key + INGEST: "INGEST", + // User API key + USER: "USER", +} + +// EntityManagementLicenseName - List of possible repository license name. +type EntityManagementLicenseName string + +var EntityManagementLicenseNameTypes = struct { + // Academic Free License 3.0 + AFL_3_0 EntityManagementLicenseName + // GNU Affero General Public License v3.0 + AGPL_3_0 EntityManagementLicenseName + // Apache License 2.0 + APACHE_2_0 EntityManagementLicenseName + // BSD 2-Clause License + BSD_2_CLAUSE EntityManagementLicenseName + // BSD 3-Clause License + BSD_3_CLAUSE EntityManagementLicenseName + // Boost Software License 1.0 + BSL_1_0 EntityManagementLicenseName + // Creative Commons Zero v1.0 Universal + CC0_1_0 EntityManagementLicenseName + // Common Development and Distribution License + CDDL EntityManagementLicenseName + // Eclipse Public License 2.0 + EPL_2_0 EntityManagementLicenseName + // GNU General Public License v2.0 + GPL_2_0 EntityManagementLicenseName + // GNU General Public License v3.0 + GPL_3_0 EntityManagementLicenseName + // GNU General Public License v3.0 only + GPL_3_0_ONLY EntityManagementLicenseName + // GNU General Public License v3.0 or later + GPL_3_0_PLUS EntityManagementLicenseName + // GNU Lesser General Public License v2.1 + LGPL_2_1 EntityManagementLicenseName + // GNU Lesser General Public License v3.0 + LGPL_3_0 EntityManagementLicenseName + // GNU Lesser General Public License v3.0 only + LGPL_3_0_ONLY EntityManagementLicenseName + // GNU Lesser General Public License v3.0 or later + LGPL_3_0_PLUS EntityManagementLicenseName + // MIT License + MIT EntityManagementLicenseName + // Mozilla Public License 1.1 + MPL_1_1 EntityManagementLicenseName + // Mozilla Public License 2.0 + MPL_2_0 EntityManagementLicenseName + // Default value when the license cannot be found + NA EntityManagementLicenseName + // The Unlicense + UNLICENSE EntityManagementLicenseName +}{ + // Academic Free License 3.0 + AFL_3_0: "AFL_3_0", + // GNU Affero General Public License v3.0 + AGPL_3_0: "AGPL_3_0", + // Apache License 2.0 + APACHE_2_0: "APACHE_2_0", + // BSD 2-Clause License + BSD_2_CLAUSE: "BSD_2_CLAUSE", + // BSD 3-Clause License + BSD_3_CLAUSE: "BSD_3_CLAUSE", + // Boost Software License 1.0 + BSL_1_0: "BSL_1_0", + // Creative Commons Zero v1.0 Universal + CC0_1_0: "CC0_1_0", + // Common Development and Distribution License + CDDL: "CDDL", + // Eclipse Public License 2.0 + EPL_2_0: "EPL_2_0", + // GNU General Public License v2.0 + GPL_2_0: "GPL_2_0", + // GNU General Public License v3.0 + GPL_3_0: "GPL_3_0", + // GNU General Public License v3.0 only + GPL_3_0_ONLY: "GPL_3_0_ONLY", + // GNU General Public License v3.0 or later + GPL_3_0_PLUS: "GPL_3_0_PLUS", + // GNU Lesser General Public License v2.1 + LGPL_2_1: "LGPL_2_1", + // GNU Lesser General Public License v3.0 + LGPL_3_0: "LGPL_3_0", + // GNU Lesser General Public License v3.0 only + LGPL_3_0_ONLY: "LGPL_3_0_ONLY", + // GNU Lesser General Public License v3.0 or later + LGPL_3_0_PLUS: "LGPL_3_0_PLUS", + // MIT License + MIT: "MIT", + // Mozilla Public License 1.1 + MPL_1_1: "MPL_1_1", + // Mozilla Public License 2.0 + MPL_2_0: "MPL_2_0", + // Default value when the license cannot be found + NA: "NA", + // The Unlicense + UNLICENSE: "UNLICENSE", +} + +// EntityManagementLogPartitionStatus - Status of a log partition. +type EntityManagementLogPartitionStatus string + +var EntityManagementLogPartitionStatusTypes = struct { + // Indicates the log partition is active. + ACTIVE EntityManagementLogPartitionStatus + // Indicates the log partition is being created. + CREATING EntityManagementLogPartitionStatus + // Indicates the log partition is in an error state. + ERROR EntityManagementLogPartitionStatus + // Indicates the log partition is inactive. + INACTIVE EntityManagementLogPartitionStatus +}{ + // Indicates the log partition is active. + ACTIVE: "ACTIVE", + // Indicates the log partition is being created. + CREATING: "CREATING", + // Indicates the log partition is in an error state. + ERROR: "ERROR", + // Indicates the log partition is inactive. + INACTIVE: "INACTIVE", +} + +// EntityManagementManagedEntityType - Entity types that a Fleet can manage +type EntityManagementManagedEntityType string + +var EntityManagementManagedEntityTypeTypes = struct { + // Instrumented APM Application + APPLICATION EntityManagementManagedEntityType + // Infra Host + HOST EntityManagementManagedEntityType + // Kubernetes Cluster + KUBERNETESCLUSTER EntityManagementManagedEntityType +}{ + // Instrumented APM Application + APPLICATION: "APPLICATION", + // Infra Host + HOST: "HOST", + // Kubernetes Cluster + KUBERNETESCLUSTER: "KUBERNETESCLUSTER", +} + +// EntityManagementManagedEvaluationType - Available types of managed evaluations +type EntityManagementManagedEvaluationType string + +var EntityManagementManagedEvaluationTypeTypes = struct { + // Detects biased content + BIAS EntityManagementManagedEvaluationType + // Detects jailbreak attempts + JAILBREAK EntityManagementManagedEvaluationType + // Detects personally identifiable information leakage + PII_LEAKAGE EntityManagementManagedEvaluationType + // Detects prompt injection attacks + PROMPT_INJECTION EntityManagementManagedEvaluationType + // Validates topic control and consistency + TOPIC_CONTROL EntityManagementManagedEvaluationType + // Detects toxic content + TOXICITY EntityManagementManagedEvaluationType +}{ + // Detects biased content + BIAS: "BIAS", + // Detects jailbreak attempts + JAILBREAK: "JAILBREAK", + // Detects personally identifiable information leakage + PII_LEAKAGE: "PII_LEAKAGE", + // Detects prompt injection attacks + PROMPT_INJECTION: "PROMPT_INJECTION", + // Validates topic control and consistency + TOPIC_CONTROL: "TOPIC_CONTROL", + // Detects toxic content + TOXICITY: "TOXICITY", +} + +// EntityManagementMcpAuthType - Authentication types supported for MCP server connections +type EntityManagementMcpAuthType string + +var EntityManagementMcpAuthTypeTypes = struct { + // Bearer token authentication using Authorization header + BEARER_TOKEN EntityManagementMcpAuthType + // Authentication delegated to a Connections Manager entity (e.g., GithubConnection) + CONNECTION_REFERENCE EntityManagementMcpAuthType + // Custom header-based authentication with arbitrary key-value pair + GENERIC_HEADER EntityManagementMcpAuthType + // No authentication required + NONE EntityManagementMcpAuthType + // OAuth 2.0 authentication + OAUTH EntityManagementMcpAuthType +}{ + // Bearer token authentication using Authorization header + BEARER_TOKEN: "BEARER_TOKEN", + // Authentication delegated to a Connections Manager entity (e.g., GithubConnection) + CONNECTION_REFERENCE: "CONNECTION_REFERENCE", + // Custom header-based authentication with arbitrary key-value pair + GENERIC_HEADER: "GENERIC_HEADER", + // No authentication required + NONE: "NONE", + // OAuth 2.0 authentication + OAUTH: "OAUTH", +} + +// EntityManagementMcpTransport - Supported transport mechanisms for MCP servers +type EntityManagementMcpTransport string + +var EntityManagementMcpTransportTypes = struct { + // HTTP transport for request-response communication + HTTP EntityManagementMcpTransport + // Server-Sent Events transport for streaming communication + SSE EntityManagementMcpTransport +}{ + // HTTP transport for request-response communication + HTTP: "HTTP", + // Server-Sent Events transport for streaming communication + SSE: "SSE", +} + +// EntityManagementMessageType - Message type enum +type EntityManagementMessageType string + +var EntityManagementMessageTypeTypes = struct { + // JSON message type + JSON EntityManagementMessageType + // Text message type + TEXT EntityManagementMessageType + // YAML message type + YAML EntityManagementMessageType +}{ + // JSON message type + JSON: "JSON", + // Text message type + TEXT: "TEXT", + // YAML message type + YAML: "YAML", +} + +// EntityManagementNrRegion - New Relic regions +type EntityManagementNrRegion string + +var EntityManagementNrRegionTypes = struct { + // EU region + EU EntityManagementNrRegion + // US region + US EntityManagementNrRegion +}{ + // EU region + EU: "EU", + // US region + US: "US", +} + +// EntityManagementNumericOperator - Enum defining the supported numeric operators. +type EntityManagementNumericOperator string + +var EntityManagementNumericOperatorTypes = struct { + // Numeric values are exactly equal. + EQ EntityManagementNumericOperator + // Numeric values are greater than or equal. + GE EntityManagementNumericOperator + // Numeric values are greater than. + GT EntityManagementNumericOperator + // Numeric values are less than or equal. + LE EntityManagementNumericOperator + // Numeric values are less than. + LT EntityManagementNumericOperator +}{ + // Numeric values are exactly equal. + EQ: "EQ", + // Numeric values are greater than or equal. + GE: "GE", + // Numeric values are greater than. + GT: "GT", + // Numeric values are less than or equal. + LE: "LE", + // Numeric values are less than. + LT: "LT", +} + +// EntityManagementOperatingSystemType - The operating system to which a host type can belong +type EntityManagementOperatingSystemType string + +var EntityManagementOperatingSystemTypeTypes = struct { + // Linux based host + LINUX EntityManagementOperatingSystemType + // Windows based host + WINDOWS EntityManagementOperatingSystemType +}{ + // Linux based host + LINUX: "LINUX", + // Windows based host + WINDOWS: "WINDOWS", +} + +// EntityManagementOverlapPolicy - Possible types for the Overlap Policy of a Workflow Schedule +type EntityManagementOverlapPolicy string + +var EntityManagementOverlapPolicyTypes = struct { + // Cancel the currently running workflow and start a new one + CANCEL EntityManagementOverlapPolicy + // Skip the current scheduled run if the previous one is still running + SKIP EntityManagementOverlapPolicy +}{ + // Cancel the currently running workflow and start a new one + CANCEL: "CANCEL", + // Skip the current scheduled run if the previous one is still running + SKIP: "SKIP", +} + +// EntityManagementPrincipalType - Represents type of identity. +type EntityManagementPrincipalType string + +var EntityManagementPrincipalTypeTypes = struct { + // Principal type SYSTEM_IDENTITY + SYSTEM_IDENTITY EntityManagementPrincipalType + // Principal type USER + USER EntityManagementPrincipalType +}{ + // Principal type SYSTEM_IDENTITY + SYSTEM_IDENTITY: "SYSTEM_IDENTITY", + // Principal type USER + USER: "USER", +} + +// EntityManagementProcessStatus - At rest background processing types +type EntityManagementProcessStatus string + +var EntityManagementProcessStatusTypes = struct { + // Process completed + COMPLETED EntityManagementProcessStatus + // Failed to process a rule + FAILED EntityManagementProcessStatus + // The rule is being processed + RUNNING EntityManagementProcessStatus + // A rule that was scheduled + SCHEDULED EntityManagementProcessStatus +}{ + // Process completed + COMPLETED: "COMPLETED", + // Failed to process a rule + FAILED: "FAILED", + // The rule is being processed + RUNNING: "RUNNING", + // A rule that was scheduled + SCHEDULED: "SCHEDULED", +} + +// EntityManagementProvider - Enum for creator of the entity +type EntityManagementProvider string + +var EntityManagementProviderTypes = struct { + // created by external user + EXTERNAL EntityManagementProvider + // created by NR + INTERNAL EntityManagementProvider +}{ + // created by external user + EXTERNAL: "EXTERNAL", + // created by NR + INTERNAL: "INTERNAL", +} + +// EntityManagementRegion - Region represents the geographical region where the incident is impacting. +type EntityManagementRegion string + +var EntityManagementRegionTypes = struct { + // EU Region + EU EntityManagementRegion + // Staging Region + STAGING EntityManagementRegion + // US Region + US EntityManagementRegion +}{ + // EU Region + EU: "EU", + // Staging Region + STAGING: "STAGING", + // US Region + US: "US", +} + +// EntityManagementRetentionUnit - Time units for retention policies. +type EntityManagementRetentionUnit string + +var EntityManagementRetentionUnitTypes = struct { + // Days + DAYS EntityManagementRetentionUnit + // Months + MONTHS EntityManagementRetentionUnit + // Weeks + WEEKS EntityManagementRetentionUnit +}{ + // Days + DAYS: "DAYS", + // Months + MONTHS: "MONTHS", + // Weeks + WEEKS: "WEEKS", +} + +// EntityManagementSigningAlgorithm - Enum for JWT signing algorithm +type EntityManagementSigningAlgorithm string + +var EntityManagementSigningAlgorithmTypes = struct { + // RSA256 signing algorithm + RSA256 EntityManagementSigningAlgorithm +}{ + // RSA256 signing algorithm + RSA256: "RSA256", +} + +// EntityManagementStatusCode - Rule execution status codes +type EntityManagementStatusCode string + +var EntityManagementStatusCodeTypes = struct { + // Indicates the rule execution was unable to proceed due to missing data from the source. + MISSING_DATA_SOURCE EntityManagementStatusCode + // System error + SYSTEM_ERROR EntityManagementStatusCode +}{ + // Indicates the rule execution was unable to proceed due to missing data from the source. + MISSING_DATA_SOURCE: "MISSING_DATA_SOURCE", + // System error + SYSTEM_ERROR: "SYSTEM_ERROR", +} + +// EntityManagementStatusPageAnnouncementCategory - Type of announcement based on the category. +type EntityManagementStatusPageAnnouncementCategory string + +var EntityManagementStatusPageAnnouncementCategoryTypes = struct { + // EOL Announcement category + END_OF_LIFE EntityManagementStatusPageAnnouncementCategory +}{ + // EOL Announcement category + END_OF_LIFE: "END_OF_LIFE", +} + +// EntityManagementStatusPageAnnouncementState - The state of an announcement +type EntityManagementStatusPageAnnouncementState string + +var EntityManagementStatusPageAnnouncementStateTypes = struct { + // Canceled state of the announcement. + CANCELED EntityManagementStatusPageAnnouncementState + // Draft state of the announcement. + DRAFT EntityManagementStatusPageAnnouncementState + // Published state of the announcement. + PUBLISHED EntityManagementStatusPageAnnouncementState + // Scheduled state of the announcement. + SCHEDULED EntityManagementStatusPageAnnouncementState +}{ + // Canceled state of the announcement. + CANCELED: "CANCELED", + // Draft state of the announcement. + DRAFT: "DRAFT", + // Published state of the announcement. + PUBLISHED: "PUBLISHED", + // Scheduled state of the announcement. + SCHEDULED: "SCHEDULED", +} + +// EntityManagementStringOperator - Enum defining the supported string operators. +type EntityManagementStringOperator string + +var EntityManagementStringOperatorTypes = struct { + // String contains the specified value. + CONTAINS EntityManagementStringOperator + // String are exactly equal. + EXACTLY EntityManagementStringOperator + // String start with the specified value. + PREFIX EntityManagementStringOperator +}{ + // String contains the specified value. + CONTAINS: "CONTAINS", + // String are exactly equal. + EXACTLY: "EXACTLY", + // String start with the specified value. + PREFIX: "PREFIX", +} + +// EntityManagementSyncConfigurationMode - Enum for the sync configuration mode +type EntityManagementSyncConfigurationMode string + +var EntityManagementSyncConfigurationModeTypes = struct { + // Sync all fields + ALL EntityManagementSyncConfigurationMode + // Sync only the messages + MESSAGES EntityManagementSyncConfigurationMode + // Sync only the WorkItem entity + WORKITEM EntityManagementSyncConfigurationMode +}{ + // Sync all fields + ALL: "ALL", + // Sync only the messages + MESSAGES: "MESSAGES", + // Sync only the WorkItem entity + WORKITEM: "WORKITEM", +} + +// EntityManagementSyncDirection - Represents a connection direction for the Sync Configuration +type EntityManagementSyncDirection string + +var EntityManagementSyncDirectionTypes = struct { + // Sync from the 3rd party system to New Relic only + INBOUND EntityManagementSyncDirection + // Sync from New Relic to the 3rd party system only + OUTBOUND EntityManagementSyncDirection +}{ + // Sync from the 3rd party system to New Relic only + INBOUND: "INBOUND", + // Sync from New Relic to the 3rd party system only + OUTBOUND: "OUTBOUND", +} + +// EntityManagementSyncGroupRuleConditionType - The types of conditions for group sync rules. +type EntityManagementSyncGroupRuleConditionType string + +var EntityManagementSyncGroupRuleConditionTypeTypes = struct { + // Group name contains. + CONTAINS EntityManagementSyncGroupRuleConditionType + // Group name ends with. + ENDS_WITH EntityManagementSyncGroupRuleConditionType + // Group name starts with. + STARTS_WITH EntityManagementSyncGroupRuleConditionType +}{ + // Group name contains. + CONTAINS: "CONTAINS", + // Group name ends with. + ENDS_WITH: "ENDS_WITH", + // Group name starts with. + STARTS_WITH: "STARTS_WITH", +} + +// EntityManagementTeamExternalIntegrationType - Possible types for the External Integration. +type EntityManagementTeamExternalIntegrationType string + +var EntityManagementTeamExternalIntegrationTypeTypes = struct { + // GitHub Team Integration. + GITHUB_TEAM EntityManagementTeamExternalIntegrationType + // IAM Group Integration. + IAM_GROUP EntityManagementTeamExternalIntegrationType + // ServiceNow Team Integration. + SERVICENOW_TEAM EntityManagementTeamExternalIntegrationType +}{ + // GitHub Team Integration. + GITHUB_TEAM: "GITHUB_TEAM", + // IAM Group Integration. + IAM_GROUP: "IAM_GROUP", + // ServiceNow Team Integration. + SERVICENOW_TEAM: "SERVICENOW_TEAM", +} + +// EntityManagementTextSplitterType - The text splitter enum +type EntityManagementTextSplitterType string + +var EntityManagementTextSplitterTypeTypes = struct { + // For character splitter + CHARACTER_TEXT_SPLITTER EntityManagementTextSplitterType + // For markdown content splitting + MARKDOWN_TEXT_SPLITTER EntityManagementTextSplitterType + // For token text splitting + TOKEN_TEXT_SPLITTER EntityManagementTextSplitterType +}{ + // For character splitter + CHARACTER_TEXT_SPLITTER: "CHARACTER_TEXT_SPLITTER", + // For markdown content splitting + MARKDOWN_TEXT_SPLITTER: "MARKDOWN_TEXT_SPLITTER", + // For token text splitting + TOKEN_TEXT_SPLITTER: "TOKEN_TEXT_SPLITTER", +} + +// EntityManagementThresholdScope - Scope for threshold configuration +type EntityManagementThresholdScope string + +var EntityManagementThresholdScopeTypes = struct { + // Account scope + ACCOUNT EntityManagementThresholdScope + // Entity scope + ENTITY EntityManagementThresholdScope + // Organization scope + ORGANIZATION EntityManagementThresholdScope +}{ + // Account scope + ACCOUNT: "ACCOUNT", + // Entity scope + ENTITY: "ENTITY", + // Organization scope + ORGANIZATION: "ORGANIZATION", +} + +// EntityManagementWorkItemCategory - Enum for Category in Work Item V2 +type EntityManagementWorkItemCategory string + +var EntityManagementWorkItemCategoryTypes = struct { + // Incident category of the work item + INCIDENT EntityManagementWorkItemCategory + // Issue category of the work item + ISSUE EntityManagementWorkItemCategory + // Performance category of the work item + PERFORMANCE EntityManagementWorkItemCategory + // Vulnerability category of the work item + VULNERABILITY EntityManagementWorkItemCategory +}{ + // Incident category of the work item + INCIDENT: "INCIDENT", + // Issue category of the work item + ISSUE: "ISSUE", + // Performance category of the work item + PERFORMANCE: "PERFORMANCE", + // Vulnerability category of the work item + VULNERABILITY: "VULNERABILITY", +} + +// EntityManagementWorkItemPriority - Enum for priority in Work Item V2 +type EntityManagementWorkItemPriority string + +var EntityManagementWorkItemPriorityTypes = struct { + // High priority of the work item + HIGH EntityManagementWorkItemPriority + // Highest priority of the work item + HIGHEST EntityManagementWorkItemPriority + // Low priority of the work item + LOW EntityManagementWorkItemPriority + // Lowest priority of the work item + LOWEST EntityManagementWorkItemPriority + // Medium priority of the work item + MEDIUM EntityManagementWorkItemPriority +}{ + // High priority of the work item + HIGH: "HIGH", + // Highest priority of the work item + HIGHEST: "HIGHEST", + // Low priority of the work item + LOW: "LOW", + // Lowest priority of the work item + LOWEST: "LOWEST", + // Medium priority of the work item + MEDIUM: "MEDIUM", +} + +// EntityManagementAPICatalogAPIContract - Interface for Api Contract entities +type EntityManagementAPICatalogAPIContract struct { + // The name of the Api Contract + Name string `json:"name"` +} + +func (x *EntityManagementAPICatalogAPIContract) ImplementsEntityManagementAPICatalogAPIContract() {} + +// EntityManagementAPISpecificationBlobEntity - Entity of type Spec Blob. +type EntityManagementAPISpecificationBlobEntity struct { + // The blob containing the Api specification content. + Blob EntityManagementBlob `json:"blob"` + // Description of the specification content. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the specification file. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementAPISpecificationBlobEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementActor - Represents an actor. +type EntityManagementActor struct { + // Id of the actor. + ID string `json:"id"` +} + +func (x *EntityManagementActor) ImplementsEntityManagementActor() {} + +// EntityManagementAdditionalParameter - Key-value pair for additional configuration +type EntityManagementAdditionalParameter struct { + // Parameter name + Key string `json:"key,omitempty"` + // Parameter value + Value string `json:"value,omitempty"` +} + +// EntityManagementAgentConfigurationEntity - A configuration that can contain multiple immutable versions and can be deployed to a fleet +type EntityManagementAgentConfigurationEntity struct { + // The agentType + AgentType string `json:"agentType"` + // Configuration type + ConfigurationType string `json:"configurationType,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // The managedEntityType this configuration is intended to be deployed to + ManagedEntityType EntityManagementManagedEntityType `json:"managedEntityType,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the configuration + Name string `json:"name"` + // The operating system of the managed entity this configuration is intended to be deployed to + OperatingSystem EntityManagementOperatingSystem `json:"operatingSystem,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // The total number of versions that have been created for this configuration + VersionCount int `json:"versionCount,omitempty"` +} + +func (x *EntityManagementAgentConfigurationEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAgentConfigurationVersionEntity - A version of an agent configuration +type EntityManagementAgentConfigurationVersionEntity struct { + // EntityGuid of the parent AgentConfiguration object + AgentConfiguration string `json:"agentConfiguration"` + // Metadata about the configuration blob + Blob EntityManagementBlob `json:"blob,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // Monotonically increasing version number + Version int `json:"version"` +} + +func (x *EntityManagementAgentConfigurationVersionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAgentDeployment - A set of configurations that are currently deployed +type EntityManagementAgentDeployment struct { + // Deployment finish + CompletedAt *nrtime.EpochMilliseconds `json:"completedAt,omitempty"` + // Fleet Id + Fleet string `json:"fleet,omitempty"` + // Deployment Id + ID string `json:"id,omitempty"` + // Managed Entity Id + ManagedEntity string `json:"managedEntity,omitempty"` + // Deployment started + StartedAt *nrtime.EpochMilliseconds `json:"startedAt,omitempty"` + // Deployment status + Status string `json:"status,omitempty"` +} + +// EntityManagementAgentEffectiveConfigurationEntity - The configuration that is actively being used to configure an agent +type EntityManagementAgentEffectiveConfigurationEntity struct { + // Metadata about the effective configuration blob + Blob EntityManagementBlob `json:"blob"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementAgentEffectiveConfigurationEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAgentEntity - A software component that collects or processes telemetry +type EntityManagementAgentEntity struct { + // The agentType + AgentType string `json:"agentType"` + // Properties specific to fleet control + FleetControlProperties EntityManagementFleetControlProperties `json:"fleetControlProperties"` + // The entity's global unique identifier. + ID string `json:"id"` + // The infrastructure managers related to the agent + InfrastructureManagers []EntityManagementInfrastructureManager `json:"infrastructureManagers,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // Version of the agent + Version string `json:"version,omitempty"` +} + +func (x *EntityManagementAgentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAgentToDeploy - Agent to deploy in a fleet deployment +type EntityManagementAgentToDeploy struct { + // Agent type + AgentType string `json:"agentType"` + // Configuration version list for this agent + ConfigurationVersionList []EntityManagementDeploymentAgentConfigurationVersion `json:"configurationVersionList"` + // Agent version + Version string `json:"version"` +} + +// EntityManagementAiAgentEntity - Agent configuration for agentic-platform +type EntityManagementAiAgentEntity struct { + // list of worker agents available to the planner agent in a multi-agent setup, ignore this for a single agent setup + Agents []EntityManagementEntityInterface `json:"agents"` + // agent category, to identify different agents supported by the platform in both single and multi-agent setups + Category string `json:"category"` + // short description of the agent, important for the discoverability of the agent in a group chat, so make it clear and concise. + Description string `json:"description"` + // display name for the agent + DisplayName string `json:"displayName,omitempty"` + // entity's global identifier + ID string `json:"id"` + // flag to be set to true once agent validation is complete and is ready for use. + Initialized bool `json:"initialized,omitempty"` + // llm configuration for the agent which includes exact LLM name and temperature settings + LlmConfig EntityManagementLlmConfig `json:"llmConfig,omitempty"` + // list of MCP server entities to be attached to the agent, each MCP server entity allows you to include/exclude a subset of tools + McpServers []EntityManagementAiAgentMcpServerConfig `json:"mcpServers"` + // agent metadata + Metadata EntityManagementMetadata `json:"metadata"` + // unique name of the agent entity + Name string `json:"name"` + // system instructions for the agent, this guides the behaviour of the llm, so make it elaborate but avoid noise. + Prompt string `json:"prompt"` + // creator of the agent entity, will help to distinguish extrernal agents from NR owned agents + Provider EntityManagementProvider `json:"provider,omitempty"` + // entity scope + Scope EntityManagementScopedReference `json:"scope"` + // collection of tags + Tags []EntityManagementTag `json:"tags"` + // test flag (true in case entity is experimental, default is true) + Test bool `json:"test,omitempty"` + // list of tool entities to attach to the agent + Tools []EntityManagementAiAgentToolConfig `json:"tools"` + // entity type + Type string `json:"type"` +} + +func (x *EntityManagementAiAgentEntity) ImplementsEntityManagementEntity() {} + +// special +func (x *EntityManagementAiAgentEntity) UnmarshalJSON(b []byte) error { + var objMap map[string]*json.RawMessage + err := json.Unmarshal(b, &objMap) + if err != nil { + return err + } + + for k, v := range objMap { + if v == nil { + continue + } + + switch k { + case "agents": + if v == nil { + continue + } + var rawMessageAgents []*json.RawMessage + err = json.Unmarshal(*v, &rawMessageAgents) + if err != nil { + return err + } + + for _, m := range rawMessageAgents { + xxx, err := UnmarshalEntityManagementEntityInterface(*m) + if err != nil { + return err + } + + if xxx != nil { + x.Agents = append(x.Agents, *xxx) + } + } + case "category": + err = json.Unmarshal(*v, &x.Category) + if err != nil { + return err + } + case "description": + err = json.Unmarshal(*v, &x.Description) + if err != nil { + return err + } + case "displayName": + err = json.Unmarshal(*v, &x.DisplayName) + if err != nil { + return err + } + case "id": + err = json.Unmarshal(*v, &x.ID) + if err != nil { + return err + } + case "initialized": + err = json.Unmarshal(*v, &x.Initialized) + if err != nil { + return err + } + case "llmConfig": + err = json.Unmarshal(*v, &x.LlmConfig) + if err != nil { + return err + } + case "mcpServers": + err = json.Unmarshal(*v, &x.McpServers) + if err != nil { + return err + } + case "metadata": + err = json.Unmarshal(*v, &x.Metadata) + if err != nil { + return err + } + case "name": + err = json.Unmarshal(*v, &x.Name) + if err != nil { + return err + } + case "prompt": + err = json.Unmarshal(*v, &x.Prompt) + if err != nil { + return err + } + case "provider": + err = json.Unmarshal(*v, &x.Provider) + if err != nil { + return err + } + case "scope": + err = json.Unmarshal(*v, &x.Scope) + if err != nil { + return err + } + case "tags": + err = json.Unmarshal(*v, &x.Tags) + if err != nil { + return err + } + case "test": + err = json.Unmarshal(*v, &x.Test) + if err != nil { + return err + } + case "tools": + err = json.Unmarshal(*v, &x.Tools) + if err != nil { + return err + } + case "type": + err = json.Unmarshal(*v, &x.Type) + if err != nil { + return err + } + } + } + + return nil +} + +// EntityManagementAiAgentMcpServerConfig - Configuring specific tools from an MCP server for an agent's use +type EntityManagementAiAgentMcpServerConfig struct { + // list of specific tools to exclude from this MCP server + ExcludeTools []string `json:"excludeTools"` + // list of specific tools to include from this MCP server (default is empty list, which means all tools from the MCP server will be included) + IncludeTools []string `json:"includeTools"` + // reference to the MCP server entity + Server EntityManagementMcpServerEntity `json:"server"` +} + +// EntityManagementAiAgentToolConfig - Deprecated: Configuration for an agent's use of a specific MCP server/tool +type EntityManagementAiAgentToolConfig struct { + // list of specific tools to exclude from this MCP server + ExcludeTools []string `json:"excludeTools"` + // list of specific tools to include from this MCP server + IncludeTools []string `json:"includeTools"` + // reference to the MCP server/tool entity + Tool EntityManagementAiToolEntity `json:"tool"` +} + +// EntityManagementAiCapableEntity - AI Capable Library for AI Inventory Catalog +type EntityManagementAiCapableEntity struct { + // Category of the tool/library + Category string `json:"category"` + // The entity's global unique identifier. + ID string `json:"id"` + // Language of the ai tool/library + Language string `json:"language"` + // Last seen timestamp: A date and time as an ISO8601 formatted string. + LastSeen nrtime.DateTime `json:"lastSeen"` + // Entity metadata + Metadata EntityManagementMetadata `json:"metadata"` + // Unique name of the agent entity + Name string `json:"name"` + // Entity scope + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags + Tags []EntityManagementTag `json:"tags"` + // Type of the tool. Eg: library or usage + ToolType string `json:"toolType"` + // Version of the ai tool/library + ToolVersion string `json:"toolVersion"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementAiCapableEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAiEvaluationConfigEntity - Experimental feature for ai evaluation configuration +type EntityManagementAiEvaluationConfigEntity struct { + // The entity description. + Description string `json:"description,omitempty"` + // Enable or disable Evaluations for all the entities under the scope + Enabled bool `json:"enabled,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Reference to the ManagedEvaluationsEntity containing the evaluation configurations to be applied + ManagedEvaluationsEntity EntityManagementManagedEvaluationsEntity `json:"managedEvaluationsEntity,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the evaluation. + Name string `json:"name"` + // Defines the fraction of incoming messages to be evaluated. Value ranges from 0.0 (none) to 1.0 (all). + SamplingRate float64 `json:"samplingRate,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementAiEvaluationConfigEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAiToolEntity - Tool configuration for agentic-platform +type EntityManagementAiToolEntity struct { + // short description of the tool, useful for tool discovery by an agent + Description string `json:"description"` + // entity's unique global indentifier + ID string `json:"id"` + // flag to be set to true once agent validation is complete and is ready for use. + Initialized bool `json:"initialized,omitempty"` + // tool metadata + Metadata EntityManagementMetadata `json:"metadata"` + // unique name of the tool + Name string `json:"name"` + // tool parameters to be passed for each tool + Parameters []EntityManagementAiToolParameter `json:"parameters"` + // creator of the agent entity, will help to distinguish extrernal agents from NR owned agents + Provider EntityManagementProvider `json:"provider,omitempty"` + // entity scope + Scope EntityManagementScopedReference `json:"scope"` + // collection of tags + Tags []EntityManagementTag `json:"tags"` + // test flag (true in case entity is experimental, default is true) + Test bool `json:"test,omitempty"` + // type of tool from a list of first class citizen tools + ToolType EntityManagementAiToolType `json:"toolType,omitempty"` + // entity type + Type string `json:"type"` + // It is primarily a nerdgraph query in single line format + URL string `json:"url"` +} + +func (x *EntityManagementAiToolEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAiToolParameter - Tool parameters to be passed to ToolEntity +type EntityManagementAiToolParameter struct { + // description of the parameter - important for the discovery of parameter by llm + Description string `json:"description"` + // name of the tool parameter + Name string `json:"name"` + // type of the parameter indicating its data-type + Type EntityManagementAiToolParameterType `json:"type"` +} + +// EntityManagementArrayCondition - Array condition type. +type EntityManagementArrayCondition struct { + // Array condition type operator. + Operator EntityManagementArrayOperator `json:"operator"` +} + +// EntityManagementAttribute - Attributes to represent thresholds +type EntityManagementAttribute struct { + // Key for the attribute, e.g., 'queryCountThreshold', 'queryDurationThresholdMs' + Key string `json:"key"` + // It generates the current timestamp in milliseconds + LastUpdatedAt *nrtime.EpochMilliseconds `json:"lastUpdatedAt,omitempty"` + // It represents the userId of the user who has edited this + LastUpdatedBy EntityManagementPrincipal `json:"lastUpdatedBy,omitempty"` + // Value for the attribute, e.g., '1000', '5000'. The value can be a string representation of a number or any other type as needed. + Value string `json:"value"` +} + +// EntityManagementAwsAssumeRoleConfig - Configuration for accessing an Aws account via AssumeRole +type EntityManagementAwsAssumeRoleConfig struct { + // External ID to use when assuming the role + ExternalId EntityManagementDynamicString `json:"externalId,omitempty"` + // The ARN of the role to assume + RoleArn string `json:"roleArn"` +} + +// EntityManagementAwsAssumeRoleConfigCreateInput - Create input for AwsAssumeRoleConfig. +type EntityManagementAwsAssumeRoleConfigCreateInput struct { + // See roleArn in AwsAssumeRoleConfig. + RoleArn string `json:"roleArn"` +} + +// EntityManagementAwsConnectionEntity - Connection entity type for Aws +type EntityManagementAwsConnectionEntity struct { + // A single credential from the choice of AwsCredential + Credential EntityManagementAwsCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // Default region for this connection + Region string `json:"region,omitempty"` + // The entity’s scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity’s type. + Type string `json:"type"` +} + +func (x *EntityManagementAwsConnectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAwsConnectionEntityCreateInput - Create input for AwsConnectionEntity entity type. +type EntityManagementAwsConnectionEntityCreateInput struct { + // See credential in AwsConnectionEntity. + Credential EntityManagementAwsCredentialsCreateInput `json:"credential,omitempty"` + // See description in AwsConnectionEntity. + Description string `json:"description,omitempty"` + // See enabled in AwsConnectionEntity. + Enabled bool `json:"enabled,omitempty"` + // See externalId in AwsConnectionEntity. + ExternalId string `json:"externalId,omitempty"` + // See name in AwsConnectionEntity. + Name string `json:"name"` + // See region in AwsConnectionEntity. + Region string `json:"region,omitempty"` + // See scope in AwsConnectionEntity. + Scope EntityManagementScopedReferenceInput `json:"scope,omitempty"` + // See settings in AwsConnectionEntity. + Settings []EntityManagementConnectionSettingsCreateInput `json:"settings,omitempty"` + // See tags in AwsConnectionEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementAwsConnectionEntityCreateResult - The result of creating an entity. +type EntityManagementAwsConnectionEntityCreateResult struct { + // The created entity. + Entity EntityManagementAwsConnectionEntity `json:"entity"` +} + +// EntityManagementAwsCredentials - Base Credential type for Aws +type EntityManagementAwsCredentials struct { + // AssumeRole type + AssumeRole EntityManagementAwsAssumeRoleConfig `json:"assumeRole,omitempty"` +} + +// EntityManagementAwsCredentialsCreateInput - Create input for AwsCredentials. +type EntityManagementAwsCredentialsCreateInput struct { + // See assumeRole in AwsCredentials. + AssumeRole EntityManagementAwsAssumeRoleConfigCreateInput `json:"assumeRole,omitempty"` +} + +// EntityManagementBackgroundProcessingQuery - At rest background processing types +type EntityManagementBackgroundProcessingQuery struct { + // The list of scopes to be included in every query in a scheduled batch of cross account queries. + JoinScopes []EntityManagementScopedReference `json:"joinScopes"` + // The NRQL string used to specify the action you want to take and data you want to take the specified action on. + NRQL nrdb.NRQL `json:"nrql"` + // The scope for the output, if applicable. If the value is null, the entity scope is used as output. + OutputScope EntityManagementScopedReference `json:"outputScope,omitempty"` + // The list of scopes to be queried, allowing a scheduled batch of cross account queries. If this value is null, the original entity scope will be used. + Scopes []EntityManagementScopedReference `json:"scopes"` +} + +// EntityManagementBackgroundProcessingRuleEntity - At rest background processing types +type EntityManagementBackgroundProcessingRuleEntity struct { + // Entity description. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The account and NRQL query definition for the rule + Query EntityManagementBackgroundProcessingQuery `json:"query"` + // Classification of the query type. This field is primarily for filtering + RuleType EntityManagementBackgroundProcessingType `json:"ruleType,omitempty"` + // The cronExpression to run the scheduled query. Minute step values, ranges and lists are not permitted. + Schedule EntityManagementSchedule `json:"schedule,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Describes the asynchronous at-rest process state to communicate through the API what is happening + State EntityManagementProcessState `json:"state,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementBackgroundProcessingRuleEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementBackgroundProcessingSqlQuery - At rest background processing types +type EntityManagementBackgroundProcessingSqlQuery struct { + // The scope for the output, if applicable. If the value is null, the entity scope is used as output. + OutputScope EntityManagementScopedReference `json:"outputScope,omitempty"` + // The target of the SQL query results, indicating the destination where the SQL results will be sent. + OutputTarget string `json:"outputTarget"` + // The list of scopes to be queried, allowing cross account queries. If this value is null, the original entity scope will be used. + Scopes []EntityManagementScopedReference `json:"scopes"` + // The SQL string used to specify the action you want to take and data you want to take the specified action on. + Sql string `json:"sql"` +} + +// EntityManagementBackgroundSqlProcessingRuleEntity - At rest background sql processing types +type EntityManagementBackgroundSqlProcessingRuleEntity struct { + // Entity description. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The account and SQL query definition for the rule + Query EntityManagementBackgroundProcessingSqlQuery `json:"query"` + // The cronExpression to run the scheduled query. Minute step values, ranges and lists are not permitted. + Schedule EntityManagementSchedule `json:"schedule,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Describes the asynchronous at-rest process state to communicate through the API what is happening + State EntityManagementProcessState `json:"state,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementBackgroundSqlProcessingRuleEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementBlob - Metadata about a blob stored in the Blob Datastore. +type EntityManagementBlob struct { + // Object that holds the details of the blob signature + BlobSignature EntityManagementBlobSignature `json:"blobSignature,omitempty"` + // Object that holds the details of the blob signature + BlobSignatures []EntityManagementBlobSignature `json:"blobSignatures,omitempty"` + // The checksum of the blob content + Checksum string `json:"checksum,omitempty"` + // The checksum algorithm used to calculate the checksum of the blob content + ChecksumAlgorithm string `json:"checksumAlgorithm,omitempty"` + // The content type of the blob + ContentType string `json:"contentType"` + // The blob identifier. Can be used to download the blob data from the Blob API + ID string `json:"id"` +} + +// EntityManagementBlobSignature - A set of configurations for blob signature +type EntityManagementBlobSignature struct { + // Boolean flag to show if a blob has security findings + SecurityFindings bool `json:"securityFindings,omitempty"` + // Signature details + Signature EntityManagementSignatureDetails `json:"signature"` + // Error encountered during signature creation + SignatureError []string `json:"signatureError"` + // Errors encountered during signature creation + SignatureErrors []string `json:"signatureErrors"` + // Signature of the blob + Signatures []EntityManagementSignatureDetails `json:"signatures"` + // Error encountered during validation + ValidationError []string `json:"validationError"` +} + +// EntityManagementBudgetAccount - Represents an account. +type EntityManagementBudgetAccount struct { + // The unique identifier of the account. + ID int `json:"id"` +} + +// EntityManagementBudgetAlertPolicy - Represents an alert policy for the budget +type EntityManagementBudgetAlertPolicy struct { + // The unique identifier of the alert policy. + ID string `json:"id"` +} + +// EntityManagementBudgetCustomer - Represents a customer. +type EntityManagementBudgetCustomer struct { + // The unique identifier of the customer. + ID string `json:"id"` +} + +// EntityManagementBudgetEntity - Represents a New Relic Budget entity. +type EntityManagementBudgetEntity struct { + // A list of alert policies associated with this budget. + BudgetAlertPolicies []EntityManagementBudgetAlertPolicy `json:"budgetAlertPolicies,omitempty"` + // A list of limits defined for this budget. + BudgetLimits []EntityManagementBudgetLimit `json:"budgetLimits,omitempty"` + // The segment being tracked by the budget. + BudgetSegment EntityManagementBudgetSegment `json:"budgetSegment,omitempty"` + // Budget Type as Ingest or compute + BudgetType EntityManagementBudgetType `json:"budgetType,omitempty"` + // The globally unique identifier of the entity. + ID string `json:"id"` + // Metadata associated with the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the entity. + Name string `json:"name"` + // True if it’s an org level budget, False otherwise. + OrganizationBudget bool `json:"organizationBudget,omitempty"` + // The scope of the entity. + Scope EntityManagementScopedReference `json:"scope"` + // A collection of tags associated with the entity. + Tags []EntityManagementTag `json:"tags"` + // The type of the entity. + Type string `json:"type"` +} + +func (x *EntityManagementBudgetEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementBudgetLimit - Represents a budget limit. +type EntityManagementBudgetLimit struct { + // The consumption metric associated with the budget limit. + ConsumptionMetric EntityManagementConsumptionMetric `json:"consumptionMetric,omitempty"` + // Reference to where the complete budget limit definition is stored. The Budget Entity acts as an index/tracking system while the actual limit configuration data lives in the Limits Platform. + Reference EntityManagementReference `json:"reference,omitempty"` + // The value of the limit for the specified consumption metric. + Value int `json:"value,omitempty"` +} + +// EntityManagementBudgetOrganization - Represents an organization. +type EntityManagementBudgetOrganization struct { + // The unique identifier of the organization. + ID string `json:"id"` +} + +// EntityManagementBudgetSegment - The segment being tracked by the budget. +type EntityManagementBudgetSegment struct { + // Array of account IDs associated with the budget segment. + Accounts []EntityManagementBudgetAccount `json:"accounts,omitempty"` + // Customer Contract ID. + Customer EntityManagementBudgetCustomer `json:"customer,omitempty"` + // Array of organization IDs in a multi-tenant structure. + Organizations []EntityManagementBudgetOrganization `json:"organizations,omitempty"` + // Object containing user limit configuration. + Users EntityManagementUsers `json:"users,omitempty"` +} + +// EntityManagementBudgetUser - Represents a user whose resource consumption limits are managed by the budget. +type EntityManagementBudgetUser struct { + // The unique identifier of the user (userID). + ID int `json:"id"` +} + +// EntityManagementCategoryScope - Scope for category subtype +type EntityManagementCategoryScope struct { + // id based on scope + ID string `json:"id"` + // type of scope + Type EntityManagementCategoryScopeType `json:"type"` +} + +// EntityManagementCharacterTextSplitterOptions - The CharacterTextSplitter options +type EntityManagementCharacterTextSplitterOptions struct { + // Is the separator a regex + IsSeparatorRegex bool `json:"isSeparatorRegex"` + // Character to split text on + Separator string `json:"separator"` +} + +// EntityManagementCiscoMerakiBasicAuthCredential - Basic auth credential type for Cisco Meraki +type EntityManagementCiscoMerakiBasicAuthCredential struct { + // The API key to authorize API access + APIKey EntityManagementSecretReference `json:"apiKey"` +} + +// EntityManagementCiscoMerakiConnectionEntity - Connection entity type for Cisco Meraki +type EntityManagementCiscoMerakiConnectionEntity struct { + // A single credential for Cisco Meraki + Credential EntityManagementCiscoMerakiCredential `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The Cisco Meraki region (e.g., India, China, Canada) + Region string `json:"region"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` +} + +func (x *EntityManagementCiscoMerakiConnectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCiscoMerakiCredential - Credential type for Cisco Meraki +type EntityManagementCiscoMerakiCredential struct { + // A simple API key-based authentication + BasicAuth EntityManagementCiscoMerakiBasicAuthCredential `json:"basicAuth,omitempty"` +} + +// EntityManagementCollectionEntity - An entity type to represent collections of entities +type EntityManagementCollectionEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCollectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCommunicationLog - CommunicationLog represents the communication information for an incident. This includes communication details as well as the impact information for that incident. +type EntityManagementCommunicationLog struct { + // The message communicated by. + CommunicatedBy string `json:"communicatedBy"` + // Mode of the communication happened. + CommunicationMode []EntityManagementCommunicationMode `json:"communicationMode"` + // The communication status. + CommunicationStatus EntityManagementCommunicationStatus `json:"communicationStatus"` + // Represents the customer impact of the incident. + Impact []EntityManagementCustomerImpactEntity `json:"impact"` + // The content of the communication log. + Message string `json:"message,omitempty"` + // The timestamp of the communication log. + Timestamp *nrtime.EpochMilliseconds `json:"timestamp,omitempty"` +} + +// EntityManagementComponentEntity - An entity representing the component or the product available to create impact for an incident. +type EntityManagementComponentEntity struct { + // The component description. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Name for the component. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementComponentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementComputeLocationEntity - An entity representing a compute location for serverless job execution +type EntityManagementComputeLocationEntity struct { + // Description for the ComputeLocation + Description string `json:"description"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the ComputeLocation, can be utilized for workload querying. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementComputeLocationEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementConfig - Collection of attributes to represent thresholds of a type +type EntityManagementConfig struct { + // The list of attributes that define the thresholds for this config. + Attributes []EntityManagementAttribute `json:"attributes"` + // The name of the analyzer for which this config is applicable. + Name string `json:"name"` +} + +// EntityManagementConfiguration - Metadata about the configuration and the configuration blob itself +type EntityManagementConfiguration struct { + // The raw configuration blob supplied by the system + Blob EntityManagementBlob `json:"blob"` + // The ID of the source system entity for the configuration + Source string `json:"source,omitempty"` + // The last time the configuration was updated + UpdatedAt *nrtime.EpochMilliseconds `json:"updatedAt,omitempty"` + // Who or what last updated the configuration + UpdatedBy string `json:"updatedBy,omitempty"` +} + +// EntityManagementConfluenceBasicAuthCredential - Basic auth credential type for Confluence +type EntityManagementConfluenceBasicAuthCredential struct { + // The confluence domain (e.g., your-domain.atlassian.net) + Domain string `json:"domain"` + // The Confluence API token to authorize the API operations + Token EntityManagementSecretReference `json:"token"` + // API token expiration time + TokenExpirationTime *nrtime.EpochMilliseconds `json:"tokenExpirationTime,omitempty"` + // The Confluence user ID (the Atlassian account email) associated with the API token. + UserID EntityManagementSecretReference `json:"userId"` +} + +// EntityManagementConfluenceConnectionEntity - Connection entity type for Confluence +type EntityManagementConfluenceConnectionEntity struct { + // A single credential from the choice of ConfluenceCredential + Credential EntityManagementConfluenceCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. False by default. + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` +} + +func (x *EntityManagementConfluenceConnectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementConfluenceCredentials - Base credentials type for Confluence +type EntityManagementConfluenceCredentials struct { + // A simple basic auth credential + BasicAuth EntityManagementConfluenceBasicAuthCredential `json:"basicAuth,omitempty"` +} + +// EntityManagementConfluenceIntegration - Bare essentials for any integration with confluence +type EntityManagementConfluenceIntegration struct { + // The confluence user ID associated with this integration. + ConfluenceUserId string `json:"confluenceUserId"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the Confluence Rag Settings. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The secret key referencing confluence credentials in secret store. + SecretKey string `json:"secretKey"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // The confluence domain. + URL string `json:"url"` +} + +func (x *EntityManagementConfluenceIntegration) ImplementsEntityManagementEntity() {} + +// EntityManagementConfluenceRagSettingsEntity - Confluence Rag Settings +type EntityManagementConfluenceRagSettingsEntity struct { + // The options for character text splitter + CharacterTextSplitterOptions EntityManagementCharacterTextSplitterOptions `json:"characterTextSplitterOptions,omitempty"` + // The chunk overlap for chunking documents + ChunkOverlap int `json:"chunkOverlap,omitempty"` + // The chunk size for chunking documents + ChunkSize int `json:"chunkSize,omitempty"` + // The ID of the confluence integration entity + ConfluenceIntegrationId string `json:"confluenceIntegrationId"` + // The CQL query for selecting documents to index. + ConfluenceQuery string `json:"confluenceQuery"` + // The entity's global unique identifier. + ID string `json:"id"` + // The interval, in seconds, for how often documents are synced. + IntervalSeconds int `json:"intervalSeconds"` + // The timestamp when the connector was last run. + LastPullTime *nrtime.EpochMilliseconds `json:"lastPullTime,omitempty"` + // The options when using the markdown text splitter + MarkdownTextSplitterOptions EntityManagementMarkdownTextSplitterOptions `json:"markdownTextSplitterOptions,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the Confluence Rag Settings. + Name string `json:"name"` + // The timestamp for the connector's next scheduled run. + NextPullTime *nrtime.EpochMilliseconds `json:"nextPullTime,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The text splitter to be used + TextSplitterType EntityManagementTextSplitterType `json:"textSplitterType,omitempty"` + // The options when using a token text splitter + TokenTextSplitterOptions EntityManagementTokenTextSplitterOptions `json:"tokenTextSplitterOptions,omitempty"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementConfluenceRagSettingsEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementConnectionSettings - Connection settings type for all connections +type EntityManagementConnectionSettings struct { + // The key or name of the setting + Key string `json:"key"` + // The value of the setting. + Value string `json:"value"` +} + +// EntityManagementConnectionSettingsCreateInput - Create input for ConnectionSettings. +type EntityManagementConnectionSettingsCreateInput struct { + // See key in ConnectionSettings. + Key string `json:"key"` + // See value in ConnectionSettings. + Value string `json:"value"` +} + +// EntityManagementCorrelationAttribute - A configuration attribute for probabilistic matching. +type EntityManagementCorrelationAttribute struct { + // Attribute name. + Name string `json:"name"` + // Attribute value. + Value string `json:"value"` +} + +// EntityManagementCorrelationAttributeCondition - Defines an attribute matching condition between subjects. +type EntityManagementCorrelationAttributeCondition struct { + // The attribute path to match (e.g., 'tags.hostname'). + Attribute string `json:"attribute"` + // The matching operator. + Operator EntityManagementCorrelationAttributeConditionOperator `json:"operator"` + // The value to match against. + Value string `json:"value"` +} + +// EntityManagementCorrelationContext - Context metadata about a correlation link. +type EntityManagementCorrelationContext struct { + // Confidence score (0.0 to 1.0) if probabilistic matching was used. + Confidence float64 `json:"confidence"` + // Additional informational messages about the correlation. + Messages []string `json:"messages"` + // The GUID of the CorrelationLinkingRule that created this link. + RuleId string `json:"ruleId"` +} + +// EntityManagementCorrelationInternalSourceConfigEntity - CorrelationInternalSourceConfig persists the configuration required to provision +// DAQS filters, separating the ingestion mechanism from the correlation logic. +// This entity is internal only. +type EntityManagementCorrelationInternalSourceConfigEntity struct { + // Account ID of the Rule Filter. + AccountID int `json:"accountId"` + // Alias for this subject used in criteria and linking configuration. + Alias string `json:"alias"` + // The internal ID used by the DAQS filtering system. + FilterId int `json:"filterId"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The NRQL query used to filter the stream. + NRQL nrdb.NRQL `json:"nrql"` + // The name of this internal source configuration. + Name string `json:"name"` + // List of namespaces applicable to this filter. + Namespaces []string `json:"namespaces"` + // The Kafka topic where filtered data should be published. + OutputTopic string `json:"outputTopic"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The data source identifier (e.g., ai-external-incident). + Source string `json:"source"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCorrelationInternalSourceConfigEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCorrelationLinkEntity - CorrelationLink represents a directional edge between two correlation subjects. +// When a CorrelationLinkingRule matches, it creates this relationship entity in NGEP. +// Note: The output is stored in NGEP as an entity and not a relationship, because +// the targets for the relationship need not be NGEP entities (can just be NRDB Events). +type EntityManagementCorrelationLinkEntity struct { + // Metadata about why this link exists. + Context EntityManagementCorrelationContext `json:"context,omitempty"` + // Indicates if the link is directional. + Directional bool `json:"directional,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // The relationship type (e.g., CAUSED_BY, RELATED_TO). + LinkType string `json:"linkType,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this correlation link. + Name string `json:"name"` + // Audit trail if a user manually modified/rejected this link. + OverrideInfo []EntityManagementCorrelationOverrideInfo `json:"overrideInfo"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The 'From' correlation subject. + Source EntityManagementCorrelationSubjectReference `json:"source"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The 'To' correlation subject. + Target EntityManagementCorrelationSubjectReference `json:"target"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCorrelationLinkEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCorrelationLinkingConfig - Defines the output configuration for correlation results. +type EntityManagementCorrelationLinkingConfig struct { + // Whether the link is directional (default: false). + Directional bool `json:"directional,omitempty"` + // The type of link/relationship to create (e.g., 'RELATED_TO', 'CAUSED_BY'). + LinkType string `json:"linkType"` + // Alias of the source subject (for directional links). + SourceAlias string `json:"sourceAlias,omitempty"` + // Alias of the target subject (for directional links). + TargetAlias string `json:"targetAlias,omitempty"` +} + +// EntityManagementCorrelationLinkingCriteria - Defines the matching criteria for correlation. +type EntityManagementCorrelationLinkingCriteria struct { + // Deterministic attribute matching rules. + AttributeConditions []EntityManagementCorrelationAttributeCondition `json:"attributeConditions"` + // Probabilistic/ML-based matching configuration. + Probabilistic EntityManagementCorrelationProbabilisticMatchingConfig `json:"probabilistic,omitempty"` + // Temporal window configuration for correlation. + TemporalWindow EntityManagementCorrelationWindowConfig `json:"temporalWindow,omitempty"` + // Topology proximity threshold for correlation. + TopologyProximity int `json:"topologyProximity,omitempty"` +} + +// EntityManagementCorrelationLinkingRuleEntity - CorrelationLinkingRule persists the logic required to drive the event correlation engine, +// defining which events (Drivers) trigger searches for other subjects (Candidates). +// Supports all standard CRUD operations including delete via the generic delete mutation. +type EntityManagementCorrelationLinkingRuleEntity struct { + // The criteria defining how to match driver and candidates. + Criteria EntityManagementCorrelationLinkingCriteria `json:"criteria"` + // Description of what this correlation rule does. + Description string `json:"description,omitempty"` + // Whether this correlation rule is currently enabled. Considered true by default + Enabled bool `json:"enabled,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // The output configuration defining the correlation result. + LinkingConfig EntityManagementCorrelationLinkingConfig `json:"linkingConfig"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this correlation rule. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Defines the Driver (trigger) and Candidates. + Subjects []EntityManagementCorrelationSubject `json:"subjects"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCorrelationLinkingRuleEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCorrelationOverrideInfo - User override information for a correlation link. +type EntityManagementCorrelationOverrideInfo struct { + // The action taken by the user. + Action EntityManagementCorrelationOverrideAction `json:"action"` + // Timestamp when the override was performed. + Timestamp *nrtime.EpochMilliseconds `json:"timestamp"` + // ID of the user who performed the override. + UserID string `json:"userId"` +} + +// EntityManagementCorrelationProbabilisticMatchingConfig - Configuration for probabilistic/ML-based matching. +type EntityManagementCorrelationProbabilisticMatchingConfig struct { + // The ML algorithm to use. + Algorithm EntityManagementCorrelationMatchingAlgorithm `json:"algorithm"` + // Confidence threshold (0.0 to 1.0) for accepting correlations. + ConfidenceThreshold float64 `json:"confidenceThreshold"` + // Additional configuration attributes for the algorithm. + Configs []EntityManagementCorrelationAttribute `json:"configs"` +} + +// EntityManagementCorrelationSubject - Defines a subject (event or entity) that participates in correlation. +type EntityManagementCorrelationSubject struct { + // List of account IDs to query for this subject. Account access is validated by the correlation service at runtime. + AccountIDs []int `json:"accountIds"` + // Alias for this subject used in criteria and linking configuration. + Alias string `json:"alias"` + // Lifecycle configuration for stateful subjects (optional). + Lifecycle EntityManagementCorrelationSubjectLifecycleConfig `json:"lifecycle,omitempty"` + // The NRQL query to select this subject. + NRQL nrdb.NRQL `json:"nrql"` + // The type of the subject (EVENT or ENTITY). + Type EntityManagementCorrelationSubjectType `json:"type"` +} + +// EntityManagementCorrelationSubjectLifecycleConfig - Defines the lifecycle management for stateful correlation subjects. +type EntityManagementCorrelationSubjectLifecycleConfig struct { + // Values indicating the subject is in a closed state. + ClosedValues []string `json:"closedValues"` + // Field name representing the unique identifier for the subject. + IdentityKey string `json:"identityKey"` + // Values indicating the subject is in an open state. + OpenValues []string `json:"openValues"` + // Field name representing the state of the subject. + StateKey string `json:"stateKey"` +} + +// EntityManagementCorrelationSubjectReference - Reference to a correlation subject (event or entity). +type EntityManagementCorrelationSubjectReference struct { + // The account where the event resides. + AccountID int `json:"accountId"` + // The unique identifier of the event. + EventId string `json:"eventId"` + // The event's type (e.g., NR_ISSUE). + EventType string `json:"eventType"` +} + +// EntityManagementCorrelationWindowConfig - Defines the temporal window for candidate discovery. +type EntityManagementCorrelationWindowConfig struct { + // Attribute name for driver end timestamp (optional). + DriverEndTimestampAttribute string `json:"driverEndTimestampAttribute,omitempty"` + // Attribute name for driver start timestamp (optional). + DriverStartTimestampAttribute string `json:"driverStartTimestampAttribute,omitempty"` + // Lookback duration in seconds from the driver event. + LookbackSeconds nrtime.Seconds `json:"lookbackSeconds"` + // Lookforward duration in seconds from the driver event. + LookforwardSeconds nrtime.Seconds `json:"lookforwardSeconds"` +} + +// EntityManagementCount - Represents the count. +type EntityManagementCount struct { + // Number of repositories associated with the integration. + RepoCount int `json:"repoCount,omitempty"` + // Number of teams associated with the integration. + TeamCount int `json:"teamCount,omitempty"` +} + +// EntityManagementCustomEvaluationEntity - Experimental feature for custom evaluations +type EntityManagementCustomEvaluationEntity struct { + // Evaluation criteria definition + Criteria string `json:"criteria,omitempty"` + // The entity description. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Model identifier to use for evaluation + Model string `json:"model,omitempty"` + // A unique user provided name for the evaluation. + Name string `json:"name"` + // Parameters required for the evaluation + Parameters []EntityManagementEvaluationParameter `json:"parameters"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Step-by-step evaluation instructions + Steps []string `json:"steps"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // Threshold value for passing the evaluation (0.0 to 1.0) + Threshold float64 `json:"threshold,omitempty"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCustomEvaluationEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCustomerImpactEntity - An entity representing customer impact information for an incident. It contains impact representing an incident. +type EntityManagementCustomerImpactEntity struct { + // Impact along with attributes + Blob EntityManagementBlob `json:"blob,omitempty"` + // Impacted Components per issue + Components []EntityManagementComponentEntity `json:"components"` + // The entity's global unique identifier. + ID string `json:"id"` + // Related issue id + IssueId string `json:"issueId,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the customer impact. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCustomerImpactEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementCustomerImpactQueryEntity - An entity representing customer impact queries information for an incident. +type EntityManagementCustomerImpactQueryEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // Impacted products. + Products []EntityManagementComponentEntity `json:"products"` + // Customer impact query to determine the impacted account ids. + Query string `json:"query"` + // Query account id required to execute the customer impact query. + QueryAccountId int `json:"queryAccountId"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // NRTeam responsible for the customer impact query. + TeamEntity EntityManagementTeamEntity `json:"teamEntity,omitempty"` + // @deprecated Use 'teamEntity' field instead + // Team name responsible for the customer impact query. + TeamName string `json:"teamName,omitempty"` + // Account IDs to be used with the total customer impact query. + TotalCustImpactQueryAccountIds []int `json:"totalCustImpactQueryAccountIds,omitempty"` + // Customer impact query to determine the total customer impact. + TotalCustomerImpactQuery string `json:"totalCustomerImpactQuery,omitempty"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementCustomerImpactQueryEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementDateCondition - Date condition type. +type EntityManagementDateCondition struct { + // End values for the IN_RANGE operator. + EndValue string `json:"endValue,omitempty"` + // Date condition type operator. + Operator EntityManagementDateOperator `json:"operator"` + // Start values for the IN_RANGE operator. + StartValue string `json:"startValue,omitempty"` + // Value for BEFORE and AFTER operators. + Value string `json:"value,omitempty"` +} + +// EntityManagementDeploymentAgentConfigurationVersion - Properties of a deployed configuration version +type EntityManagementDeploymentAgentConfigurationVersion struct { + // Configuration version ID + ID string `json:"id"` +} + +// EntityManagementDiscoverySettings - Discovery related settings. +type EntityManagementDiscoverySettings struct { + // If discovery is enabled for that organization or not. + Enabled bool `json:"enabled"` + // Tag keys used for discovery for the organization. + TagKeys []string `json:"tagKeys"` +} + +// EntityManagementEntity - The Entity interface. +type EntityManagementEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementEventBridgeCondition - Represents a single base condition comparing a field to a value. +type EntityManagementEventBridgeCondition struct { + // The JSON path to the field within the event payload to evaluate. + Field string `json:"field"` + // The matching logic for the field. + Value EntityManagementEventBridgeConditionValue `json:"value"` +} + +// EntityManagementEventBridgeConditionValue - A wrapper object that will contain exactly one of the possible condition types. +type EntityManagementEventBridgeConditionValue struct { + // Array condition type. + Array EntityManagementArrayCondition `json:"array,omitempty"` + // Date condition type. + Date EntityManagementDateCondition `json:"date,omitempty"` + // A simple check for the existence of a field. + Exists bool `json:"exists,omitempty"` + // Numeric condition type. + Numeric EntityManagementNumericCondition `json:"numeric,omitempty"` + // String condition type. + String EntityManagementStringCondition `json:"string,omitempty"` +} + +// EntityManagementEventBridgeRuleEntity - Event Bridge Rule entity type +type EntityManagementEventBridgeRuleEntity struct { + // A list of conditions. All conditions in this list must be true for the rule to match (logical AND). + Conditions []EntityManagementEventBridgeCondition `json:"conditions"` + // An optional, user-defined description for the bridge rule. + Description string `json:"description,omitempty"` + // Whether this rule is enabled or not. + Enabled bool `json:"enabled"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A user-defined name for the bridge rule. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Defines the origin of the event this rule applies to. It specifies both the high-level event source and the specific entity name within that source. + SourceType EntityManagementEventBridgeSourceType `json:"sourceType"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The list of target actions to execute when an event matches the filter. + Targets []EntityManagementEventBridgeTarget `json:"targets"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementEventBridgeRuleEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementEventBridgeSourceType - Defines the origin of an event. +type EntityManagementEventBridgeSourceType struct { + // The system from which the event originates. + Event EntityManagementEventBridgeEventSourceType `json:"event"` + // The specific name of the entity within the source system (e.g., 'WorkItem'). + Name string `json:"name"` +} + +// EntityManagementEventBridgeTarget - A target action to be executed when an event matches the rule. +type EntityManagementEventBridgeTarget struct { + // A user-defined name for this target action within the rule. + Name string `json:"name"` + // The specific parameters for this target. + Parameters EntityManagementEventBridgeTargetParameters `json:"parameters"` + // The type of action this target performs. For V1, only WORKFLOW is supported. + Type EntityManagementEventBridgeTargetType `json:"type"` + // An optional condition evaluated before executing this target. + When string `json:"when,omitempty"` +} + +// EntityManagementEventBridgeTargetParameters - A wrapper object containing parameters for one specific target type. +type EntityManagementEventBridgeTargetParameters struct { + // Parameters for a WORKFLOW target. Populated only if type is WORKFLOW. + Workflow EntityManagementEventBridgeWorkflowTargetParameters `json:"workflow,omitempty"` +} + +// EntityManagementEventBridgeWorkflowDefinitionType - Defines the workflow to execute. +type EntityManagementEventBridgeWorkflowDefinitionType struct { + // Specifies the workflow to execute. + Name string `json:"name"` + // Specifies the scope at which the workflow is defined. + ScopeType EntityManagementEventBridgeWorkflowDefinitionScopeType `json:"scopeType,omitempty"` + // Specifies the version of the workflow to execute. + Version int `json:"version"` +} + +// EntityManagementEventBridgeWorkflowInput - A simple key-value pair for workflow parameters (output). +type EntityManagementEventBridgeWorkflowInput struct { + // The name of the input parameter. + Name string `json:"name"` + // The value of the input parameter. + Value string `json:"value"` +} + +// EntityManagementEventBridgeWorkflowTargetParameters - Parameters specific to a WORKFLOW target. +type EntityManagementEventBridgeWorkflowTargetParameters struct { + // Defines the workflow to execute. + Definition EntityManagementEventBridgeWorkflowDefinitionType `json:"definition"` + // A list of key-value pairs to pass as input parameters to the workflow. + Inputs []EntityManagementEventBridgeWorkflowInput `json:"inputs"` + // The scope in which the target workflow will be executed. + Scope EntityManagementScopedReference `json:"scope"` +} + +// EntityManagementExecutionIssue - Rule execution issues +type EntityManagementExecutionIssue struct { + // Machine-readable code specifying the type of error or status. + StatusCode EntityManagementStatusCode `json:"statusCode"` + // Human-readable message providing details about the error or status. + StatusMessage string `json:"statusMessage,omitempty"` +} + +// EntityManagementExternalOwner - Owner of the repository +type EntityManagementExternalOwner struct { + // External Owner ID of the repository. + ID string `json:"id"` + // Type of owner of the repository eg:- user,organisation etc. + Type EntityManagementExternalOwnerType `json:"type"` +} + +// EntityManagementFederatedLogPartitionEntity - Federated Log partition entity. +type EntityManagementFederatedLogPartitionEntity struct { + // The URI location of the log partition in object storage. + DataLocationUri string `json:"dataLocationUri"` + // The description of the log partition. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Indicates if this log partition is the default partition. + IsDefault bool `json:"isDefault"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the log partition. This corresponds to the partition/event type used in log queries. + Name string `json:"name"` + // The table name associated with the log partition. This could refer to a data catalog table or similar structure. + PartitionTable string `json:"partitionTable"` + // The optional retention policy for logs in this partition. + RetentionPolicy EntityManagementRetentionPolicy `json:"retentionPolicy,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The federated log setup this partition belongs to. + Setup EntityManagementFederatedLogSetupEntity `json:"setup"` + // The status of the log partition. + Status EntityManagementLogPartitionStatus `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFederatedLogPartitionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementFederatedLogPartitionEntityCreateInput - Create input for FederatedLogPartitionEntity entity type. +type EntityManagementFederatedLogPartitionEntityCreateInput struct { + // See dataLocationUri in FederatedLogPartitionEntity. + DataLocationUri string `json:"dataLocationUri"` + // See description in FederatedLogPartitionEntity. + Description string `json:"description,omitempty"` + // See isDefault in FederatedLogPartitionEntity. + IsDefault bool `json:"isDefault"` + // See name in FederatedLogPartitionEntity. + Name string `json:"name"` + // See partitionTable in FederatedLogPartitionEntity. + PartitionTable string `json:"partitionTable"` + // See retentionPolicy in FederatedLogPartitionEntity. + RetentionPolicy EntityManagementRetentionPolicyCreateInput `json:"retentionPolicy,omitempty"` + // See scope in FederatedLogPartitionEntity. + Scope EntityManagementScopedReferenceInput `json:"scope,omitempty"` + // See setupId in FederatedLogPartitionEntity. + SetupId string `json:"setupId"` + // See status in FederatedLogPartitionEntity. + Status EntityManagementLogPartitionStatus `json:"status"` + // See tags in FederatedLogPartitionEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogPartitionEntityCreateResult - The result of creating an entity. +type EntityManagementFederatedLogPartitionEntityCreateResult struct { + // The created entity. + Entity EntityManagementFederatedLogPartitionEntity `json:"entity"` +} + +// EntityManagementFederatedLogPartitionEntityUpdateInput - Update input for FederatedLogPartitionEntity entity type. +type EntityManagementFederatedLogPartitionEntityUpdateInput struct { + // See dataLocationUri in FederatedLogPartitionEntity. + DataLocationUri string `json:"dataLocationUri,omitempty"` + // See description in FederatedLogPartitionEntity. + Description string `json:"description,omitempty"` + // See isDefault in FederatedLogPartitionEntity. + IsDefault bool `json:"isDefault,omitempty"` + // See name in FederatedLogPartitionEntity. + Name string `json:"name,omitempty"` + // See partitionTable in FederatedLogPartitionEntity. + PartitionTable string `json:"partitionTable,omitempty"` + // See retentionPolicy in FederatedLogPartitionEntity. + RetentionPolicy EntityManagementRetentionPolicyUpdateInput `json:"retentionPolicy,omitempty"` + // See setupId in FederatedLogPartitionEntity. + SetupId string `json:"setupId,omitempty"` + // See status in FederatedLogPartitionEntity. + Status EntityManagementLogPartitionStatus `json:"status,omitempty"` + // See tags in FederatedLogPartitionEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogPartitionEntityUpdateResult - The result of updating an entity. +type EntityManagementFederatedLogPartitionEntityUpdateResult struct { + // The updated entity. + Entity EntityManagementFederatedLogPartitionEntity `json:"entity"` +} + +// EntityManagementFederatedLogSetupEntity - Federated Log Setup Entity. +type EntityManagementFederatedLogSetupEntity struct { + // The cloud provider where this Federated Log setup is deployed. + CloudProvider EntityManagementCloudProvider `json:"cloudProvider"` + // The cloud provider region where the Federated Log setup is deployed. + CloudProviderRegion string `json:"cloudProviderRegion"` + // The object storage bucket where log data is stored. + DataLocationBucket string `json:"dataLocationBucket"` + // The data processing component that defines transformation rules and partition routing logic for this federated log setup. + DataProcessingComponent EntityManagementEntityInterface `json:"dataProcessingComponent,omitempty"` + // The connection manager entity used for data processing, transformation, and partition routing. Must match the cloudProvider type (e.g., AwsConnectionEntity for AWS, AzureConnectionEntity for Azure) and typically has write/update permissions. + DataProcessingConnection EntityManagementEntityInterface `json:"dataProcessingConnection"` + // The description of the Federated Log setup. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the federated log setup. + Name string `json:"name"` + // The database name associated with the federated log setup. This could refer to a data catalog database or similar structure. + PartitionDatabase string `json:"partitionDatabase"` + // The connection manager entity used by query workers for reading and accessing federated log resources. Must match the cloudProvider type (e.g., AwsConnectionEntity for AWS, AzureConnectionEntity for Azure) and typically has read-only permissions. + QueryConnection EntityManagementEntityInterface `json:"queryConnection"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The status of the federated log setup. + Status EntityManagementFederatedLogSetupStatus `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFederatedLogSetupEntity) ImplementsEntityManagementEntity() {} + +// special +func (x *EntityManagementFederatedLogSetupEntity) UnmarshalJSON(b []byte) error { + var objMap map[string]*json.RawMessage + err := json.Unmarshal(b, &objMap) + if err != nil { + return err + } + + for k, v := range objMap { + if v == nil { + continue + } + + switch k { + case "cloudProvider": + err = json.Unmarshal(*v, &x.CloudProvider) + if err != nil { + return err + } + case "cloudProviderRegion": + err = json.Unmarshal(*v, &x.CloudProviderRegion) + if err != nil { + return err + } + case "dataLocationBucket": + err = json.Unmarshal(*v, &x.DataLocationBucket) + if err != nil { + return err + } + case "dataProcessingComponent": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementEntityInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.DataProcessingComponent = *xxx + } + case "dataProcessingConnection": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementEntityInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.DataProcessingConnection = *xxx + } + case "description": + err = json.Unmarshal(*v, &x.Description) + if err != nil { + return err + } + case "id": + err = json.Unmarshal(*v, &x.ID) + if err != nil { + return err + } + case "metadata": + err = json.Unmarshal(*v, &x.Metadata) + if err != nil { + return err + } + case "name": + err = json.Unmarshal(*v, &x.Name) + if err != nil { + return err + } + case "partitionDatabase": + err = json.Unmarshal(*v, &x.PartitionDatabase) + if err != nil { + return err + } + case "queryConnection": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementEntityInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.QueryConnection = *xxx + } + case "scope": + err = json.Unmarshal(*v, &x.Scope) + if err != nil { + return err + } + case "status": + err = json.Unmarshal(*v, &x.Status) + if err != nil { + return err + } + case "tags": + err = json.Unmarshal(*v, &x.Tags) + if err != nil { + return err + } + case "type": + err = json.Unmarshal(*v, &x.Type) + if err != nil { + return err + } + } + } + + return nil +} + +// EntityManagementFederatedLogSetupEntityCreateInput - Create input for FederatedLogSetupEntity entity type. +type EntityManagementFederatedLogSetupEntityCreateInput struct { + // See cloudProvider in FederatedLogSetupEntity. + CloudProvider EntityManagementCloudProvider `json:"cloudProvider"` + // See cloudProviderRegion in FederatedLogSetupEntity. + CloudProviderRegion string `json:"cloudProviderRegion"` + // See dataLocationBucket in FederatedLogSetupEntity. + DataLocationBucket string `json:"dataLocationBucket"` + // See dataProcessingComponentId in FederatedLogSetupEntity. + DataProcessingComponentId string `json:"dataProcessingComponentId,omitempty"` + // See dataProcessingConnectionId in FederatedLogSetupEntity. + DataProcessingConnectionId string `json:"dataProcessingConnectionId"` + // See description in FederatedLogSetupEntity. + Description string `json:"description,omitempty"` + // See name in FederatedLogSetupEntity. + Name string `json:"name"` + // See nrAccountId in FederatedLogSetupEntity. + NrAccountId string `json:"nrAccountId"` + // See nrRegion in FederatedLogSetupEntity. + NrRegion EntityManagementNrRegion `json:"nrRegion"` + // See partitionDatabase in FederatedLogSetupEntity. + PartitionDatabase string `json:"partitionDatabase"` + // See queryConnectionId in FederatedLogSetupEntity. + QueryConnectionId string `json:"queryConnectionId"` + // See scope in FederatedLogSetupEntity. + Scope EntityManagementScopedReferenceInput `json:"scope,omitempty"` + // See status in FederatedLogSetupEntity. + Status EntityManagementFederatedLogSetupStatus `json:"status"` + // See tags in FederatedLogSetupEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogSetupEntityCreateResult - The result of creating an entity. +type EntityManagementFederatedLogSetupEntityCreateResult struct { + // The created entity. + Entity EntityManagementFederatedLogSetupEntity `json:"entity"` +} + +// EntityManagementFederatedLogSetupEntityUpdateInput - Update input for FederatedLogSetupEntity entity type. +type EntityManagementFederatedLogSetupEntityUpdateInput struct { + // See cloudProvider in FederatedLogSetupEntity. + CloudProvider EntityManagementCloudProvider `json:"cloudProvider,omitempty"` + // See cloudProviderRegion in FederatedLogSetupEntity. + CloudProviderRegion string `json:"cloudProviderRegion,omitempty"` + // See dataLocationBucket in FederatedLogSetupEntity. + DataLocationBucket string `json:"dataLocationBucket,omitempty"` + // See dataProcessingComponentId in FederatedLogSetupEntity. + DataProcessingComponentId string `json:"dataProcessingComponentId,omitempty"` + // See dataProcessingConnectionId in FederatedLogSetupEntity. + DataProcessingConnectionId string `json:"dataProcessingConnectionId,omitempty"` + // See description in FederatedLogSetupEntity. + Description string `json:"description,omitempty"` + // See name in FederatedLogSetupEntity. + Name string `json:"name,omitempty"` + // See nrAccountId in FederatedLogSetupEntity. + NrAccountId string `json:"nrAccountId,omitempty"` + // See nrRegion in FederatedLogSetupEntity. + NrRegion EntityManagementNrRegion `json:"nrRegion,omitempty"` + // See partitionDatabase in FederatedLogSetupEntity. + PartitionDatabase string `json:"partitionDatabase,omitempty"` + // See queryConnectionId in FederatedLogSetupEntity. + QueryConnectionId string `json:"queryConnectionId,omitempty"` + // See status in FederatedLogSetupEntity. + Status EntityManagementFederatedLogSetupStatus `json:"status,omitempty"` + // See tags in FederatedLogSetupEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogSetupEntityUpdateResult - The result of updating an entity. +type EntityManagementFederatedLogSetupEntityUpdateResult struct { + // The updated entity. + Entity EntityManagementFederatedLogSetupEntity `json:"entity"` +} + +// EntityManagementFleetControlProperties - Properties specific to fleet control +type EntityManagementFleetControlProperties struct { + // Agent deployment properties + AppliedDeployment EntityManagementAgentDeployment `json:"appliedDeployment,omitempty"` + // True is the Agent sent a disconnect message + DisconnectedReceived bool `json:"disconnectedReceived,omitempty"` + // Environment the agent is running in + Environment string `json:"environment,omitempty"` + // True if the Agent is up and healthy + Healthy bool `json:"healthy,omitempty"` + // Error message returned by the agent when it is unhealthy + LastError string `json:"lastError,omitempty"` + // Error message returned when the last remote configuration deploy is not successful + LastRemoteConfigError string `json:"lastRemoteConfigError,omitempty"` + // Status of the last remote configuration deploy + LastRemoteConfigStatus string `json:"lastRemoteConfigStatus,omitempty"` + // Timestamp indicating when the agent was started + StartTime *nrtime.EpochMilliseconds `json:"startTime,omitempty"` + // The UID of this agent + Uid string `json:"uid,omitempty"` + // Version of the agent + Version string `json:"version,omitempty"` +} + +// EntityManagementFleetDeployment - Deprecated: A set of configurations that are currently deployed +type EntityManagementFleetDeployment struct { + // A list of EntityGuid of Managed Entities selected for Canary deploy + CanaryManagedEntities []string `json:"canaryManagedEntities"` + // The number of configurations changed during this deployment + ConfigsChanged int `json:"configsChanged"` + // A list of configurations included in this deployment + ConfigurationVersions []string `json:"configurationVersions"` + // Deployment started + DeployedAt *nrtime.EpochMilliseconds `json:"deployedAt"` + // Deployment description + Description string `json:"description,omitempty"` + // The number of entities changed during this deployment + EntitiesChanged int `json:"entitiesChanged"` + // The number of managed entities changed during this deployment + ManagedEntitiesChanged int `json:"managedEntitiesChanged,omitempty"` + // The number of managed entities required to change during this deployment + ManagedEntitiesRequiredToChange int `json:"managedEntitiesRequiredToChange,omitempty"` + // Metadata containing identification of the user who created this deployment + Metadata EntityManagementUserMetadata `json:"metadata,omitempty"` + // Deployment name + Name string `json:"name"` + // Deployment status + Status string `json:"status,omitempty"` + // The number of supervised agent entities changed during this deployment + SupervisedAgentEntitiesChanged int `json:"supervisedAgentEntitiesChanged,omitempty"` + // The number of supervised agent entities required to change during this deployment + SupervisedAgentEntitiesRequiredToChange int `json:"supervisedAgentEntitiesRequiredToChange,omitempty"` +} + +// EntityManagementFleetDeploymentEntity - A set of configurations that can be deployed to a fleet +type EntityManagementFleetDeploymentEntity struct { + // Agents to deploy + Agents []EntityManagementAgentToDeploy `json:"agents"` + // A list of configurations included in this deployment + ConfigurationVersionList []EntityManagementDeploymentAgentConfigurationVersion `json:"configurationVersionList,omitempty"` + // Deprecated - Replaced by configurationVersionList + ConfigurationVersions []string `json:"configurationVersions"` + // Deployment description + Description string `json:"description,omitempty"` + // Deployment's Fleet ID + FleetId string `json:"fleetId"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Deployment name + Name string `json:"name"` + // Deployment phase + Phase EntityManagementFleetDeploymentPhase `json:"phase,omitempty"` + // Ring wise deployment status + RingsDeploymentTracker []EntityManagementRingDeploymentTracker `json:"ringsDeploymentTracker,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFleetDeploymentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementFleetEntity - A fleet of entities that are managed by NRAgentControl +type EntityManagementFleetEntity struct { + // Object holds state of current deployment + CurrentDeployment EntityManagementFleetDeployment `json:"currentDeployment,omitempty"` + // User provided description for the fleet + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // CollectionEntity that associates rings of managed entities for Fleet + ManagedEntityRings EntityManagementCollectionEntity `json:"managedEntityRings,omitempty"` + // The type of entity the fleet will manage. e.g. HOST + ManagedEntityType EntityManagementManagedEntityType `json:"managedEntityType"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the fleet + Name string `json:"name"` + // The operating system type of the managed entities in this fleet + OperatingSystem EntityManagementOperatingSystem `json:"operatingSystem,omitempty"` + // Indicates this fleet has a specific product type + Product []string `json:"product"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFleetEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementFleetRingEntity - A group of Managed Entities in a fleet to which a fleet deployment is applied +type EntityManagementFleetRingEntity struct { + // Ring's Fleet ID + FleetId string `json:"fleetId"` + // The entity's global unique identifier. + ID string `json:"id"` + // CollectionEntity associated with the ring + ManagedEntities EntityManagementCollectionEntity `json:"managedEntities,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFleetRingEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementFlowEntity - An entity representing a Pathpoint flow entity containing stages, steps, and configuration stored in a blob. +type EntityManagementFlowEntity struct { + // The Blob containing the pathpoint flow data. + Blob EntityManagementBlob `json:"blob,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFlowEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementGenericEntity - A generic entity. +type EntityManagementGenericEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementGenericEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementGitHubIntegrationEntity - An entity representing github integration information +type EntityManagementGitHubIntegrationEntity struct { + // Composite count attribute encapsulating team and repo counts. + Count EntityManagementCount `json:"count,omitempty"` + // Options for retain entities with GitHub integration. + GitHubRetentionOptions EntityManagementGitHubRetentionOptions `json:"gitHubRetentionOptions,omitempty"` + // Github sync options for customer + GitHubSyncOptions EntityManagementGitHubSyncOptions `json:"gitHubSyncOptions,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // The GitHub app installation ID. + InstallationId string `json:"installationId"` + // source of github integration installation + InstallationSource EntityManagementInstallationSource `json:"installationSource,omitempty"` + // installation status of the GitHub app + InstallationStatus EntityManagementInstallationStatus `json:"installationStatus,omitempty"` + // last sync completed timestamp + LastSyncCompletedAt *nrtime.EpochMilliseconds `json:"lastSyncCompletedAt,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // upcoming sync requested timestamp + NextSyncAt *nrtime.EpochMilliseconds `json:"nextSyncAt,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Synchronized GitHub teams for customer team selection. + SynchronizedGitHubTeams EntityManagementSynchronizedGitHubTeams `json:"synchronizedGitHubTeams,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementGitHubIntegrationEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementGitHubRetentionOptions - Options for retaining entities with GitHub integration. +type EntityManagementGitHubRetentionOptions struct { + // Whether to retain associated repositories + RetainRepositories bool `json:"retainRepositories,omitempty"` + // Whether to retain associated teams + RetainTeams bool `json:"retainTeams,omitempty"` +} + +// EntityManagementGitHubSyncOptions - List of possible github sync options. +type EntityManagementGitHubSyncOptions struct { + // Sync github repositories + SyncRepositories bool `json:"syncRepositories,omitempty"` + // Sync github teams + SyncTeams bool `json:"syncTeams,omitempty"` +} + +// EntityManagementGitHubTeam - Type for GitHubTeam +type EntityManagementGitHubTeam struct { + // The unique identifier of the GitHub team. + ID string `json:"id"` +} + +// EntityManagementGitRepositoryEntity - An entity representing a Repository of a organization +type EntityManagementGitRepositoryEntity struct { + // Count of closed pull requests(PR) in the repository. + ClosedPullRequestCount int `json:"closedPullRequestCount,omitempty"` + // The latest Configuration Item associated to the repository. Contains a JSON representation of the repository configuration. + Configuration EntityManagementConfiguration `json:"configuration,omitempty"` + // The description of the repository. + Description string `json:"description,omitempty"` + // Repository Creation date at code hosting tool like github, gitlab etc + ExternalCreatedAt *nrtime.EpochMilliseconds `json:"externalCreatedAt,omitempty"` + // External Unique Identifier in Code hosting systems like github,gitlab etc. + ExternalId string `json:"externalId"` + // Last time the repository was deployed. + ExternalLastDeployedAt *nrtime.EpochMilliseconds `json:"externalLastDeployedAt,omitempty"` + // External owner of the repository. + ExternalOwner EntityManagementExternalOwner `json:"externalOwner,omitempty"` + // Repository Updation date at code hosting tool like github, gitlab etc + ExternalUpdatedAt *nrtime.EpochMilliseconds `json:"externalUpdatedAt,omitempty"` + // Number of times Repository has been forked. + ForkCount int `json:"forkCount,omitempty"` + // Source of the repository. + HostingPlatform EntityManagementHostingPlatform `json:"hostingPlatform,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Last release version of the repository. + LatestReleaseVersion string `json:"latestReleaseVersion,omitempty"` + // License associated with the repository + License EntityManagementRepositoryLicense `json:"license,omitempty"` + // Count of locked pull requests(PR) in the repository. + LockedPullRequestCount int `json:"lockedPullRequestCount,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // Count of open pull requests(PR) in the repository. + OpenPullRequestCount int `json:"openPullRequestCount,omitempty"` + // Most used language of the repository. + PrimaryLanguage string `json:"primaryLanguage,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // Source Url of the repository eg:- gitUrl. + URL string `json:"url"` +} + +func (x *EntityManagementGitRepositoryEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementGithubAppTokenCredential - App token credential type for Github +type EntityManagementGithubAppTokenCredential struct { + // The registered Github application ID, default to NewRelic Integration application + AppId string `json:"appId,omitempty"` + // The Github app installation ID. + InstallationId string `json:"installationId"` + // Default to NewRelic Integration privateKey, currently stored in Vault. + PrivateKeyReference EntityManagementSecretReference `json:"privateKeyReference"` + // The field name for the access token from the JSON response, default to token + TokenFieldName string `json:"tokenFieldName,omitempty"` + // path to get an access token, default to app/installations/{installation-id}/access_tokens + TokenRelativeURL string `json:"tokenRelativeUrl,omitempty"` +} + +// EntityManagementGithubConnection - Connection entity type for Github +type EntityManagementGithubConnection struct { + // A single credential from the choice of GithubCredential + Credential EntityManagementGithubCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The entity’s scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity’s type. + Type string `json:"type"` + // The Github API URL, default to https://api.github.com + URL string `json:"url,omitempty"` +} + +func (x *EntityManagementGithubConnection) ImplementsEntityManagementEntity() {} + +// EntityManagementGithubCredentials - Base credentials type for Github +type EntityManagementGithubCredentials struct { + // Github App token support with JWT + AppToken EntityManagementGithubAppTokenCredential `json:"appToken,omitempty"` + // A Github personal access token. + PersonalAccessToken EntityManagementSecretReference `json:"personalAccessToken,omitempty"` +} + +// EntityManagementImpactProfileEntity - An entity representing impact profile. +type EntityManagementImpactProfileEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the impact profile. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementImpactProfileEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementImpactQuery - Impact query containing NRQL query and account IDs for status page announcements. +type EntityManagementImpactQuery struct { + // NRQL query string + NRQLQuery string `json:"nrqlQuery"` + // List of account IDs to query against + QueryAccountIds []int `json:"queryAccountIds"` +} + +// EntityManagementInboxIssueCategoryEntity - Entity to represent category type configuration +type EntityManagementInboxIssueCategoryEntity struct { + // Scope for this configuration + CategoryScope EntityManagementCategoryScope `json:"categoryScope"` + // New category Type. Start with capital letter. + CategoryType string `json:"categoryType"` + // The entity's global unique identifier. + ID string `json:"id"` + // issue Type for category type. Should be pre-existed. New issue type have to be added manually in the code. + IssueType EntityManagementIssueType `json:"issueType"` + // Message attributes provided in order. Application will fall back to second then third and so on if previous attribute not found or null or empty. + MessageAttributes []string `json:"messageAttributes,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // Name attributes in order. Application will fall back to second then third and so on if previous attribute not found or null or empty. + NameAttributes []string `json:"nameAttributes"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementInboxIssueCategoryEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementIncidentAttachmentEntity - Represents a attachment entity used in incident +type EntityManagementIncidentAttachmentEntity struct { + // Incident attachment Blob + Blob EntityManagementBlob `json:"blob"` + // An optional description of the attachment, generally additional context about the attachment + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementIncidentAttachmentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementIncidentEntity - Entity of type IncidentEntity. +type EntityManagementIncidentEntity struct { + // The primary entity (user or team) responsible for the WorkItem. + AssignedTo EntityManagementWorkItemAssignment `json:"assignedTo"` + // A flexible collection of key/value pair strings for storing domain-specific data. + Attributes []EntityManagementWorkItemAttribute `json:"attributes"` + // The high-level classification of the WorkItem (INCIDENT, ISSUE, VULNERABILITY, PERFORMANCE). + Category EntityManagementWorkItemCategory `json:"category,omitempty"` + // Customer Impact Description + CustomerImpact string `json:"customerImpact,omitempty"` + // Detailed explanation of the WorkItem. + Description string `json:"description,omitempty"` + // An optional Epoch timestamp indicating a potential due date (e.g., retrospective deadline). + DueDate *nrtime.EpochMilliseconds `json:"dueDate,omitempty"` + // Entities Impacted + EntitiesImpacted []string `json:"entitiesImpacted"` + // An optional, consumer-managed identifier (replaces incidentKey). + ExternalId string `json:"externalId,omitempty"` + // The entitys global unique identifier. + ID string `json:"id"` + // Primary classification of the incident (e.g., Network, Software). Max length: 64 characters. + IncidentCategory string `json:"incidentCategory,omitempty"` + // A public-facing, human-readable identifier for the incident. + IncidentKey string `json:"incidentKey"` + // The incident profile entity global unique identifier. + IncidentProfileId string `json:"incidentProfileId"` + // Secondary classification, dependent on the category. Max length: 64 characters. + IncidentSubcategory string `json:"incidentSubcategory,omitempty"` + // A list of issue links related to the incident + IssueLinks []string `json:"issueLinks"` + // An optional list of alphanumeric tags or keywords (replaces incidentTags). + Labels []string `json:"labels"` + // Key takeaways and lessons learned from the incident and its resolution. + LessonsLearned string `json:"lessonsLearned,omitempty"` + // A collection entity linking to external tickets or related documents. + Links EntityManagementCollectionEntity `json:"links,omitempty"` + // The maximum severity level reached during the incident lifecycle. + MaxSeverity string `json:"maxSeverity,omitempty"` + // A collection entity holding the stream of messages/notes (e.g., incident timeline). + Messages EntityManagementCollectionEntity `json:"messages,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name or title of the message. + Name string `json:"name"` + // The relative importance or urgency of the WorkItem. + Priority EntityManagementWorkItemPriority `json:"priority"` + // The end-user who reported the incident, if different from the creator. + ReportedBy string `json:"reportedBy,omitempty"` + // The category of the resolution (e.g., Code Fix, Configuration Change). + ResolutionCategory string `json:"resolutionCategory,omitempty"` + // A summary of the steps taken to resolve the incident. + ResolutionSummary string `json:"resolutionSummary,omitempty"` + // A list of references to work items that represent action items from the retrospective. + RetroActionItems []string `json:"retroActionItems"` + // A detailed summary of the root cause analysis findings. + RootCauseSummary string `json:"rootCauseSummary,omitempty"` + // Tags associated with the root cause for categorization and analysis. + RootCauseTags []string `json:"rootCauseTags"` + // The entitys scope. + Scope EntityManagementScopedReference `json:"scope"` + // Represents the severity level of the incident, Can be customer-configured. + Severity string `json:"severity"` + // The originating system that created the incident record. Slack, UI + Source EntityManagementIncidentSource `json:"source"` + // The workitem status. statuscan be customised for each WorkItem independently, and can be a completely different set than the core status list + Status string `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // Incident timelines + Timelines EntityManagementCollectionEntity `json:"timelines,omitempty"` + // The specific event or action that initiated the incident. + TriggeringEvent string `json:"triggeringEvent,omitempty"` + // The entitys type. + Type string `json:"type"` +} + +func (x *EntityManagementIncidentEntity) ImplementsEntityManagementEntity() {} + +func (x *EntityManagementIncidentEntity) ImplementsEntityManagementWorkItemV2() {} + +// EntityManagementIncidentLinkEntity - Entity representing an incident link. +type EntityManagementIncidentLinkEntity struct { + // An optional external identifier for this link from a synced system. + ExternalId string `json:"externalId,omitempty"` + // The entitys global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name or title of the link. + Name string `json:"name"` + // The entitys scope. + Scope EntityManagementScopedReference `json:"scope"` + // The ID of the sync configuration that created this link. + SourceSyncConfigurationId string `json:"sourceSyncConfigurationId,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entitys type. + Type string `json:"type"` + // The URL of the external resource. + URL string `json:"url"` +} + +func (x *EntityManagementIncidentLinkEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementIncidentMessageEntity - Entity representing an incident message. +type EntityManagementIncidentMessageEntity struct { + // The message content. + Content string `json:"content"` + // The encoding used for the message content. + ContentEncoding EntityManagementEncodingType `json:"contentEncoding"` + // The type of message content (e.g., TEXT, HTML, MARKDOWN). + ContentType EntityManagementMessageType `json:"contentType"` + // An optional external identifier for this message from a synced system. + ExternalId string `json:"externalId,omitempty"` + // The entitys global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name or title of the message. + Name string `json:"name"` + // The ID of the parent message if this is a reply or threaded message. + ParentId string `json:"parentId,omitempty"` + // The entitys scope. + Scope EntityManagementScopedReference `json:"scope"` + // The ID of the sync configuration that created this message. + SourceSyncConfigurationId string `json:"sourceSyncConfigurationId,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entitys type. + Type string `json:"type"` +} + +func (x *EntityManagementIncidentMessageEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementIncidentProfileAttachmentEntity - Represents a attachment entity used in profile +type EntityManagementIncidentProfileAttachmentEntity struct { + // Incident profile attachment Blob + Blob EntityManagementBlob `json:"blob"` + // An optional description of the attachment, generally additional context about the attachment + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementIncidentProfileAttachmentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementIncidentProfileEntity - Incident profile entity +type EntityManagementIncidentProfileEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the Incident Profile + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` +} + +func (x *EntityManagementIncidentProfileEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementIncidentTimelineEntity - Entity of type IncidentTimeline. +type EntityManagementIncidentTimelineEntity struct { + // The content of the entry, which can include rich text formatting. + Content string `json:"content"` + // The type of entry (e.g., NOTE, PROPOSED_CHANGE, KEY_MOMENTS, STATE). + EntryType string `json:"entryType"` + // The entitys global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name or title of the message. + Name string `json:"name"` + // The entitys scope. + Scope EntityManagementScopedReference `json:"scope"` + // The source of the timeline entry + Source EntityManagementIncidentTimelineSource `json:"source"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entitys type. + Type string `json:"type"` +} + +func (x *EntityManagementIncidentTimelineEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementInfrastructureManager - Details related to an infrastructure manager +type EntityManagementInfrastructureManager struct { + // The type of the manager + Type string `json:"type,omitempty"` + // The version of the manager + Version string `json:"version,omitempty"` +} + +// EntityManagementJiraBasicAuthCredential - Basic auth credential type for Jira +type EntityManagementJiraBasicAuthCredential struct { + // The Jira api token to authorize the API usage for read/create/update operations + APIKey EntityManagementSecretReference `json:"apiKey"` + // username to create the api token + Username EntityManagementSecretReference `json:"username"` +} + +// EntityManagementJiraConnection - Connection entity type for Jira +type EntityManagementJiraConnection struct { + // A single credential from the choice of JiraCredential + Credential EntityManagementJiraCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The entity’s scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity’s type. + Type string `json:"type"` + // The Jira instance URL + URL string `json:"url"` +} + +func (x *EntityManagementJiraConnection) ImplementsEntityManagementEntity() {} + +// EntityManagementJiraCredentials - Base credentials type for Jira +type EntityManagementJiraCredentials struct { + // A simple api key credential + BasicAuth EntityManagementJiraBasicAuthCredential `json:"basicAuth,omitempty"` + // OAuth support + Oauth EntityManagementJiraOAuthCredential `json:"oauth,omitempty"` + // A personal access token credential + PersonalAccessToken EntityManagementSecretReference `json:"personalAccessToken,omitempty"` +} + +// EntityManagementJiraOAuthCredential - OAuth credential type for Jira +type EntityManagementJiraOAuthCredential struct { + // The client ID for the OAuth request + ClientId string `json:"clientId"` + // The client secret for the OAuth request + ClientSecret EntityManagementSecretReference `json:"clientSecret"` + // The field name for the oauth token from the JSON response, default to access_token + TokenFieldName string `json:"tokenFieldName,omitempty"` + // The Jira Atlassian URL to get an oauth token, default to https://auth.atlassian.com/oauth/token + TokenURL string `json:"tokenUrl,omitempty"` +} + +// EntityManagementJiraSyncConfigurationV2Entity - Jira Sync Configuration entity type +type EntityManagementJiraSyncConfigurationV2Entity struct { + // Direction of the sync, true for 2-way, false for 1-way from New Relic to Jira. + Bidirectional bool `json:"bidirectional"` + // A reference to a connection entity for the 3rd party ticketing system, using NGEP identifier. + Connection string `json:"connection"` + // Description of the sync configuration + Description string `json:"description,omitempty"` + // Flag to indicate if the sync is enabled or not + Enabled bool `json:"enabled"` + // The entity's global unique identifier. + ID string `json:"id"` + // The issue type of the Jira issue to be created: STORY, TASK, BUG + IssueType EntityManagementJiraIssueType `json:"issueType"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Sync configuration mode. + Mode EntityManagementSyncConfigurationMode `json:"mode"` + // The name of this entity. + Name string `json:"name"` + // The key of the Jira project where the issue will be created + ProjectKey string `json:"projectKey"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // A list of tags to match against a specific WorkItem set of tags to determine if the WorkItem should be synced. + Targets []EntityManagementTag `json:"targets"` + // The list of fields and their mapping from the WorkItem entity + TemplateFields []EntityManagementTemplateFieldType `json:"templateFields"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementJiraSyncConfigurationV2Entity) ImplementsEntityManagementEntity() {} + +// EntityManagementJuniperMistBasicAuthCredential - Basic auth credential type for Juniper Mist +type EntityManagementJuniperMistBasicAuthCredential struct { + // The API token to authorize API access + Token EntityManagementSecretReference `json:"token"` +} + +// EntityManagementJuniperMistConnectionEntity - Connection entity type for Juniper Mist +type EntityManagementJuniperMistConnectionEntity struct { + // A single credential for Juniper Mist + Credential EntityManagementJuniperMistCredential `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The Juniper Mist region (e.g., Global 01, Global 02, Global 03, Global 04) + Region string `json:"region"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` +} + +func (x *EntityManagementJuniperMistConnectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementJuniperMistCredential - Credential type for Juniper Mist +type EntityManagementJuniperMistCredential struct { + // A simple token-based authentication + BasicAuth EntityManagementJuniperMistBasicAuthCredential `json:"basicAuth,omitempty"` +} + +// EntityManagementLlmConfig - configurable details for the LLM +type EntityManagementLlmConfig struct { + // Seed for reproducible output from LLM + CacheSeed string `json:"cacheSeed,omitempty"` + // LLM model name, for ex: gpt-4o + Model string `json:"model,omitempty"` + // LLM parameter for creative control, 0 for consistent output, 1 for more creative output + Temperature float64 `json:"temperature,omitempty"` +} + +// EntityManagementMaintenanceWindowEntity - Represents Maintenance window entity. +type EntityManagementMaintenanceWindowEntity struct { + // The type of the entities affected by maintenance window. + AffectedEntityType string `json:"affectedEntityType"` + // The description of the maintenance window. + Description string `json:"description,omitempty"` + // The duration of the maintenance window in ISO8601 duration formatted string. + Duration Duration `json:"duration"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The recurrence rule for the maintenance window. + Rrule string `json:"rrule,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The start of maintenance window in ISO8601 UTC formatted string. + StartTime nrtime.DateTime `json:"startTime"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The timezone in which the maintenance window is scheduled. + Timezone string `json:"timezone"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementMaintenanceWindowEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementManagedEvaluationConfig - Configuration for a managed evaluation +type EntityManagementManagedEvaluationConfig struct { + // Additional configuration parameters + AdditionalParameters []EntityManagementAdditionalParameter `json:"additionalParameters"` + // Whether the evaluation is enabled or disabled + Enabled bool `json:"enabled,omitempty"` + // The type of evaluation to perform + EvaluationType EntityManagementManagedEvaluationType `json:"evaluationType,omitempty"` + // Threshold value for the evaluation (0.0 to 1.0) + Threshold float64 `json:"threshold,omitempty"` +} + +// EntityManagementManagedEvaluationsEntity - Experimental feature for managed evaluations +type EntityManagementManagedEvaluationsEntity struct { + // The entity description. + Description string `json:"description,omitempty"` + // List of evaluation configurations for this entity + Evaluations []EntityManagementManagedEvaluationConfig `json:"evaluations"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the evaluation. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementManagedEvaluationsEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementMarkdownTextSplitterOptions - The MarkdownTextSplitter options +type EntityManagementMarkdownTextSplitterOptions struct { + // Headers to split text on + HeadersToSplitOn []string `json:"headersToSplitOn"` + // Wether splitter should return each line + ReturnEachLine bool `json:"returnEachLine"` +} + +// EntityManagementMcpServerAuth - Authentication configuration for an MCP server +type EntityManagementMcpServerAuth struct { + // Bearer token value (required when type=BEARER_TOKEN) + BearerToken EntityManagementSecretReference `json:"bearerToken,omitempty"` + // Arbitrary header key (required when type=GENERIC_HEADER) + HeaderKey string `json:"headerKey,omitempty"` + // Arbitrary header value (required when type=GENERIC_HEADER) + HeaderValue EntityManagementSecretReference `json:"headerValue,omitempty"` + // Type of authentication to apply + Type EntityManagementMcpAuthType `json:"type"` +} + +// EntityManagementMcpServerEntity - MCP Server entity for agentic-platform +type EntityManagementMcpServerEntity struct { + // Authentication configuration for connecting to the MCP server + Auth EntityManagementMcpServerAuth `json:"auth,omitempty"` + // short description of the MCP server used for validation by agentic-platform + Description string `json:"description"` + // display name for the mcp server + DisplayName string `json:"displayName,omitempty"` + // Endpoint for the MCP server + Endpoint string `json:"endpoint"` + // entity's unique global indentifier + ID string `json:"id"` + // tool metadata + Metadata EntityManagementMetadata `json:"metadata"` + // unique name of the MCP server used for validation by agentic-platform + Name string `json:"name"` + // Protocol version expected (if empty assume latest supported) + ProtocolVersion string `json:"protocolVersion,omitempty"` + // entity scope + Scope EntityManagementScopedReference `json:"scope"` + // collection of tags + Tags []EntityManagementTag `json:"tags"` + // Transport mechanism used to communicate with the server + Transport EntityManagementMcpTransport `json:"transport"` + // entity type + Type string `json:"type"` +} + +func (x *EntityManagementMcpServerEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementMetadata - Metadata about an entity. +type EntityManagementMetadata struct { + // The entity's creation time. + CreatedAt *nrtime.EpochMilliseconds `json:"createdAt,omitempty"` + // Actor that created this entity. + CreatedBy EntityManagementActorInterface `json:"createdBy,omitempty"` + // The entity's last update time. + UpdatedAt *nrtime.EpochMilliseconds `json:"updatedAt,omitempty"` + // Actor that updated this entity. + UpdatedBy EntityManagementActorInterface `json:"updatedBy,omitempty"` + // The entity current version. Use this value for concurrency control. + Version int `json:"version"` +} + +// special +func (x *EntityManagementMetadata) UnmarshalJSON(b []byte) error { + var objMap map[string]*json.RawMessage + err := json.Unmarshal(b, &objMap) + if err != nil { + return err + } + + for k, v := range objMap { + if v == nil { + continue + } + + switch k { + case "createdAt": + err = json.Unmarshal(*v, &x.CreatedAt) + if err != nil { + return err + } + case "createdBy": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementActorInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.CreatedBy = *xxx + } + case "updatedAt": + err = json.Unmarshal(*v, &x.UpdatedAt) + if err != nil { + return err + } + case "updatedBy": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementActorInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.UpdatedBy = *xxx + } + case "version": + err = json.Unmarshal(*v, &x.Version) + if err != nil { + return err + } + } + } + + return nil +} + +// EntityManagementMeterAttribute - Meter attribute type +type EntityManagementMeterAttribute struct { + // The name of the attribute + Name string `json:"name"` + // The value of the attribute + Values []string `json:"values"` +} + +// EntityManagementMeterEntity - An entity representing a Meter used to report customer-driven usage and associated contextual data, primarily for billing. +type EntityManagementMeterEntity struct { + // Collection of attributes associated with the meter. + Attributes []EntityManagementMeterAttribute `json:"attributes"` + // Human understandable 1 liner explaining the meter's purpose. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Reference to the meter type entity that defines how usage is calculated. + MeterType EntityManagementMeterTypeEntity `json:"meterType"` + // Human understandable identifier for the meter. + Name string `json:"name"` + // Reference to the owning team entity that is responsible for reporting usage with this meter. + OwningTeam EntityManagementTeamEntity `json:"owningTeam"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementMeterEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementMeterTypeEntity - A meter type defines a way of calculating usage and what dimensions are guaranteed to be reported with that usage. +type EntityManagementMeterTypeEntity struct { + // Determines whether this meter type can be used to create meters. + AllowMeterCreation bool `json:"allowMeterCreation"` + // The names of dimensions that this meter type expects to report. + AttributionDimensions []string `json:"attributionDimensions"` + // Human understandable 1 liner explaining the meter type's purpose. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Human understandable identifier for the meter type. + Name string `json:"name"` + // Reference to the owning team entity that is responsible for this meter type. + OwningTeam EntityManagementTeamEntity `json:"owningTeam"` + // Reference to the product line entity that this meter type belongs to. + ProductLine EntityManagementProductLineEntity `json:"productLine"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementMeterTypeEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementNRQLMacroEntity - A reusable NRQL macro that can be substituted into NRQL queries to simplify complex or frequently-used query patterns. +// +// NRQL macros allow you to define query fragments that can be referenced and expanded in your queries, reducing +// duplication and improving maintainability. For example, you might create a macro for filtering out test data, +// calculating a specific metric, or defining commonly-used WHERE conditions. +// +// ## Example Macro Expression +// +// A macro for filtering production traffic: +// ``` +// environment = 'production' AND appName NOT LIKE '%test%' +// ``` +// +// This macro could be used in WHERE clauses across multiple queries. +// +// For more information about NRQL, see [NRQL documentation](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/). +type EntityManagementNRQLMacroEntity struct { + // The NRQL expression that will be substituted when this macro is used in a query. + // + // This can be any valid NRQL fragment appropriate for the supported clause(s). Examples: + // - WHERE clause: `environment = 'production' AND appName NOT LIKE '%test%'` + // - SELECT clause: `average(duration) / 1000 as 'avgDurationSeconds'` + // - FACET clause: `appName, host` + Expression string `json:"expression"` + // The entity's global unique identifier. + ID string `json:"id"` + // System-generated metadata about this macro entity, including creation time, last update time, and version information. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique, human-readable name for this macro. This name is used to identify and reference the macro. + // + // The name cannot be changed after creation. Choose a descriptive name that indicates the macro's purpose, such as 'filterProductionTraffic' or 'calculateApdex'. + Name string `json:"name"` + // The number of parameters used in the macro expression. Not required if the value is 0. + // + // Within the macro expression, parameters are referenced by index as $1, $2,... + NumParameters int `json:"numParameters,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Key-value pairs of tags. Tags are inherited from the Entity interface. + Tags []EntityManagementTag `json:"tags"` + // The entity type identifier. Always returns 'NRQL_MACRO' for this entity type. + Type string `json:"type"` +} + +func (x *EntityManagementNRQLMacroEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementNRQLRuleEngine - NRQL engine configuration. +type EntityManagementNRQLRuleEngine struct { + // The accounts to be queried. + Accounts []int `json:"accounts"` + // An optional list of accounts that are joined with 'accounts' when running the query. + JoinAccounts []int `json:"joinAccounts"` + // The query to be executed. + Query string `json:"query"` +} + +// EntityManagementNewRelicBasicAuthCredential - Base credentials type for New Relic +type EntityManagementNewRelicBasicAuthCredential struct { + // The New Relic api key to authorize the API usage for read/create/update operations + APIKey EntityManagementSecretReference `json:"apiKey"` + // Type of basic auth credential: Ingest or User + Type EntityManagementKeyType `json:"type"` +} + +// EntityManagementNewRelicConnection - Connection entity type for New Relic +type EntityManagementNewRelicConnection struct { + // A single credential from the choice of NewRelicCredential + Credential EntityManagementNewRelicBasicAuthCredential `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The NewRelic region + Region string `json:"region,omitempty"` + // The entity’s scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity’s type. + Type string `json:"type"` +} + +func (x *EntityManagementNewRelicConnection) ImplementsEntityManagementEntity() {} + +// EntityManagementNotebookEntity - An entity representing a New Relic Notebook. +type EntityManagementNotebookEntity struct { + // Configuration of the notebook, including the content of each of its blocks. + Content EntityManagementBlob `json:"content,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementNotebookEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementNotificationAttachmentEntity - Represents a attachment entity used in notifications +type EntityManagementNotificationAttachmentEntity struct { + // Notification attachment Blob + Blob EntityManagementBlob `json:"blob"` + // An optional description of the attachment, generally additional context about the attachment + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementNotificationAttachmentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementNrAiAgentEntity - This is Nr Ai Agent Entity, currently under development. +type EntityManagementNrAiAgentEntity struct { + // display name of the agent + DisplayName string `json:"displayName"` + // entity's global identifier + ID string `json:"id"` + // agent metadata + Metadata EntityManagementMetadata `json:"metadata"` + // unique name of the agent entity + Name string `json:"name"` + // entity scope + Scope EntityManagementScopedReference `json:"scope"` + // collection of tags + Tags []EntityManagementTag `json:"tags"` + // entity type + Type string `json:"type"` + // version of the AiAgent + Version string `json:"version"` +} + +func (x *EntityManagementNrAiAgentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementNumericCondition - Numeric condition type. +type EntityManagementNumericCondition struct { + // Numeric condition type operator. + Operator EntityManagementNumericOperator `json:"operator"` + // Value to compare against. + Value float64 `json:"value"` +} + +// EntityManagementOperatingSystem - Operating System string enum for the host operating systems in a fleet +type EntityManagementOperatingSystem struct { + // The operating system type enum + Type EntityManagementOperatingSystemType `json:"type"` +} + +// EntityManagementOperationEntity - Entity of type OperationEntity. +type EntityManagementOperationEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementOperationEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementOperationMetricEntity - Entity of type OperationMetricEntity. +type EntityManagementOperationMetricEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementOperationMetricEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementPerformanceInboxSettingEntity - Performance inbox setting entity. This entity encompasses all the performance inbox settings. +type EntityManagementPerformanceInboxSettingEntity struct { + // Collection of configs for performance inbox settings. + Config []EntityManagementConfig `json:"config"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The scope at which the thresholds are applied. + ThresholdScope EntityManagementThresholdScope `json:"thresholdScope"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementPerformanceInboxSettingEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementPipelineCloudRuleEntity - A rule applied to telemetry data to modify how it's processed in some way +type EntityManagementPipelineCloudRuleEntity struct { + // Description of this pipeline cloud rule. + Description string `json:"description,omitempty"` + // The enabled boolean field used to enable or disable a Pipeline Cloud Rule (default value will be true) + Enabled bool `json:"enabled,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The NRQL string used to specify the action you want to take and data you want to take the specified action on. + NRQL nrdb.NRQL `json:"nrql"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementPipelineCloudRuleEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementPrincipal - A wrapper object that will contain exactly one of the possible identity types. +type EntityManagementPrincipal struct { + // The principal identifier, typically userId + ID string `json:"id"` + // Enum represents type of identity. + Type EntityManagementPrincipalType `json:"type"` +} + +// EntityManagementProcessState - At rest background processing types +type EntityManagementProcessState struct { + // Message that indicates the process status + Message string `json:"message,omitempty"` + // Indicate the status of a process + Status EntityManagementProcessStatus `json:"status,omitempty"` +} + +// EntityManagementProductLineEntity - A product line represents a grouping of related products or services within the organization. +type EntityManagementProductLineEntity struct { + // Human understandable 1 liner explaining the product line's purpose. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Human understandable identifier for the product line. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementProductLineEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementProgressLevelDefinition - Defines a progress level within a scorecard. +type EntityManagementProgressLevelDefinition struct { + // The level description. + Description string `json:"description,omitempty"` + // The hex code value for the color representing this level. + HexColorCode string `json:"hexColorCode,omitempty"` + // The id of the progress level this entity refers to. + ID string `json:"id"` + // The name of this level. + Name string `json:"name"` +} + +// EntityManagementRagDocumentEntity - A RAG Document +type EntityManagementRagDocumentEntity struct { + // The email addresses of authors not found in the organization + AuthorEmails []string `json:"authorEmails"` + // The blob representation of the document. + Blob EntityManagementBlob `json:"blob"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the document. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional source identifier that identifies where the document came from + SourceIdentifier string `json:"sourceIdentifier,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementRagDocumentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementRagToolEntity - A tool for use with NRAI +type EntityManagementRagToolEntity struct { + // The description of the tool. + Description string `json:"description"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the tool + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementRagToolEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementReactNativeSourcemapEntity - entityType for React native sourcemaps +type EntityManagementReactNativeSourcemapEntity struct { + // The version of the mobile application this source-map belongs to + AppVersionId string `json:"appVersionId"` + // The applicationId of the underlying mobile application this source-map belongs to + ApplicationID string `json:"applicationId"` + // The Blob associated to the entity. + Blob EntityManagementBlob `json:"blob,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // The unique identifier for the JS bundle built for the mobile application this source-map belongs to + JsBundleId string `json:"jsBundleId"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity(sourcemap). + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementReactNativeSourcemapEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementReference - Points to where the complete budget limit definition is stored in an external system. +type EntityManagementReference struct { + // The unique identifier of the budget limit within the specified location (e.g., 'coreCCU'). + ID string `json:"id"` + // The system or platform where the complete budget limit is stored (e.g., 'Limits Platform'). + Location string `json:"location"` +} + +// EntityManagementRepositoryLicense - License associated with the repository +type EntityManagementRepositoryLicense struct { + // License Name associated with the repository e.g:- MIT, GPL, apache2.0.. + Name EntityManagementLicenseName `json:"name"` + // License Url associated with the repository + URL string `json:"url,omitempty"` +} + +// EntityManagementRestAPIContractEntity - Entity of type RestApiContractEntity. +type EntityManagementRestAPIContractEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the Api Contract + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementRestAPIContractEntity) ImplementsEntityManagementAPICatalogAPIContract() {} + +func (x *EntityManagementRestAPIContractEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementRetentionPolicy - Retention policy for log data. +type EntityManagementRetentionPolicy struct { + // The duration value for retention. + Duration int `json:"duration"` + // The time unit for the retention duration. + Unit EntityManagementRetentionUnit `json:"unit"` +} + +// EntityManagementRetentionPolicyCreateInput - Create input for RetentionPolicy. +type EntityManagementRetentionPolicyCreateInput struct { + // See duration in RetentionPolicy. + Duration int `json:"duration"` + // See unit in RetentionPolicy. + Unit EntityManagementRetentionUnit `json:"unit"` +} + +// EntityManagementRetentionPolicyUpdateInput - Update input for RetentionPolicy. +type EntityManagementRetentionPolicyUpdateInput struct { + // See duration in RetentionPolicy. + Duration int `json:"duration"` + // See unit in RetentionPolicy. + Unit EntityManagementRetentionUnit `json:"unit"` +} + +// EntityManagementRingDeploymentTracker - A type for holding deployment status for a Ring +type EntityManagementRingDeploymentTracker struct { + // Rollout end time + CompletedAt *nrtime.EpochMilliseconds `json:"completedAt,omitempty"` + // Ring name + Name string `json:"name"` + // Rollout start time + StartedAt *nrtime.EpochMilliseconds `json:"startedAt,omitempty"` + // Ring deployment status + Status string `json:"status"` +} + +// EntityManagementRuleExecutionStatus - Rule execution status +type EntityManagementRuleExecutionStatus struct { + // Checked entities count + CheckedEntities int `json:"checkedEntities,omitempty"` + // The timestamp of rule execution + ExecutedAt *nrtime.EpochMilliseconds `json:"executedAt,omitempty"` + // List detailing issues encountered during the rule execution + ExecutionIssues []EntityManagementExecutionIssue `json:"executionIssues,omitempty"` + // The status of the execution of the rule + ExecutionStatus EntityManagementExecutionStatus `json:"executionStatus"` +} + +// EntityManagementSchedule - An attribute, that contains information about scheduler configuration +type EntityManagementSchedule struct { + // An optional field stating the status of the schedule + Enabled bool `json:"enabled,omitempty"` + // An optional ISO 8601 timestamp serving as the anchor for RRULE recurrence calculation. Defaults to current time if not provided + FirstRunAt nrtime.DateTime `json:"firstRunAt,omitempty"` + // An optional attribute unit is in minutes, with a minimum of 1 minute and a maximum of 1 year expressed in minutes + Period int `json:"period,omitempty"` + // An optional RFC 5545 RRULE string for complex, timezone-aware schedules (e.g., FREQ=MONTHLY;BYDAY=FR;BYSETPOS=-1). Mutually exclusive with period + Rrule string `json:"rrule,omitempty"` + // An optional attribute executes at once, with the date-time value in ISO 8601 format + ScheduleAt nrtime.DateTime `json:"scheduleAt,omitempty"` + // An optional IANA timezone identifier (e.g., America/New_York) for DST-aware schedule calculations. Defaults to Etc/UTC + Timezone string `json:"timezone,omitempty"` +} + +// EntityManagementScopedReference - An entity with scope. +type EntityManagementScopedReference struct { + // The unique reference identifier of the an object within the given scope + ID string `json:"id"` + // The scope of the entity + Type EntityManagementEntityScope `json:"type"` +} + +// EntityManagementScopedReferenceInput - Input for ScopedReference. +type EntityManagementScopedReferenceInput struct { + // See id in ScopedReference. + ID string `json:"id"` + // See type in ScopedReference. + Type EntityManagementEntityScope `json:"type"` +} + +// EntityManagementScorecardEntity - An entity with collection of scorecard rules. +type EntityManagementScorecardEntity struct { + // The scorecard description. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the scorecard. + Name string `json:"name"` + // Represents the different progress levels within a scorecard. A maximum of 5 progress levels are allowed. + ProgressLevels []EntityManagementProgressLevelDefinition `json:"progressLevels"` + // List of rules in the scorecard. + Rules EntityManagementCollectionEntity `json:"rules,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementScorecardEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementScorecardRuleEntity - An entity representing rule in scorecards. +type EntityManagementScorecardRuleEntity struct { + // The rule description. + Description string `json:"description,omitempty"` + // Is rule enabled. + Enabled bool `json:"enabled"` + // The entity's global unique identifier. + ID string `json:"id"` + // The weight this rule has on the overall Scorecard Score. This number is a whole integer with valid values from 1 to 100. + ImpactWeight int `json:"impactWeight,omitempty"` + // Last execution status of the rule + LastExecutionStatus EntityManagementRuleExecutionStatus `json:"lastExecutionStatus,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The NRQL rule engine. + NRQLEngine EntityManagementNRQLRuleEngine `json:"nrqlEngine"` + // A unique user provided name for the rule + Name string `json:"name"` + // The id of the progress level this rule falls in. This id must match one of the existing ids in the parent Scorecard levels field. + ProgressLevel string `json:"progressLevel,omitempty"` + // Schedule configuration of the rule: only period configuration is currently supported. + Schedule EntityManagementSchedule `json:"schedule,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementScorecardRuleEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementSecretReference - Secret reference type +type EntityManagementSecretReference struct { + // secret key name + KeyName string `json:"keyName"` + // namespace to store a secret + Namespace string `json:"namespace,omitempty"` +} + +// EntityManagementSegmentTermsEntity - Segment Terms for Mobile +type EntityManagementSegmentTermsEntity struct { + // Mobile/Browser app entity id associated with the Segment Terms + AppEntityId string `json:"appEntityId"` + // Channel associated with the Segment Terms + Channel EntityManagementChannelType `json:"channel"` + // Domain associated with the Segment Terms + Domain string `json:"domain"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Metric Prefix associated with the Segment Terms + MetricPrefix string `json:"metricPrefix"` + // The name of this entity. + Name string `json:"name"` + // Old Integer id for backward compatibility + OldId int `json:"oldId,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // Array of url segments as strings + URLSegments []string `json:"urlSegments"` +} + +func (x *EntityManagementSegmentTermsEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementServerlessJobDefinitionEntity - Represents a ServerlessJobDefinition entity for the Job Primitive platform. Defines runtime properties, compute requirements, health checks and other parameters required for running serverless jobs. +type EntityManagementServerlessJobDefinitionEntity struct { + // User provided description for the ServerlessJobDefinition. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the ServerlessJobDefinition, can be utilized for ServerlessJobDefinition querying. + Name string `json:"name"` + // Namespace corresponding to the onboarding team for the ServerlessJobDefinition. + Namespace string `json:"namespace"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Secret key names associated with the ServerlessJobDefinition for secure configuration. + SecretKeys []string `json:"secretKeys"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementServerlessJobDefinitionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementServiceNowAPIKeyCredential - Basic auth credential type for ServiceNow +type EntityManagementServiceNowAPIKeyCredential struct { + // The ServiceNow apiKey to authorize the API operations + APIKey EntityManagementSecretReference `json:"apiKey"` +} + +// EntityManagementServiceNowConnection - Connection entity type for ServiceNow +type EntityManagementServiceNowConnection struct { + // A single credential from the choice of ServiceNowCredential + Credential EntityManagementServiceNowCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. False by default. + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` + // The ServiceNow instance URL, for example https://your-instance.service-now.com + URL string `json:"url"` +} + +func (x *EntityManagementServiceNowConnection) ImplementsEntityManagementEntity() {} + +// EntityManagementServiceNowCredentials - Base credentials type for ServiceNow +type EntityManagementServiceNowCredentials struct { + // A simple basic auth credential + BasicAuth EntityManagementServiceNowAPIKeyCredential `json:"basicAuth,omitempty"` + // OAuth support + Oauth EntityManagementServiceNowOAuthCredential `json:"oauth,omitempty"` +} + +// EntityManagementServiceNowOAuthCredential - OAuth credential type for ServiceNow +type EntityManagementServiceNowOAuthCredential struct { + // The client ID for the OAuth request + ClientId string `json:"clientId"` + // The client secret for the OAuth request + ClientSecret EntityManagementSecretReference `json:"clientSecret"` + // The field name for the oauth token from the JSON response, default to access_token + TokenFieldName string `json:"tokenFieldName,omitempty"` + // The ServiceNow relative URL to get an oauth token, default to oauth_token.do + TokenRelativeURL string `json:"tokenRelativeUrl,omitempty"` +} + +// EntityManagementSignatureDetails - A set of signature details for a blob signature +type EntityManagementSignatureDetails struct { + // The checksum of the blob + Checksum string `json:"checksum,omitempty"` + // The checksum algorithm used to calculate the checksum of the blob content + ChecksumAlgorithm string `json:"checksumAlgorithm,omitempty"` + // Id for the key used for signing + KeyID string `json:"keyId,omitempty"` + // Signature of the blob + Signature string `json:"signature,omitempty"` + // Signature algorithm specification + SignatureSpecification string `json:"signatureSpecification,omitempty"` + // Algorithm used for signing + SigningAlgorithm string `json:"signingAlgorithm,omitempty"` + // Domain associated to the private key used for signing + SigningDomain string `json:"signingDomain,omitempty"` +} + +// EntityManagementSigningCredential - SigningCredential to verify incoming webhook request +type EntityManagementSigningCredential struct { + // Signing algorithm for verifying signature + SigningAlgorithm EntityManagementSigningAlgorithm `json:"signingAlgorithm"` + // The signing key to use for verifying signature + SigningKeyReference EntityManagementSecretReference `json:"signingKeyReference"` +} + +// EntityManagementSlackConnection - Connection entity type for Slack +type EntityManagementSlackConnection struct { + // The Slack Application ID + AppId string `json:"appId"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The entity’s scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // Slack bot token + Token EntityManagementSecretReference `json:"token"` + // The entity’s type. + Type string `json:"type"` + // Workspace name + Workspace string `json:"workspace"` +} + +func (x *EntityManagementSlackConnection) ImplementsEntityManagementEntity() {} + +// EntityManagementStatusPageAnnouncementEntity - An entity representing an end of life announcement published on a status page. +type EntityManagementStatusPageAnnouncementEntity struct { + // The entity category. + Category EntityManagementStatusPageAnnouncementCategory `json:"category"` + // Communications happened during the incident + CommunicationLogs []EntityManagementCommunicationLog `json:"communicationLogs,omitempty"` + // The incident description. + Description string `json:"description,omitempty"` + // Effective date time for the Announcement event + EffectiveDate *nrtime.EpochMilliseconds `json:"effectiveDate,omitempty"` + // Event URL for the announcement + EventURL string `json:"eventUrl,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Impact query for the announcement + ImpactQuery EntityManagementImpactQuery `json:"impactQuery,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Name for the event. + Name string `json:"name"` + // Valid User entities of PMs / Engineering point of contacts + PointOfContacts []EntityManagementUserEntity `json:"pointOfContacts"` + // Announcement event published date time + PublishedDate *nrtime.EpochMilliseconds `json:"publishedDate,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The state of an announcement + State EntityManagementStatusPageAnnouncementState `json:"state"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementStatusPageAnnouncementEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementStatusPageIncidentEntity - An entity representing an incident published on a status page. +type EntityManagementStatusPageIncidentEntity struct { + // Communications happened during the incident + CommunicationLogs []EntityManagementCommunicationLog `json:"communicationLogs"` + // The incident description. + Description string `json:"description,omitempty"` + // Incident end time + EndTime *nrtime.EpochMilliseconds `json:"endTime,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Incident Id + IncidentId string `json:"incidentId"` + // Incident title + IncidentTitle string `json:"incidentTitle"` + // Incident last updated time + LastUpdatedTime *nrtime.EpochMilliseconds `json:"lastUpdatedTime,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // A unique user provided name for the incident. + Name string `json:"name"` + // Incident impact region + Region []EntityManagementRegion `json:"region"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Incident start time + StartTime *nrtime.EpochMilliseconds `json:"startTime,omitempty"` + // The incident status. + Status EntityManagementIncidentStatus `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementStatusPageIncidentEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementStringCondition - String condition type. +type EntityManagementStringCondition struct { + // String condition type operator. + Operator EntityManagementStringOperator `json:"operator"` + // Value to compare against. + Value string `json:"value"` +} + +// EntityManagementSyncGroupRule - Rule to create teams from groups. +type EntityManagementSyncGroupRule struct { + // The conditions of the rule. + Conditions []EntityManagementSyncGroupRuleCondition `json:"conditions"` +} + +// EntityManagementSyncGroupRuleCondition - Sync group rule condition. +type EntityManagementSyncGroupRuleCondition struct { + // The condition type. + Type EntityManagementSyncGroupRuleConditionType `json:"type"` + // The value to match. + Value string `json:"value"` +} + +// EntityManagementSyncGroupsSettings - Groups sync related settings. +type EntityManagementSyncGroupsSettings struct { + // If sync groups is enabled for that organization or not. + Enabled bool `json:"enabled"` + // The rules to create teams from groups. + Rules []EntityManagementSyncGroupRule `json:"rules"` +} + +// EntityManagementSynchronizedGitHubTeams - Type for SynchronizedGitHubTeams +type EntityManagementSynchronizedGitHubTeams struct { + // A list of GitHub teams selected by the customer + Teams []EntityManagementGitHubTeam `json:"teams"` +} + +// EntityManagementSystemActor - A system actor. +type EntityManagementSystemActor struct { + // Id of the actor. + ID string `json:"id"` +} + +func (x *EntityManagementSystemActor) ImplementsEntityManagementActor() {} + +// EntityManagementTag - An entity tag. +type EntityManagementTag struct { + // The key or name of the tag. + Key string `json:"key"` + // The list of values of the tag. + Values []string `json:"values"` +} + +// EntityManagementTagInput - Input for tags. +type EntityManagementTagInput struct { + // The key or name of the tag. + Key string `json:"key"` + // The list of values of the tag. + Values []string `json:"values"` +} + +// EntityManagementTeamEntity - An entity representing a New Relic Team. +type EntityManagementTeamEntity struct { + // List of aliases associated to the team. + Aliases []string `json:"aliases"` + // Further information about team. + Description string `json:"description,omitempty"` + // External Integration with another system. + ExternalIntegration EntityManagementTeamExternalIntegration `json:"externalIntegration,omitempty"` + // The hierarchy level the team belongs to. + HierarchyLevelId string `json:"hierarchyLevelId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // The managers or contact persons for the team. + Managers []string `json:"managers"` + // Collection that contains the list of members belonging to the team. + Membership EntityManagementCollectionEntity `json:"membership,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // Collection that contains the list of entities owned by the team. + Ownership EntityManagementCollectionEntity `json:"ownership,omitempty"` + // The parent team in the hierarchy. + ParentId string `json:"parentId,omitempty"` + // List of resources attached to the team. + Resources []EntityManagementTeamResource `json:"resources"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementTeamEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementTeamExternalIntegration - Integration with an external system. +type EntityManagementTeamExternalIntegration struct { + // The id in the external system. + ExternalId string `json:"externalId"` + // The type of the Integration. + Type EntityManagementTeamExternalIntegrationType `json:"type,omitempty"` +} + +// EntityManagementTeamResource - Any extra information attached to a Team. +type EntityManagementTeamResource struct { + // Holds the content of the resource. + Content string `json:"content"` + // Main text for the resource, use the content if null. + Title string `json:"title,omitempty"` + // Type of resource, the UI might be enriched based on the value. + Type string `json:"type"` +} + +// EntityManagementTeamsHierarchyLevelEntity - A teams hierarchy level for the organization. +type EntityManagementTeamsHierarchyLevelEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // List of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementTeamsHierarchyLevelEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementTeamsOrganizationSettingsEntity - Teams global settings per organization. +type EntityManagementTeamsOrganizationSettingsEntity struct { + // Discovery settings. + Discovery EntityManagementDiscoverySettings `json:"discovery,omitempty"` + // The order of the teams hierarchy levels for the organization. + HierarchyLevelOrder []string `json:"hierarchyLevelOrder"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Sync groups settings. + SyncGroups EntityManagementSyncGroupsSettings `json:"syncGroups,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementTeamsOrganizationSettingsEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementTemplateFieldType - Mapping from the Work Item entity to the third party app fields +type EntityManagementTemplateFieldType struct { + // Sync direction of the field: OUTBOUND, INBOUND + Direction EntityManagementSyncDirection `json:"direction"` + // The name of the external system field + Name string `json:"name"` + // Indicate if the field is required + Required bool `json:"required,omitempty"` + // Specify how to map from a Work Item using handlebar + Template string `json:"template,omitempty"` +} + +// EntityManagementTokenTextSplitterOptions - The TokenTextSplitter options +type EntityManagementTokenTextSplitterOptions struct { + // Encoding to token splitter + EncodingName EntityManagementEncodingName `json:"encodingName"` +} + +// EntityManagementUserActor - A user actor. +type EntityManagementUserActor struct { + // Id of the actor. + ID string `json:"id"` +} + +func (x *EntityManagementUserActor) ImplementsEntityManagementActor() {} + +// EntityManagementUserEntity - An entity representing a New Relic User. +type EntityManagementUserEntity struct { + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // User domain identifier. + UserID int `json:"userId"` +} + +func (x *EntityManagementUserEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementUserMetadata - Deprecated: User Metadata +type EntityManagementUserMetadata struct { + // The object creation time. + CreatedAt *nrtime.EpochMilliseconds `json:"createdAt,omitempty"` + // The object last update time. + UpdatedAt *nrtime.EpochMilliseconds `json:"updatedAt,omitempty"` + // User ID that created this object. + UserID string `json:"userId,omitempty"` +} + +// EntityManagementUsers - Object containing user limit configuration. +type EntityManagementUsers struct { + // True if this is a global/default user budget, false otherwise. + AppliesToAll bool `json:"appliesToAll"` + // Array of all users whose resource consumption limits are managed by this specific Budget Entity instance. + Items []EntityManagementBudgetUser `json:"items"` +} + +// EntityManagementWorkItemAssignment - Represents the assigned entity of a work item, typically a user +type EntityManagementWorkItemAssignment struct { + // Depends on the type, for New Relic user this is a userID + Identifier string `json:"identifier"` + // Work item assignment type: NEW_RELIC_USER_ID, NEW_RELIC_TEAM_ID + Type EntityManagementAssignmentType `json:"type"` +} + +// EntityManagementWorkItemAttribute - Work Item attribute type +type EntityManagementWorkItemAttribute struct { + // The name of the attribute + Name string `json:"name"` + // The value of the attribute + Value string `json:"value"` +} + +// EntityManagementWorkItemLinkV2 - Work Item Link interface +type EntityManagementWorkItemLinkV2 struct { + // External identifier for the work item link + ExternalId string `json:"externalId,omitempty"` + // Indicates which syncConfigurationId if any created this link + SourceSyncConfigurationId string `json:"sourceSyncConfigurationId,omitempty"` + // URL of the work item link + URL string `json:"url"` +} + +func (x *EntityManagementWorkItemLinkV2) ImplementsEntityManagementWorkItemLinkV2() {} + +// EntityManagementWorkItemLinkV2Entity - Work Item Link entity type +type EntityManagementWorkItemLinkV2Entity struct { + // External identifier for the work item link + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Indicates which syncConfigurationId if any created this link. Creation managed internally from INBOUND sync + SourceSyncConfigurationId string `json:"sourceSyncConfigurationId,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // URL of the work item link + URL string `json:"url"` +} + +func (x *EntityManagementWorkItemLinkV2Entity) ImplementsEntityManagementEntity() {} + +func (x *EntityManagementWorkItemLinkV2Entity) ImplementsEntityManagementWorkItemLinkV2() {} + +// EntityManagementWorkItemMessageV2 - Work Item Message interface +type EntityManagementWorkItemMessageV2 struct { + // The message content + Content string `json:"content"` + // The message encoding: UTF8(default), BASE64 + ContentEncoding EntityManagementEncodingType `json:"contentEncoding"` + // The message type: TEXT(default), JSON, YAML + ContentType EntityManagementMessageType `json:"contentType"` + // Optional field representing an identifier managed by the consumer. + ExternalId string `json:"externalId,omitempty"` + // Optional id of the WorkItemMessage parent. This can be used to implement a replyTo functionality. + ParentId string `json:"parentId,omitempty"` + // Optional (internal readonly), indicate which syncConfigurationId if any created this message + SourceSyncConfigurationId string `json:"sourceSyncConfigurationId,omitempty"` +} + +func (x *EntityManagementWorkItemMessageV2) ImplementsEntityManagementWorkItemMessageV2() {} + +// EntityManagementWorkItemMessageV2Entity - Work Item Message entity type +type EntityManagementWorkItemMessageV2Entity struct { + // The message content + Content string `json:"content"` + // The message encoding: UTF8(default), BASE64 + ContentEncoding EntityManagementEncodingType `json:"contentEncoding"` + // The message type: TEXT(default), JSON, YAML + ContentType EntityManagementMessageType `json:"contentType"` + // Optional field representing an identifier managed by the consumer. There is no unique constraint enforced since the field is optional with non unique default value (null). + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // Optional id of the WorkItemMessage parent. This can be used to implement a replyTo functionality. + ParentId string `json:"parentId,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional (internal readonly), indicate which syncConfigurationId if any created this message. Creation managed internally from INBOUND sync + SourceSyncConfigurationId string `json:"sourceSyncConfigurationId,omitempty"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementWorkItemMessageV2Entity) ImplementsEntityManagementEntity() {} + +func (x *EntityManagementWorkItemMessageV2Entity) ImplementsEntityManagementWorkItemMessageV2() {} + +// EntityManagementWorkItemV2 - Work Item V2 interface +type EntityManagementWorkItemV2 struct { + // Assigned entity of a work item + AssignedTo EntityManagementWorkItemAssignment `json:"assignedTo"` + // Collection of Work Item attributes + Attributes []EntityManagementWorkItemAttribute `json:"attributes"` + // Category of the Work Item + Category EntityManagementWorkItemCategory `json:"category,omitempty"` + // Description of the Work Item + Description string `json:"description,omitempty"` + // Optional Epoch timestamp in milliseconds to indicate a potential due date. + DueDate *nrtime.EpochMilliseconds `json:"dueDate,omitempty"` + // Represents an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // Optional list of label as alphanumeric string. + Labels []string `json:"labels"` + // Collection of Work Item Links + Links EntityManagementCollectionEntity `json:"links,omitempty"` + // Collection of Work Item messages + Messages EntityManagementCollectionEntity `json:"messages,omitempty"` + // Priority of the work item + Priority EntityManagementWorkItemPriority `json:"priority"` + // Status of the work item: OPEN, CLOSED + Status string `json:"status"` +} + +func (x *EntityManagementWorkItemV2) ImplementsEntityManagementWorkItemV2() {} + +// EntityManagementWorkItemV2Entity - Work Item entity type +type EntityManagementWorkItemV2Entity struct { + // Assigned entity of a work item + AssignedTo EntityManagementWorkItemAssignment `json:"assignedTo"` + // Collection of Work Item attributes + Attributes []EntityManagementWorkItemAttribute `json:"attributes"` + // Category of the Work Item. Can set a different value on Create, cannot change on Update + Category EntityManagementWorkItemCategory `json:"category,omitempty"` + // Description of the Work Item + Description string `json:"description,omitempty"` + // Optional Epoch timestamp in milliseconds to indicate a potential due date. + DueDate *nrtime.EpochMilliseconds `json:"dueDate,omitempty"` + // Represents an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Optional list of label as alphanumeric string. + Labels []string `json:"labels"` + // Collection of Work Item Links + Links EntityManagementCollectionEntity `json:"links,omitempty"` + // Collection of Work Item messages + Messages EntityManagementCollectionEntity `json:"messages,omitempty"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of this entity. + Name string `json:"name"` + // Priority of the work item + Priority EntityManagementWorkItemPriority `json:"priority"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Status of the work item + Status string `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementWorkItemV2Entity) ImplementsEntityManagementEntity() {} + +func (x *EntityManagementWorkItemV2Entity) ImplementsEntityManagementWorkItemV2() {} + +// EntityManagementWorkflowDefinition - Represents a workflow definition entity +type EntityManagementWorkflowDefinition struct { + // An optional description of the workflow definition + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Unique name of the workflow definition + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` + // An array of all the Versions of that definition + Versions []int `json:"versions"` +} + +func (x *EntityManagementWorkflowDefinition) ImplementsEntityManagementEntity() {} + +// EntityManagementWorkflowDefinitionVersion - Represents a Workflow Definition version, uniquely identified by a combination of Workflow Definition ID and version number +type EntityManagementWorkflowDefinitionVersion struct { + // The Workflow Definition ID + ID string `json:"id"` + // The Workflow Definition Version Number + Version int `json:"version"` +} + +// EntityManagementWorkflowSchedule - Represents a workflow schedule entity +type EntityManagementWorkflowSchedule struct { + // The cron expression that defines the schedule + CronExpression string `json:"cronExpression"` + // The Workflow Definition Version that this schedule is for + Definition EntityManagementWorkflowDefinitionVersion `json:"definition"` + // An optional description of the workflow schedule + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // Workflow Schedule name + Name string `json:"name"` + // Overlap policy for the workflow schedule + OverlapPolicy EntityManagementOverlapPolicy `json:"overlapPolicy"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // An optional timezone of the workflow schedule. + Timezone string `json:"timezone,omitempty"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementWorkflowSchedule) ImplementsEntityManagementEntity() {} + +// EntityManagementZoomAccountOAuthCredential - Account OAuth credential type for Zoom +type EntityManagementZoomAccountOAuthCredential struct { + // The access token for the OAuth request + AccessToken EntityManagementSecretReference `json:"accessToken"` + // Zoom account ID associated with this credential + AccountID string `json:"accountId"` + // The client ID for the OAuth request + ClientId string `json:"clientId"` + // The client secret for the OAuth request + ClientSecret EntityManagementSecretReference `json:"clientSecret"` + // Expiration time for the access token + TokenExpirationTime *nrtime.EpochMilliseconds `json:"tokenExpirationTime"` +} + +// EntityManagementZoomConnectionEntity - Connection entity type for Zoom +type EntityManagementZoomConnectionEntity struct { + // A single credential from the choice of ZoomCredential + Credential EntityManagementZoomCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. False by default. + Enabled bool `json:"enabled,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Array of up to 2 SigningCredential to verify incoming requests, and rotate new signing credentials when needed + SigningCredentials []EntityManagementSigningCredential `json:"signingCredentials"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` +} + +func (x *EntityManagementZoomConnectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementZoomCredentials - Base credentials type for Zoom +type EntityManagementZoomCredentials struct { + // Account OAuth support + AccountOAuth EntityManagementZoomAccountOAuthCredential `json:"accountOAuth,omitempty"` + // User OAuth support + UserOAuth EntityManagementZoomUserOAuthCredential `json:"userOAuth,omitempty"` +} + +// EntityManagementZoomUserOAuthCredential - User OAuth credential type for Zoom +type EntityManagementZoomUserOAuthCredential struct { + // The access token for the OAuth request + AccessToken EntityManagementSecretReference `json:"accessToken"` + // Expiration time for the access token + AccessTokenExpirationTime *nrtime.EpochMilliseconds `json:"accessTokenExpirationTime"` + // The client ID for the OAuth request + ClientId string `json:"clientId"` + // The client secret for the OAuth request + ClientSecret EntityManagementSecretReference `json:"clientSecret"` + // The refresh token for the OAuth request + RefreshToken EntityManagementSecretReference `json:"refreshToken"` + // Zoom user ID associated with this credential + UserID string `json:"userId"` +} + +// Duration - The `Duration` scalar represents a period of time. A `Duration` appears as an ISO8601 formatted duration string. +type Duration string + +// EntityManagementDynamicString - A string meant to be generated at runtime by a function in the form of a directive. +type EntityManagementDynamicString string + +// Float - The `Float` scalar type represents signed double-precision fractional +// values as specified by +// [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). +type Float string + +// EntityManagementAPICatalogAPIContract - Interface for Api Contract entities +type EntityManagementAPICatalogAPIContractInterface interface { + ImplementsEntityManagementAPICatalogAPIContract() +} + +// UnmarshalEntityManagementAPICatalogAPIContractInterface unmarshals the interface into the correct type +// based on __typename provided by GraphQL +func UnmarshalEntityManagementAPICatalogAPIContractInterface(b []byte) (*EntityManagementAPICatalogAPIContractInterface, error) { + var err error + + var rawMessageEntityManagementAPICatalogAPIContract map[string]*json.RawMessage + err = json.Unmarshal(b, &rawMessageEntityManagementAPICatalogAPIContract) + if err != nil { + return nil, err + } + + // Nothing to unmarshal + if len(rawMessageEntityManagementAPICatalogAPIContract) < 1 { + return nil, nil + } + + var typeName string + + if rawTypeName, ok := rawMessageEntityManagementAPICatalogAPIContract["__typename"]; ok { + err = json.Unmarshal(*rawTypeName, &typeName) + if err != nil { + return nil, err + } + + switch typeName { + case "EntityManagementRestApiContractEntity": + var interfaceType EntityManagementRestAPIContractEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementAPICatalogAPIContractInterface = &interfaceType + + return &xxx, nil + } + } else { + keys := []string{} + for k := range rawMessageEntityManagementAPICatalogAPIContract { + keys = append(keys, k) + } + return nil, fmt.Errorf("interface EntityManagementAPICatalogAPIContract did not include a __typename field for inspection: %s", keys) + } + + return nil, fmt.Errorf("interface EntityManagementAPICatalogAPIContract was not matched against all PossibleTypes: %s", typeName) +} + +// EntityManagementActor - Represents an actor. +type EntityManagementActorInterface interface { + ImplementsEntityManagementActor() +} + +// UnmarshalEntityManagementActorInterface unmarshals the interface into the correct type +// based on __typename provided by GraphQL +func UnmarshalEntityManagementActorInterface(b []byte) (*EntityManagementActorInterface, error) { + var err error + + var rawMessageEntityManagementActor map[string]*json.RawMessage + err = json.Unmarshal(b, &rawMessageEntityManagementActor) + if err != nil { + return nil, err + } + + // Nothing to unmarshal + if len(rawMessageEntityManagementActor) < 1 { + return nil, nil + } + + var typeName string + + if rawTypeName, ok := rawMessageEntityManagementActor["__typename"]; ok { + err = json.Unmarshal(*rawTypeName, &typeName) + if err != nil { + return nil, err + } + + switch typeName { + case "EntityManagementSystemActor": + var interfaceType EntityManagementSystemActor + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementActorInterface = &interfaceType + + return &xxx, nil + case "EntityManagementUserActor": + var interfaceType EntityManagementUserActor + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementActorInterface = &interfaceType + + return &xxx, nil + } + } else { + keys := []string{} + for k := range rawMessageEntityManagementActor { + keys = append(keys, k) + } + return nil, fmt.Errorf("interface EntityManagementActor did not include a __typename field for inspection: %s", keys) + } + + return nil, fmt.Errorf("interface EntityManagementActor was not matched against all PossibleTypes: %s", typeName) +} + +// EntityManagementEntity - The Entity interface. +type EntityManagementEntityInterface interface { + ImplementsEntityManagementEntity() +} + +// UnmarshalEntityManagementEntityInterface unmarshals the interface into the correct type +// based on __typename provided by GraphQL +func UnmarshalEntityManagementEntityInterface(b []byte) (*EntityManagementEntityInterface, error) { + var err error + + var rawMessageEntityManagementEntity map[string]*json.RawMessage + err = json.Unmarshal(b, &rawMessageEntityManagementEntity) + if err != nil { + return nil, err + } + + // Nothing to unmarshal + if len(rawMessageEntityManagementEntity) < 1 { + return nil, nil + } + + var typeName string + + if rawTypeName, ok := rawMessageEntityManagementEntity["__typename"]; ok { + err = json.Unmarshal(*rawTypeName, &typeName) + if err != nil { + return nil, err + } + + switch typeName { + case "EntityManagementAgentConfigurationEntity": + var interfaceType EntityManagementAgentConfigurationEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAgentConfigurationVersionEntity": + var interfaceType EntityManagementAgentConfigurationVersionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAgentEffectiveConfigurationEntity": + var interfaceType EntityManagementAgentEffectiveConfigurationEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAgentEntity": + var interfaceType EntityManagementAgentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAiAgentEntity": + var interfaceType EntityManagementAiAgentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAiCapableEntity": + var interfaceType EntityManagementAiCapableEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAiEvaluationConfigEntity": + var interfaceType EntityManagementAiEvaluationConfigEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAiToolEntity": + var interfaceType EntityManagementAiToolEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementApiSpecificationBlobEntity": + var interfaceType EntityManagementAPISpecificationBlobEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementAwsConnectionEntity": + var interfaceType EntityManagementAwsConnectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementBackgroundProcessingRuleEntity": + var interfaceType EntityManagementBackgroundProcessingRuleEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementBackgroundSqlProcessingRuleEntity": + var interfaceType EntityManagementBackgroundSqlProcessingRuleEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementBudgetEntity": + var interfaceType EntityManagementBudgetEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCiscoMerakiConnectionEntity": + var interfaceType EntityManagementCiscoMerakiConnectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCollectionEntity": + var interfaceType EntityManagementCollectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementComponentEntity": + var interfaceType EntityManagementComponentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementComputeLocationEntity": + var interfaceType EntityManagementComputeLocationEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementConfluenceConnectionEntity": + var interfaceType EntityManagementConfluenceConnectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementConfluenceIntegration": + var interfaceType EntityManagementConfluenceIntegration + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementConfluenceRagSettingsEntity": + var interfaceType EntityManagementConfluenceRagSettingsEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCorrelationInternalSourceConfigEntity": + var interfaceType EntityManagementCorrelationInternalSourceConfigEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCorrelationLinkEntity": + var interfaceType EntityManagementCorrelationLinkEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCorrelationLinkingRuleEntity": + var interfaceType EntityManagementCorrelationLinkingRuleEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCustomEvaluationEntity": + var interfaceType EntityManagementCustomEvaluationEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCustomerImpactEntity": + var interfaceType EntityManagementCustomerImpactEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementCustomerImpactQueryEntity": + var interfaceType EntityManagementCustomerImpactQueryEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementEventBridgeRuleEntity": + var interfaceType EntityManagementEventBridgeRuleEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFederatedLogPartitionEntity": + var interfaceType EntityManagementFederatedLogPartitionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFederatedLogSetupEntity": + var interfaceType EntityManagementFederatedLogSetupEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFleetDeploymentEntity": + var interfaceType EntityManagementFleetDeploymentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFleetEntity": + var interfaceType EntityManagementFleetEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFleetRingEntity": + var interfaceType EntityManagementFleetRingEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFlowEntity": + var interfaceType EntityManagementFlowEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementGenericEntity": + var interfaceType EntityManagementGenericEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementGitHubIntegrationEntity": + var interfaceType EntityManagementGitHubIntegrationEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementGitRepositoryEntity": + var interfaceType EntityManagementGitRepositoryEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementGithubConnection": + var interfaceType EntityManagementGithubConnection + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementImpactProfileEntity": + var interfaceType EntityManagementImpactProfileEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementInboxIssueCategoryEntity": + var interfaceType EntityManagementInboxIssueCategoryEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentAttachmentEntity": + var interfaceType EntityManagementIncidentAttachmentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentEntity": + var interfaceType EntityManagementIncidentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentLinkEntity": + var interfaceType EntityManagementIncidentLinkEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentMessageEntity": + var interfaceType EntityManagementIncidentMessageEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentProfileAttachmentEntity": + var interfaceType EntityManagementIncidentProfileAttachmentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentProfileEntity": + var interfaceType EntityManagementIncidentProfileEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementIncidentTimelineEntity": + var interfaceType EntityManagementIncidentTimelineEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementJiraConnection": + var interfaceType EntityManagementJiraConnection + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementJiraSyncConfigurationV2Entity": + var interfaceType EntityManagementJiraSyncConfigurationV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementJuniperMistConnectionEntity": + var interfaceType EntityManagementJuniperMistConnectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementMaintenanceWindowEntity": + var interfaceType EntityManagementMaintenanceWindowEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementManagedEvaluationsEntity": + var interfaceType EntityManagementManagedEvaluationsEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementMcpServerEntity": + var interfaceType EntityManagementMcpServerEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementMeterEntity": + var interfaceType EntityManagementMeterEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementMeterTypeEntity": + var interfaceType EntityManagementMeterTypeEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementNewRelicConnection": + var interfaceType EntityManagementNewRelicConnection + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementNotebookEntity": + var interfaceType EntityManagementNotebookEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementNotificationAttachmentEntity": + var interfaceType EntityManagementNotificationAttachmentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementNrAiAgentEntity": + var interfaceType EntityManagementNrAiAgentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementNrqlMacroEntity": + var interfaceType EntityManagementNRQLMacroEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementOperationEntity": + var interfaceType EntityManagementOperationEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementOperationMetricEntity": + var interfaceType EntityManagementOperationMetricEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementPerformanceInboxSettingEntity": + var interfaceType EntityManagementPerformanceInboxSettingEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementPipelineCloudRuleEntity": + var interfaceType EntityManagementPipelineCloudRuleEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementProductLineEntity": + var interfaceType EntityManagementProductLineEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementRagDocumentEntity": + var interfaceType EntityManagementRagDocumentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementRagToolEntity": + var interfaceType EntityManagementRagToolEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementReactNativeSourcemapEntity": + var interfaceType EntityManagementReactNativeSourcemapEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementRestApiContractEntity": + var interfaceType EntityManagementRestAPIContractEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementScorecardEntity": + var interfaceType EntityManagementScorecardEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementScorecardRuleEntity": + var interfaceType EntityManagementScorecardRuleEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementSegmentTermsEntity": + var interfaceType EntityManagementSegmentTermsEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementServerlessJobDefinitionEntity": + var interfaceType EntityManagementServerlessJobDefinitionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementServiceNowConnection": + var interfaceType EntityManagementServiceNowConnection + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementSlackConnection": + var interfaceType EntityManagementSlackConnection + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementStatusPageAnnouncementEntity": + var interfaceType EntityManagementStatusPageAnnouncementEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementStatusPageIncidentEntity": + var interfaceType EntityManagementStatusPageIncidentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementTeamEntity": + var interfaceType EntityManagementTeamEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementTeamsHierarchyLevelEntity": + var interfaceType EntityManagementTeamsHierarchyLevelEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementTeamsOrganizationSettingsEntity": + var interfaceType EntityManagementTeamsOrganizationSettingsEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementUserEntity": + var interfaceType EntityManagementUserEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementWorkItemLinkV2Entity": + var interfaceType EntityManagementWorkItemLinkV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementWorkItemMessageV2Entity": + var interfaceType EntityManagementWorkItemMessageV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementWorkItemV2Entity": + var interfaceType EntityManagementWorkItemV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementWorkflowDefinition": + var interfaceType EntityManagementWorkflowDefinition + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementWorkflowSchedule": + var interfaceType EntityManagementWorkflowSchedule + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementZoomConnectionEntity": + var interfaceType EntityManagementZoomConnectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + } + } else { + keys := []string{} + for k := range rawMessageEntityManagementEntity { + keys = append(keys, k) + } + return nil, fmt.Errorf("interface EntityManagementEntity did not include a __typename field for inspection: %s", keys) + } + + return nil, fmt.Errorf("interface EntityManagementEntity was not matched against all PossibleTypes: %s", typeName) +} + +// EntityManagementWorkItemLinkV2 - Work Item Link interface +type EntityManagementWorkItemLinkV2Interface interface { + ImplementsEntityManagementWorkItemLinkV2() +} + +// UnmarshalEntityManagementWorkItemLinkV2Interface unmarshals the interface into the correct type +// based on __typename provided by GraphQL +func UnmarshalEntityManagementWorkItemLinkV2Interface(b []byte) (*EntityManagementWorkItemLinkV2Interface, error) { + var err error + + var rawMessageEntityManagementWorkItemLinkV2 map[string]*json.RawMessage + err = json.Unmarshal(b, &rawMessageEntityManagementWorkItemLinkV2) + if err != nil { + return nil, err + } + + // Nothing to unmarshal + if len(rawMessageEntityManagementWorkItemLinkV2) < 1 { + return nil, nil + } + + var typeName string + + if rawTypeName, ok := rawMessageEntityManagementWorkItemLinkV2["__typename"]; ok { + err = json.Unmarshal(*rawTypeName, &typeName) + if err != nil { + return nil, err + } + + switch typeName { + case "EntityManagementWorkItemLinkV2Entity": + var interfaceType EntityManagementWorkItemLinkV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementWorkItemLinkV2Interface = &interfaceType + + return &xxx, nil + } + } else { + keys := []string{} + for k := range rawMessageEntityManagementWorkItemLinkV2 { + keys = append(keys, k) + } + return nil, fmt.Errorf("interface EntityManagementWorkItemLinkV2 did not include a __typename field for inspection: %s", keys) + } + + return nil, fmt.Errorf("interface EntityManagementWorkItemLinkV2 was not matched against all PossibleTypes: %s", typeName) +} + +// EntityManagementWorkItemMessageV2 - Work Item Message interface +type EntityManagementWorkItemMessageV2Interface interface { + ImplementsEntityManagementWorkItemMessageV2() +} + +// UnmarshalEntityManagementWorkItemMessageV2Interface unmarshals the interface into the correct type +// based on __typename provided by GraphQL +func UnmarshalEntityManagementWorkItemMessageV2Interface(b []byte) (*EntityManagementWorkItemMessageV2Interface, error) { + var err error + + var rawMessageEntityManagementWorkItemMessageV2 map[string]*json.RawMessage + err = json.Unmarshal(b, &rawMessageEntityManagementWorkItemMessageV2) + if err != nil { + return nil, err + } + + // Nothing to unmarshal + if len(rawMessageEntityManagementWorkItemMessageV2) < 1 { + return nil, nil + } + + var typeName string + + if rawTypeName, ok := rawMessageEntityManagementWorkItemMessageV2["__typename"]; ok { + err = json.Unmarshal(*rawTypeName, &typeName) + if err != nil { + return nil, err + } + + switch typeName { + case "EntityManagementWorkItemMessageV2Entity": + var interfaceType EntityManagementWorkItemMessageV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementWorkItemMessageV2Interface = &interfaceType + + return &xxx, nil + } + } else { + keys := []string{} + for k := range rawMessageEntityManagementWorkItemMessageV2 { + keys = append(keys, k) + } + return nil, fmt.Errorf("interface EntityManagementWorkItemMessageV2 did not include a __typename field for inspection: %s", keys) + } + + return nil, fmt.Errorf("interface EntityManagementWorkItemMessageV2 was not matched against all PossibleTypes: %s", typeName) +} + +// EntityManagementWorkItemV2 - Work Item V2 interface +type EntityManagementWorkItemV2Interface interface { + ImplementsEntityManagementWorkItemV2() +} + +// UnmarshalEntityManagementWorkItemV2Interface unmarshals the interface into the correct type +// based on __typename provided by GraphQL +func UnmarshalEntityManagementWorkItemV2Interface(b []byte) (*EntityManagementWorkItemV2Interface, error) { + var err error + + var rawMessageEntityManagementWorkItemV2 map[string]*json.RawMessage + err = json.Unmarshal(b, &rawMessageEntityManagementWorkItemV2) + if err != nil { + return nil, err + } + + // Nothing to unmarshal + if len(rawMessageEntityManagementWorkItemV2) < 1 { + return nil, nil + } + + var typeName string + + if rawTypeName, ok := rawMessageEntityManagementWorkItemV2["__typename"]; ok { + err = json.Unmarshal(*rawTypeName, &typeName) + if err != nil { + return nil, err + } + + switch typeName { + case "EntityManagementIncidentEntity": + var interfaceType EntityManagementIncidentEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementWorkItemV2Interface = &interfaceType + + return &xxx, nil + case "EntityManagementWorkItemV2Entity": + var interfaceType EntityManagementWorkItemV2Entity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementWorkItemV2Interface = &interfaceType + + return &xxx, nil + } + } else { + keys := []string{} + for k := range rawMessageEntityManagementWorkItemV2 { + keys = append(keys, k) + } + return nil, fmt.Errorf("interface EntityManagementWorkItemV2 did not include a __typename field for inspection: %s", keys) + } + + return nil, fmt.Errorf("interface EntityManagementWorkItemV2 was not matched against all PossibleTypes: %s", typeName) +} diff --git a/pkg/pipelinecontrol/pipelinecontrol_api.go b/pkg/pipelinecontrol/pipelinecontrol_api.go index d161d2e85..8e7374db0 100644 --- a/pkg/pipelinecontrol/pipelinecontrol_api.go +++ b/pkg/pipelinecontrol/pipelinecontrol_api.go @@ -245,6 +245,7 @@ const getEntityQuery = `query( ) { actor { entityManagement { entity( id: $id, ) { + __typename id metadata { createdAt @@ -319,6 +320,128 @@ const getEntityQuery = `query( values } } + ... on EntityManagementFederatedLogSetupEntity { + __typename + cloudProvider + cloudProviderRegion + dataLocationBucket + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + description + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + nrAccountId + nrRegion + queryConnection { + __typename + id + name + type + } + scope { + id + type + } + setupStatus: status + tags { + key + values + } + } + ... on EntityManagementAwsConnectionEntity { + __typename + credential { + assumeRole { + externalId + roleArn + } + } + description + enabled + externalId + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + region + scope { + id + type + } + settings { + key + value + } + tags { + key + values + } + } + ... on EntityManagementFederatedLogPartitionEntity { + __typename + dataLocationURI + description + isDefault + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + nrAccountId + partitionDatabase + partitionTable + retentionPolicy { + duration + unit + } + scope { + id + type + } + partitionStatus: status + tags { + key + values + } + } } } } }` // Retrieves a set of entities that match the given query predicate. @@ -433,6 +556,636 @@ const getEntitySearchQuery = `query( values } } + ... on EntityManagementFederatedLogSetupEntity { + __typename + cloudProvider + cloudProviderRegion + dataLocationBucket + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + description + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + nrAccountId + nrRegion + queryConnection { + __typename + id + name + type + } + scope { + id + type + } + setupStatus: status + tags { + key + values + } + } + ... on EntityManagementAwsConnectionEntity { + __typename + credential { + assumeRole { + externalId + roleArn + } + } + description + enabled + externalId + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + region + scope { + id + type + } + settings { + key + value + } + tags { + key + values + } + } + ... on EntityManagementFederatedLogPartitionEntity { + __typename + dataLocationURI + description + isDefault + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + nrAccountId + partitionDatabase + partitionTable + retentionPolicy { + duration + unit + } + scope { + id + type + } + partitionStatus: status + tags { + key + values + } + } } nextCursor } } } }` + +// Creates an entity of type FederatedLogSetupEntity. +func (a *Pipelinecontrol) EntityManagementCreateFederatedLogSetup( + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityCreateInput, +) (*EntityManagementFederatedLogSetupEntityCreateResult, error) { + return a.EntityManagementCreateFederatedLogSetupWithContext(context.Background(), + federatedLogSetupEntity, + ) +} + +// Creates an entity of type FederatedLogSetupEntity. +func (a *Pipelinecontrol) EntityManagementCreateFederatedLogSetupWithContext( + ctx context.Context, + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityCreateInput, +) (*EntityManagementFederatedLogSetupEntityCreateResult, error) { + + resp := EntityManagementCreateFederatedLogSetupQueryResponse{} + vars := map[string]interface{}{ + "federatedLogSetupEntity": federatedLogSetupEntity, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementCreateFederatedLogSetupMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogSetupEntityCreateResult, nil +} + +type EntityManagementCreateFederatedLogSetupQueryResponse struct { + EntityManagementFederatedLogSetupEntityCreateResult EntityManagementFederatedLogSetupEntityCreateResult `json:"entityManagementCreateFederatedLogSetup"` +} + +// NOTE: This mutation has been simplified to avoid exceeding the GraphQL API's 15,000 grammar token limit. +// The original auto-generated mutation (~14,490 lines) included inline fragments for all entity types, +// which was unnecessary for FederatedLogSetupEntity and caused the error: +// "More than 15,000 'grammar' tokens have been presented. To prevent Denial Of Service attacks, parsing has been cancelled." +// +// This simplified version only queries fields specific to FederatedLogSetupEntity. +const EntityManagementCreateFederatedLogSetupMutation = `mutation( + $federatedLogSetupEntity: EntityManagementFederatedLogSetupEntityCreateInput!, +) { entityManagementCreateFederatedLogSetup( + federatedLogSetupEntity: $federatedLogSetupEntity, +) { + entity { + __typename + id + name + type + cloudProvider + cloudProviderRegion + dataLocationBucket + description + nrAccountId + nrRegion + status + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + queryConnection { + __typename + id + name + type + } + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + scope { + id + type + } + tags { + key + values + } + } +} }` + +// Creates an entity of type AwsConnectionEntity. +func (a *Pipelinecontrol) EntityManagementCreateAwsConnection( + awsConnectionEntity EntityManagementAwsConnectionEntityCreateInput, +) (*EntityManagementAwsConnectionEntityCreateResult, error) { + return a.EntityManagementCreateAwsConnectionWithContext(context.Background(), + awsConnectionEntity, + ) +} + +// Creates an entity of type AwsConnectionEntity. +func (a *Pipelinecontrol) EntityManagementCreateAwsConnectionWithContext( + ctx context.Context, + awsConnectionEntity EntityManagementAwsConnectionEntityCreateInput, +) (*EntityManagementAwsConnectionEntityCreateResult, error) { + + resp := EntityManagementCreateAwsConnectionQueryResponse{} + vars := map[string]interface{}{ + "awsConnectionEntity": awsConnectionEntity, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementCreateAwsConnectionMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementAwsConnectionEntityCreateResult, nil +} + +type EntityManagementCreateAwsConnectionQueryResponse struct { + EntityManagementAwsConnectionEntityCreateResult EntityManagementAwsConnectionEntityCreateResult `json:"EntityManagementCreateAwsConnection"` +} + +const EntityManagementCreateAwsConnectionMutation = `mutation( + $awsConnectionEntity: EntityManagementAwsConnectionEntityCreateInput!, +) { entityManagementCreateAwsConnection( + awsConnectionEntity: $awsConnectionEntity, +) { + entity { + credential { + assumeRole { + externalId + roleArn + } + } + description + enabled + externalId + id + metadata { + createdAt + createdBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + updatedAt + updatedBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + version + } + name + region + scope { + id + type + } + settings { + key + value + } + tags { + key + values + } + type + } +} }` + +// Creates an entity of type FederatedLogPartitionEntity. +func (a *Pipelinecontrol) EntityManagementCreateFederatedLogPartition( + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityCreateInput, +) (*EntityManagementFederatedLogPartitionEntityCreateResult, error) { + return a.EntityManagementCreateFederatedLogPartitionWithContext(context.Background(), + federatedLogPartitionEntity, + ) +} + +// Creates an entity of type FederatedLogPartitionEntity. +func (a *Pipelinecontrol) EntityManagementCreateFederatedLogPartitionWithContext( + ctx context.Context, + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityCreateInput, +) (*EntityManagementFederatedLogPartitionEntityCreateResult, error) { + + resp := EntityManagementCreateFederatedLogPartitionQueryResponse{} + vars := map[string]interface{}{ + "federatedLogPartitionEntity": federatedLogPartitionEntity, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementCreateFederatedLogPartitionMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogPartitionEntityCreateResult, nil +} + +type EntityManagementCreateFederatedLogPartitionQueryResponse struct { + EntityManagementFederatedLogPartitionEntityCreateResult EntityManagementFederatedLogPartitionEntityCreateResult `json:"EntityManagementCreateFederatedLogPartition"` +} + +// NOTE: This mutation has been simplified to avoid exceeding the GraphQL API's grammar token limit +// and to avoid FieldsConflict errors from inline fragments with conflicting nullability shapes. +// This simplified version only queries fields specific to FederatedLogPartitionEntity. +const EntityManagementCreateFederatedLogPartitionMutation = `mutation( + $federatedLogPartitionEntity: EntityManagementFederatedLogPartitionEntityCreateInput!, +) { entityManagementCreateFederatedLogPartition( + federatedLogPartitionEntity: $federatedLogPartitionEntity, +) { + entity { + dataLocationURI + description + id + isDefault + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + name + nrAccountId + partitionDatabase + partitionTable + retentionPolicy { + duration + unit + } + scope { + id + type + } + status + tags { + key + values + } + type + } +} }` + +// Updates an entity of type FederatedLogPartitionEntity. +func (a *Pipelinecontrol) EntityManagementUpdateFederatedLogPartition( + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogPartitionEntityUpdateResult, error) { + return a.EntityManagementUpdateFederatedLogPartitionWithContext(context.Background(), + federatedLogPartitionEntity, + iD, + version, + ) +} + +// Updates an entity of type FederatedLogPartitionEntity. +func (a *Pipelinecontrol) EntityManagementUpdateFederatedLogPartitionWithContext( + ctx context.Context, + federatedLogPartitionEntity EntityManagementFederatedLogPartitionEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogPartitionEntityUpdateResult, error) { + + resp := EntityManagementUpdateFederatedLogPartitionQueryResponse{} + vars := map[string]interface{}{ + "federatedLogPartitionEntity": federatedLogPartitionEntity, + "id": iD, + "version": version, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementUpdateFederatedLogPartitionMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogPartitionEntityUpdateResult, nil +} + +type EntityManagementUpdateFederatedLogPartitionQueryResponse struct { + EntityManagementFederatedLogPartitionEntityUpdateResult EntityManagementFederatedLogPartitionEntityUpdateResult `json:"EntityManagementUpdateFederatedLogPartition"` +} + +const EntityManagementUpdateFederatedLogPartitionMutation = `mutation( + $federatedLogPartitionEntity: EntityManagementFederatedLogPartitionEntityUpdateInput!, + $id: ID!, + $version: Int, +) { entityManagementUpdateFederatedLogPartition( + federatedLogPartitionEntity: $federatedLogPartitionEntity, + id: $id, + version: $version, +) { + entity { + + description + id + isDefault + metadata { + createdAt + createdBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + updatedAt + updatedBy { + __typename + id + ... on EntityManagementSystemActor { + __typename + } + ... on EntityManagementUserActor { + __typename + } + } + version + } + name + nrAccountId + partitionDatabase + partitionTable + retentionPolicy { + duration + unit + } + scope { + id + type + } + setup { + cloudProvider + cloudProviderRegion + dataLocationBucket + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + description + id + metadata { + createdAt + updatedAt + version + } + name + nrAccountId + nrRegion + queryConnection { + __typename + id + name + type + } + scope { + id + type + } + status + tags { + key + values + } + type + } + status + tags { + key + values + } + type + } +} }` + +// Updates an entity of type FederatedLogSetupEntity. +func (a *Pipelinecontrol) EntityManagementUpdateFederatedLogSetup( + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogSetupEntityUpdateResult, error) { + return a.EntityManagementUpdateFederatedLogSetupWithContext(context.Background(), + federatedLogSetupEntity, + iD, + version, + ) +} + +// Updates an entity of type FederatedLogSetupEntity. +func (a *Pipelinecontrol) EntityManagementUpdateFederatedLogSetupWithContext( + ctx context.Context, + federatedLogSetupEntity EntityManagementFederatedLogSetupEntityUpdateInput, + iD string, + version int, +) (*EntityManagementFederatedLogSetupEntityUpdateResult, error) { + + resp := EntityManagementUpdateFederatedLogSetupQueryResponse{} + vars := map[string]interface{}{ + "federatedLogSetupEntity": federatedLogSetupEntity, + "id": iD, + "version": version, + } + + if err := a.client.NerdGraphQueryWithContext(ctx, EntityManagementUpdateFederatedLogSetupMutation, vars, &resp); err != nil { + return nil, err + } + + return &resp.EntityManagementFederatedLogSetupEntityUpdateResult, nil +} + +type EntityManagementUpdateFederatedLogSetupQueryResponse struct { + EntityManagementFederatedLogSetupEntityUpdateResult EntityManagementFederatedLogSetupEntityUpdateResult `json:"EntityManagementUpdateFederatedLogSetup"` +} + +const EntityManagementUpdateFederatedLogSetupMutation = `mutation( + $federatedLogSetupEntity: EntityManagementFederatedLogSetupEntityUpdateInput!, + $id: ID!, + $version: Int, +) { entityManagementUpdateFederatedLogSetup( + federatedLogSetupEntity: $federatedLogSetupEntity, + id: $id, + version: $version, +) { + entity { + __typename + id + name + type + cloudProvider + cloudProviderRegion + dataLocationBucket + description + nrAccountId + nrRegion + status + dataProcessingComponent { + __typename + id + name + type + } + dataProcessingConnection { + __typename + id + name + type + } + queryConnection { + __typename + id + name + type + } + metadata { + createdAt + createdBy { + __typename + id + } + updatedAt + updatedBy { + __typename + id + } + version + } + scope { + id + type + } + tags { + key + values + } + } +} }` diff --git a/pkg/pipelinecontrol/pipelinecontrol_integration_test.go b/pkg/pipelinecontrol/pipelinecontrol_integration_test.go index 709abe484..875c1cca6 100644 --- a/pkg/pipelinecontrol/pipelinecontrol_integration_test.go +++ b/pkg/pipelinecontrol/pipelinecontrol_integration_test.go @@ -5,6 +5,7 @@ package pipelinecontrol import ( "fmt" + "os" "testing" "github.com/stretchr/testify/require" @@ -90,3 +91,176 @@ func TestIntegrationEntityManagement_PipelineCloudRule_CRUD(t *testing.T) { // 5. Delete the entity (this is handled by the deferred function) // The test will complete, and the deferred function will execute for cleanup. } + +// TestIntegrationEntityManagement_FederatedLogSetup_CRUD tests full CRUD for FederatedLogSetupEntity. +// Set the environment variable RUN_FEDERATED_LOG_SETUP_TEST=true to run this test. +func TestIntegrationEntityManagement_FederatedLogSetup_CRUD(t *testing.T) { + t.Parallel() + + if os.Getenv("RUN_FEDERATED_LOG_SETUP_TEST") != "true" { + t.Skip("Skipping FederatedLogSetup integration test. Set RUN_FEDERATED_LOG_SETUP_TEST=true to run.") + } + + client := newIntegrationTestClient(t) + accountID, _ := testhelpers.GetTestAccountID() + + dataProcessingConnectionId := os.Getenv("TEST_DATA_PROCESSING_CONNECTION_ID") + queryConnectionId := os.Getenv("TEST_QUERY_CONNECTION_ID") + dataLocationBucket := os.Getenv("TEST_DATA_LOCATION_BUCKET") + + if dataProcessingConnectionId == "" || queryConnectionId == "" || dataLocationBucket == "" { + t.Skip("Required env vars not set: TEST_DATA_PROCESSING_CONNECTION_ID, TEST_QUERY_CONNECTION_ID, TEST_DATA_LOCATION_BUCKET") + } + + setupName := fmt.Sprintf("test-federated-log-setup-%s", testhelpers.RandSeq(5)) + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: setupName, + Description: "A test federated log setup from integration testing.", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: dataLocationBucket, + DataProcessingConnectionId: dataProcessingConnectionId, + NrAccountId: fmt.Sprintf("%d", accountID), + NrRegion: EntityManagementNrRegionTypes.US, + QueryConnectionId: queryConnectionId, + Status: EntityManagementFederatedLogSetupStatusTypes.CREATING, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: fmt.Sprintf("%d", accountID), + }, + } + + // 1. Create + createResult, err := client.EntityManagementCreateFederatedLogSetup(createInput) + require.NoError(t, err) + require.NotNil(t, createResult) + require.NotEmpty(t, createResult.Entity.ID) + require.Equal(t, setupName, createResult.Entity.Name) + require.Equal(t, EntityManagementCloudProviderTypes.AWS, createResult.Entity.CloudProvider) + + defer func() { + _, deleteErr := client.EntityManagementDelete(createResult.Entity.ID) + require.NoError(t, deleteErr, "Failed to clean up FederatedLogSetup entity %s", createResult.Entity.ID) + }() + + // 2. Read + getResult, err := client.GetEntity(createResult.Entity.ID) + require.NoError(t, err) + require.NotNil(t, getResult) + + setupEntity, ok := (*getResult).(*EntityManagementFederatedLogSetupEntity) + require.True(t, ok, "Fetched entity was not of the expected FederatedLogSetupEntity type") + require.Equal(t, createResult.Entity.ID, setupEntity.ID) + require.Equal(t, createInput.Name, setupEntity.Name) + require.Equal(t, createInput.Description, setupEntity.Description) + require.Equal(t, createInput.CloudProvider, setupEntity.CloudProvider) + require.Equal(t, createInput.CloudProviderRegion, setupEntity.CloudProviderRegion) + + // 3. Update + updateInput := EntityManagementFederatedLogSetupEntityUpdateInput{ + Name: setupName + "-updated", + Description: "Updated federated log setup from integration testing.", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: dataLocationBucket, + DataProcessingConnectionId: dataProcessingConnectionId, + NrAccountId: fmt.Sprintf("%d", accountID), + NrRegion: EntityManagementNrRegionTypes.US, + QueryConnectionId: queryConnectionId, + Status: EntityManagementFederatedLogSetupStatusTypes.CREATING, + } + + updateResult, err := client.EntityManagementUpdateFederatedLogSetup(updateInput, createResult.Entity.ID, setupEntity.Metadata.Version) + require.NoError(t, err) + require.NotNil(t, updateResult) + require.Equal(t, setupName+"-updated", updateResult.Entity.Name) + require.Equal(t, "Updated federated log setup from integration testing.", updateResult.Entity.Description) + require.Equal(t, setupEntity.Metadata.Version+1, updateResult.Entity.Metadata.Version) + + // 4. Read after update + getResultAfterUpdate, err := client.GetEntity(createResult.Entity.ID) + require.NoError(t, err) + require.NotNil(t, getResultAfterUpdate) + + setupEntityUpdated, ok := (*getResultAfterUpdate).(*EntityManagementFederatedLogSetupEntity) + require.True(t, ok, "Fetched entity was not of the expected FederatedLogSetupEntity type") + require.Equal(t, updateResult.Entity.Name, setupEntityUpdated.Name) + require.Equal(t, updateInput.Description, setupEntityUpdated.Description) + + // 5. Delete (handled by deferred function) +} + +// TestIntegrationEntityManagement_FederatedLogSetup_Create tests the creation of a FederatedLogSetupEntity. +// This test is skipped by default as it requires specific cloud infrastructure setup. +// Set the environment variable RUN_FEDERATED_LOG_SETUP_TEST=true to run this test. +func TestIntegrationEntityManagement_FederatedLogSetup_Create(t *testing.T) { + t.Parallel() + + // Skip this test unless explicitly enabled + if os.Getenv("RUN_FEDERATED_LOG_SETUP_TEST") != "true" { + t.Skip("Skipping FederatedLogSetup integration test. Set RUN_FEDERATED_LOG_SETUP_TEST=true to run.") + } + + client := newIntegrationTestClient(t) + accountID, _ := testhelpers.GetTestAccountID() + + // Generate a unique name for the test + setupName := fmt.Sprintf("test-federated-log-setup-%s", testhelpers.RandSeq(5)) + + // Note: This test requires valid connection IDs for DataProcessingConnection and QueryConnection + // These would need to be created separately or provided via environment variables + dataProcessingConnectionId := os.Getenv("TEST_DATA_PROCESSING_CONNECTION_ID") + queryConnectionId := os.Getenv("TEST_QUERY_CONNECTION_ID") + dataLocationBucket := os.Getenv("TEST_DATA_LOCATION_BUCKET") + + if dataProcessingConnectionId == "" || queryConnectionId == "" || dataLocationBucket == "" { + t.Skip("Skipping FederatedLogSetup integration test. Required environment variables not set: TEST_DATA_PROCESSING_CONNECTION_ID, TEST_QUERY_CONNECTION_ID, TEST_DATA_LOCATION_BUCKET") + } + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: setupName, + Description: "A test federated log setup from integration testing.", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: dataLocationBucket, + DataProcessingConnectionId: dataProcessingConnectionId, + NrAccountId: fmt.Sprintf("%d", accountID), + NrRegion: EntityManagementNrRegionTypes.US, + QueryConnectionId: queryConnectionId, + Status: EntityManagementFederatedLogSetupStatusTypes.CREATING, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: fmt.Sprintf("%d", accountID), + }, + } + + // 1. Create the entity + createResult, err := client.EntityManagementCreateFederatedLogSetup(createInput) + require.NotNil(t, createResult) + require.NoError(t, err) + + require.NotEmpty(t, createResult.Entity.ID) + require.Equal(t, setupName, createResult.Entity.Name) + require.Equal(t, EntityManagementCloudProviderTypes.AWS, createResult.Entity.CloudProvider) + + // Defer the deletion to ensure cleanup even if assertions fail + defer func() { + _, deleteErr := client.EntityManagementDelete(createResult.Entity.ID) + require.NoError(t, deleteErr, "Failed to clean up FederatedLogSetup entity %s", createResult.Entity.ID) + }() + + // 2. Read the entity to verify creation + getResult, err := client.GetEntity(createResult.Entity.ID) + require.NoError(t, err) + require.NotNil(t, getResult) + + // Type assert the result to access specific fields + setupEntity, ok := (*getResult).(*EntityManagementFederatedLogSetupEntity) + require.True(t, ok, "Fetched entity was not of the expected type") + require.Equal(t, createResult.Entity.ID, setupEntity.ID) + require.Equal(t, createInput.Name, setupEntity.Name) + require.Equal(t, createInput.Description, setupEntity.Description) + require.Equal(t, createInput.CloudProvider, setupEntity.CloudProvider) + require.Equal(t, createInput.CloudProviderRegion, setupEntity.CloudProviderRegion) +} diff --git a/pkg/pipelinecontrol/pipelinecontrol_unit_test.go b/pkg/pipelinecontrol/pipelinecontrol_unit_test.go index 5166c316e..139d3c96d 100644 --- a/pkg/pipelinecontrol/pipelinecontrol_unit_test.go +++ b/pkg/pipelinecontrol/pipelinecontrol_unit_test.go @@ -181,3 +181,749 @@ func TestUnitEntityManagement_GetEntity_Error(t *testing.T) { require.Error(t, err) require.Nil(t, result) } + +var ( + testFederatedLogSetupID = "MXxYY0YYxYYYYYYYYY6YY0YYY1YYY1YYYYY9YYY6YYYxY3YxYyyyYY04YYY3YYy0YYYyYYYyYyYyYYYyYYYy" + + testCreateFederatedLogSetupResponseJSON = ` + { + "data": { + "entityManagementCreateFederatedLogSetup": { + "entity": { + "id": "MXxYY0YYxYYYYYYYYY6YY0YYY1YYY1YYYYY9YYY6YYYxY3YxYyyyYY04YYY3YYy0YYYyYYYyYyYyYYYyYYYy", + "metadata": { + "version": 1 + }, + "name": "Test Federated Log Setup", + "description": "Test Federated Log Setup - New Relic Go Client", + "cloudProvider": "AWS", + "cloudProviderRegion": "us-east-1", + "dataLocationBucket": "my-test-bucket", + "nrAccountId": "12345", + "nrRegion": "US", + "status": "ACTIVE" + } + } + } + }` + + testCreateFederatedLogSetupErrorResponseJSON = ` + { + "errors": [ + { + "message": "Invalid input: missing required field" + } + ] + }` +) + +func TestUnitEntityManagement_CreateFederatedLogSetup(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogSetupResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: "Test Federated Log Setup", + Description: "Test Federated Log Setup - New Relic Go Client", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: "my-test-bucket", + DataProcessingConnectionId: "connection-123", + NrAccountId: "12345", + NrRegion: EntityManagementNrRegionTypes.US, + QueryConnectionId: "query-connection-456", + Status: EntityManagementFederatedLogSetupStatusTypes.ACTIVE, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateFederatedLogSetup(createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup", result.Entity.Name) + require.Equal(t, EntityManagementCloudProviderTypes.AWS, result.Entity.CloudProvider) + require.Equal(t, "us-east-1", result.Entity.CloudProviderRegion) + require.Equal(t, EntityManagementNrRegionTypes.US, result.Entity.NrRegion) + require.Equal(t, EntityManagementFederatedLogSetupStatusTypes.ACTIVE, result.Entity.Status) +} + +func TestUnitEntityManagement_CreateFederatedLogSetupWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogSetupResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: "Test Federated Log Setup", + Description: "Test Federated Log Setup - New Relic Go Client", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: "my-test-bucket", + DataProcessingConnectionId: "connection-123", + NrAccountId: "12345", + NrRegion: EntityManagementNrRegionTypes.US, + QueryConnectionId: "query-connection-456", + Status: EntityManagementFederatedLogSetupStatusTypes.ACTIVE, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateFederatedLogSetupWithContext(context.Background(), createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup", result.Entity.Name) +} + +func TestUnitEntityManagement_CreateFederatedLogSetup_Error(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogSetupErrorResponseJSON, http.StatusBadRequest) + + createInput := EntityManagementFederatedLogSetupEntityCreateInput{ + Name: "Test Federated Log Setup", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + } + + result, err := client.EntityManagementCreateFederatedLogSetup(createInput) + + require.Error(t, err) + require.Nil(t, result) +} + +var ( + testAwsConnectionID = "MXxZZ0ZZxZZZZZZZZZ7ZZ0ZZZ1ZZZ1ZZZZZ0ZZZ7ZZZxZ4ZxZzzzZZ05ZZZ4ZZz0ZZZzZZZzZzZzZZZzZZZz" + + testCreateAwsConnectionResponseJSON = ` + { + "data": { + "EntityManagementCreateAwsConnection": { + "entity": { + "id": "MXxZZ0ZZxZZZZZZZZZ7ZZ0ZZZ1ZZZ1ZZZZZ0ZZZ7ZZZxZ4ZxZzzzZZ05ZZZ4ZZz0ZZZzZZZzZzZzZZZzZZZz", + "metadata": { + "version": 1 + }, + "name": "Test AWS Connection", + "description": "Test AWS Connection - New Relic Go Client", + "enabled": true, + "region": "us-east-1", + "externalId": "ext-123", + "credential": { + "assumeRole": { + "roleArn": "arn:aws:iam::123456789012:role/test-role", + "externalId": "ext-456" + } + }, + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "settings": [ + { + "key": "setting1", + "value": "value1" + } + ], + "tags": [], + "type": "AWS_CONNECTION" + } + } + } + }` + + testCreateAwsConnectionErrorResponseJSON = ` + { + "errors": [ + { + "message": "Invalid input: missing required field" + } + ] + }` + + testGetEntitySearchResponseJSON = ` + { + "data": { + "actor": { + "entityManagement": { + "entitySearch": { + "entities": [ + { + "__typename": "EntityManagementPipelineCloudRuleEntity", + "id": "MXxXX0XXxXXXXXXXXX5XX0XXX1XXX1XXXXX8XXX5XXXxX2XxXxxxXX03XXX2XXx0XXXxXXXxXxXxXXXxXXXx", + "metadata": { + "version": 1 + }, + "name": "Test Rule", + "description": "Test Pipeline Cloud Rule", + "nrql": "DELETE FROM Log WHERE (container_name = 'mario')", + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "tags": [] + } + ], + "nextCursor": "" + } + } + } + } + }` + + testGetEntitySearchEmptyResponseJSON = ` + { + "data": { + "actor": { + "entityManagement": { + "entitySearch": { + "entities": [], + "nextCursor": "" + } + } + } + } + }` + + testGetEntityFederatedLogSetupResponseJSON = ` + { + "data": { + "actor": { + "entityManagement": { + "entity": { + "__typename": "EntityManagementFederatedLogSetupEntity", + "id": "MXxYY0YYxYYYYYYYYY6YY0YYY1YYY1YYYYY9YYY6YYYxY3YxYyyyYY04YYY3YYy0YYYyYYYyYyYyYYYyYYYy", + "metadata": { + "version": 1 + }, + "name": "Test Federated Log Setup", + "description": "Test Federated Log Setup", + "cloudProvider": "AWS", + "cloudProviderRegion": "us-east-1", + "dataLocationBucket": "my-test-bucket", + "nrAccountId": "12345", + "nrRegion": "US", + "status": "ACTIVE", + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "tags": [] + } + } + } + } + }` + + testGetEntityAwsConnectionResponseJSON = ` + { + "data": { + "actor": { + "entityManagement": { + "entity": { + "__typename": "EntityManagementAwsConnectionEntity", + "id": "MXxZZ0ZZxZZZZZZZZZ7ZZ0ZZZ1ZZZ1ZZZZZ0ZZZ7ZZZxZ4ZxZzzzZZ05ZZZ4ZZz0ZZZzZZZzZzZzZZZzZZZz", + "metadata": { + "version": 1 + }, + "name": "Test AWS Connection", + "description": "Test AWS Connection", + "enabled": true, + "region": "us-east-1", + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "tags": [] + } + } + } + } + }` +) + +func TestUnitEntityManagement_CreateAwsConnection(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateAwsConnectionResponseJSON, http.StatusOK) + + createInput := EntityManagementAwsConnectionEntityCreateInput{ + Name: "Test AWS Connection", + Description: "Test AWS Connection - New Relic Go Client", + Enabled: true, + Region: "us-east-1", + ExternalId: "ext-123", + Credential: EntityManagementAwsCredentialsCreateInput{ + AssumeRole: EntityManagementAwsAssumeRoleConfigCreateInput{ + RoleArn: "arn:aws:iam::123456789012:role/test-role", + }, + }, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateAwsConnection(createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testAwsConnectionID, result.Entity.ID) + require.Equal(t, "Test AWS Connection", result.Entity.Name) + require.Equal(t, "Test AWS Connection - New Relic Go Client", result.Entity.Description) + require.True(t, result.Entity.Enabled) + require.Equal(t, "us-east-1", result.Entity.Region) +} + +func TestUnitEntityManagement_CreateAwsConnectionWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateAwsConnectionResponseJSON, http.StatusOK) + + createInput := EntityManagementAwsConnectionEntityCreateInput{ + Name: "Test AWS Connection", + Description: "Test AWS Connection - New Relic Go Client", + Enabled: true, + Region: "us-east-1", + Credential: EntityManagementAwsCredentialsCreateInput{ + AssumeRole: EntityManagementAwsAssumeRoleConfigCreateInput{ + RoleArn: "arn:aws:iam::123456789012:role/test-role", + }, + }, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateAwsConnectionWithContext(context.Background(), createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testAwsConnectionID, result.Entity.ID) + require.Equal(t, "Test AWS Connection", result.Entity.Name) +} + +func TestUnitEntityManagement_CreateAwsConnection_Error(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateAwsConnectionErrorResponseJSON, http.StatusBadRequest) + + createInput := EntityManagementAwsConnectionEntityCreateInput{ + Name: "Test AWS Connection", + } + + result, err := client.EntityManagementCreateAwsConnection(createInput) + + require.Error(t, err) + require.Nil(t, result) +} + +func TestUnitEntityManagement_GetEntitySearch(t *testing.T) { + t.Parallel() + client := newMockClient(t, testGetEntitySearchResponseJSON, http.StatusOK) + + result, err := client.GetEntitySearch("", "type = 'PIPELINE_CLOUD_RULE'") + + require.NoError(t, err) + require.NotNil(t, result) + require.Len(t, result.Entities, 1) + + ruleEntity, ok := result.Entities[0].(*EntityManagementPipelineCloudRuleEntity) + require.True(t, ok) + require.Equal(t, testRuleID, ruleEntity.ID) +} + +func TestUnitEntityManagement_GetEntitySearchWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testGetEntitySearchResponseJSON, http.StatusOK) + + result, err := client.GetEntitySearchWithContext(context.Background(), "", "type = 'PIPELINE_CLOUD_RULE'") + + require.NoError(t, err) + require.NotNil(t, result) + require.Len(t, result.Entities, 1) +} + +func TestUnitEntityManagement_GetEntitySearch_Empty(t *testing.T) { + t.Parallel() + client := newMockClient(t, testGetEntitySearchEmptyResponseJSON, http.StatusOK) + + result, err := client.GetEntitySearch("", "type = 'NONEXISTENT'") + + require.NoError(t, err) + require.NotNil(t, result) + require.Len(t, result.Entities, 0) +} + +func TestUnitEntityManagement_GetEntitySearch_Error(t *testing.T) { + t.Parallel() + client := newMockClient(t, `{"errors": [{"message": "Invalid query"}]}`, http.StatusBadRequest) + + result, err := client.GetEntitySearch("", "invalid query") + + require.Error(t, err) + require.Nil(t, result) +} + +func TestUnitEntityManagement_GetEntity_FederatedLogSetup(t *testing.T) { + t.Parallel() + client := newMockClient(t, testGetEntityFederatedLogSetupResponseJSON, http.StatusOK) + + result, err := client.GetEntity(testFederatedLogSetupID) + + require.NoError(t, err) + require.NotNil(t, result) + + setupEntity, ok := (*result).(*EntityManagementFederatedLogSetupEntity) + require.True(t, ok, "Fetched entity was not of the expected FederatedLogSetupEntity type") + require.Equal(t, testFederatedLogSetupID, setupEntity.ID) + require.Equal(t, "Test Federated Log Setup", setupEntity.Name) + require.Equal(t, EntityManagementCloudProviderTypes.AWS, setupEntity.CloudProvider) +} + +func TestUnitEntityManagement_GetEntity_AwsConnection(t *testing.T) { + t.Parallel() + client := newMockClient(t, testGetEntityAwsConnectionResponseJSON, http.StatusOK) + + result, err := client.GetEntity(testAwsConnectionID) + + require.NoError(t, err) + require.NotNil(t, result) + + connEntity, ok := (*result).(*EntityManagementAwsConnectionEntity) + require.True(t, ok, "Fetched entity was not of the expected AwsConnectionEntity type") + require.Equal(t, testAwsConnectionID, connEntity.ID) + require.Equal(t, "Test AWS Connection", connEntity.Name) + require.True(t, connEntity.Enabled) +} + +var ( + testFederatedLogPartitionID = "MXxWW0WWxWWWWWWWWW8WW0WWW1WWW1WWWWW2WWW8WWWxW5WxWwwwWW06WWW5WWw0WWWwWWWwWwWwWWWwWWWw" + + testCreateFederatedLogPartitionResponseJSON = ` + { + "data": { + "EntityManagementCreateFederatedLogPartition": { + "entity": { + "id": "MXxWW0WWxWWWWWWWWW8WW0WWW1WWW1WWWWW2WWW8WWWxW5WxWwwwWW06WWW5WWw0WWWwWWWwWwWwWWWwWWWw", + "metadata": { + "version": 1 + }, + "name": "Test Partition", + "description": "Test Federated Log Partition - New Relic Go Client", + "dataLocationUri": "s3://my-bucket/logs/partition1", + "isDefault": false, + "nrAccountId": "12345", + "partitionDatabase": "my_database", + "partitionTable": "my_table", + "status": "ACTIVE", + "retentionPolicy": { + "duration": 30, + "unit": "DAYS" + }, + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "tags": [], + "type": "FEDERATED_LOG_PARTITION" + } + } + } + }` + + testCreateFederatedLogPartitionErrorResponseJSON = ` + { + "errors": [ + { + "message": "Invalid input: missing required field" + } + ] + }` +) + +func TestUnitEntityManagement_CreateFederatedLogPartition(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogPartitionResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogPartitionEntityCreateInput{ + Name: "Test Partition", + Description: "Test Federated Log Partition - New Relic Go Client", + DataLocationUri: "s3://my-bucket/logs/partition1", + IsDefault: false, + NrAccountId: "12345", + PartitionDatabase: "my_database", + PartitionTable: "my_table", + SetupId: "setup-789", + Status: EntityManagementLogPartitionStatusTypes.ACTIVE, + RetentionPolicy: &EntityManagementRetentionPolicyCreateInput{ + Duration: 30, + Unit: EntityManagementRetentionUnitTypes.DAYS, + }, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateFederatedLogPartition(createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogPartitionID, result.Entity.ID) + require.Equal(t, "Test Partition", result.Entity.Name) + require.Equal(t, "s3://my-bucket/logs/partition1", result.Entity.DataLocationUri) + require.False(t, result.Entity.IsDefault) + require.Equal(t, "12345", result.Entity.NrAccountId) + require.Equal(t, "my_database", result.Entity.PartitionDatabase) + require.Equal(t, "my_table", result.Entity.PartitionTable) + require.Equal(t, EntityManagementLogPartitionStatusTypes.ACTIVE, result.Entity.Status) + require.Equal(t, 30, result.Entity.RetentionPolicy.Duration) + require.Equal(t, EntityManagementRetentionUnitTypes.DAYS, result.Entity.RetentionPolicy.Unit) +} + +func TestUnitEntityManagement_CreateFederatedLogPartitionWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogPartitionResponseJSON, http.StatusOK) + + createInput := EntityManagementFederatedLogPartitionEntityCreateInput{ + Name: "Test Partition", + Description: "Test Federated Log Partition - New Relic Go Client", + DataLocationUri: "s3://my-bucket/logs/partition1", + IsDefault: false, + NrAccountId: "12345", + PartitionDatabase: "my_database", + PartitionTable: "my_table", + SetupId: "setup-789", + Status: EntityManagementLogPartitionStatusTypes.ACTIVE, + Scope: EntityManagementScopedReferenceInput{ + Type: EntityManagementEntityScopeTypes.ACCOUNT, + ID: testAccountID, + }, + } + + result, err := client.EntityManagementCreateFederatedLogPartitionWithContext(context.Background(), createInput) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogPartitionID, result.Entity.ID) + require.Equal(t, "Test Partition", result.Entity.Name) +} + +func TestUnitEntityManagement_CreateFederatedLogPartition_Error(t *testing.T) { + t.Parallel() + client := newMockClient(t, testCreateFederatedLogPartitionErrorResponseJSON, http.StatusBadRequest) + + createInput := EntityManagementFederatedLogPartitionEntityCreateInput{ + Name: "Test Partition", + } + + result, err := client.EntityManagementCreateFederatedLogPartition(createInput) + + require.Error(t, err) + require.Nil(t, result) +} + +var ( + testUpdateFederatedLogSetupResponseJSON = ` + { + "data": { + "EntityManagementUpdateFederatedLogSetup": { + "entity": { + "id": "MXxYY0YYxYYYYYYYYY6YY0YYY1YYY1YYYYY9YYY6YYYxY3YxYyyyYY04YYY3YYy0YYYyYYYyYyYyYYYyYYYy", + "name": "Test Federated Log Setup Updated", + "cloudProvider": "AWS", + "cloudProviderRegion": "us-east-1", + "dataLocationBucket": "my-updated-bucket", + "description": "Updated description", + "nrAccountId": "12345", + "nrRegion": "US", + "status": "ACTIVE", + "metadata": { + "version": 2 + }, + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "tags": [] + } + } + } + }` + + testUpdateFederatedLogSetupErrorResponseJSON = ` + { + "errors": [ + { + "message": "Entity not found" + } + ] + }` + + testUpdateFederatedLogPartitionResponseJSON = ` + { + "data": { + "EntityManagementUpdateFederatedLogPartition": { + "entity": { + "id": "MXxWW0WWxWWWWWWWWW8WW0WWW1WWW1WWWWW2WWW8WWWxW5WxWwwwWW06WWW5WWw0WWWwWWWwWwWwWWWwWWWw", + "name": "Test Partition Updated", + "dataLocationUri": "s3://my-bucket/logs/partition-updated", + "description": "Updated partition description", + "isDefault": true, + "nrAccountId": "12345", + "partitionDatabase": "my_database_updated", + "partitionTable": "my_table_updated", + "status": "ACTIVE", + "retentionPolicy": { + "duration": 60, + "unit": "DAYS" + }, + "metadata": { + "version": 2 + }, + "scope": { + "id": "12345", + "type": "ACCOUNT" + }, + "tags": [], + "type": "FEDERATED_LOG_PARTITION" + } + } + } + }` + + testUpdateFederatedLogPartitionErrorResponseJSON = ` + { + "errors": [ + { + "message": "Entity not found" + } + ] + }` +) + +func TestUnitEntityManagement_UpdateFederatedLogSetup(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogSetupResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogSetupEntityUpdateInput{ + Name: "Test Federated Log Setup Updated", + Description: "Updated description", + CloudProvider: EntityManagementCloudProviderTypes.AWS, + CloudProviderRegion: "us-east-1", + DataLocationBucket: "my-updated-bucket", + DataProcessingConnectionId: "connection-123", + NrAccountId: "12345", + NrRegion: EntityManagementNrRegionTypes.US, + QueryConnectionId: "query-connection-456", + Status: EntityManagementFederatedLogSetupStatusTypes.ACTIVE, + } + + result, err := client.EntityManagementUpdateFederatedLogSetup(updateInput, testFederatedLogSetupID, 1) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup Updated", result.Entity.Name) + require.Equal(t, "my-updated-bucket", result.Entity.DataLocationBucket) + require.Equal(t, EntityManagementFederatedLogSetupStatusTypes.ACTIVE, result.Entity.Status) + require.Equal(t, 2, result.Entity.Metadata.Version) +} + +func TestUnitEntityManagement_UpdateFederatedLogSetupWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogSetupResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogSetupEntityUpdateInput{ + Name: "Test Federated Log Setup Updated", + Description: "Updated description", + } + + result, err := client.EntityManagementUpdateFederatedLogSetupWithContext(context.Background(), updateInput, testFederatedLogSetupID, 1) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogSetupID, result.Entity.ID) + require.Equal(t, "Test Federated Log Setup Updated", result.Entity.Name) +} + +func TestUnitEntityManagement_UpdateFederatedLogSetup_Error(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogSetupErrorResponseJSON, http.StatusNotFound) + + updateInput := EntityManagementFederatedLogSetupEntityUpdateInput{ + Name: "Test Federated Log Setup Updated", + } + + result, err := client.EntityManagementUpdateFederatedLogSetup(updateInput, "non-existent-id", 1) + + require.Error(t, err) + require.Nil(t, result) +} + +func TestUnitEntityManagement_UpdateFederatedLogPartition(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogPartitionResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogPartitionEntityUpdateInput{ + Name: "Test Partition Updated", + Description: "Updated partition description", + DataLocationUri: "s3://my-bucket/logs/partition-updated", + IsDefault: true, + NrAccountId: "12345", + PartitionDatabase: "my_database_updated", + PartitionTable: "my_table_updated", + SetupId: "setup-789", + Status: EntityManagementLogPartitionStatusTypes.ACTIVE, + RetentionPolicy: &EntityManagementRetentionPolicyUpdateInput{ + Duration: 60, + Unit: EntityManagementRetentionUnitTypes.DAYS, + }, + } + + result, err := client.EntityManagementUpdateFederatedLogPartition(updateInput, testFederatedLogPartitionID, 1) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogPartitionID, result.Entity.ID) + require.Equal(t, "Test Partition Updated", result.Entity.Name) + require.Equal(t, "s3://my-bucket/logs/partition-updated", result.Entity.DataLocationUri) + require.True(t, result.Entity.IsDefault) + require.Equal(t, "my_database_updated", result.Entity.PartitionDatabase) + require.Equal(t, "my_table_updated", result.Entity.PartitionTable) + require.Equal(t, 60, result.Entity.RetentionPolicy.Duration) + require.Equal(t, EntityManagementRetentionUnitTypes.DAYS, result.Entity.RetentionPolicy.Unit) + require.Equal(t, 2, result.Entity.Metadata.Version) +} + +func TestUnitEntityManagement_UpdateFederatedLogPartitionWithContext(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogPartitionResponseJSON, http.StatusOK) + + updateInput := EntityManagementFederatedLogPartitionEntityUpdateInput{ + Name: "Test Partition Updated", + Description: "Updated partition description", + } + + result, err := client.EntityManagementUpdateFederatedLogPartitionWithContext(context.Background(), updateInput, testFederatedLogPartitionID, 1) + + require.NoError(t, err) + require.NotNil(t, result) + require.Equal(t, testFederatedLogPartitionID, result.Entity.ID) + require.Equal(t, "Test Partition Updated", result.Entity.Name) +} + +func TestUnitEntityManagement_UpdateFederatedLogPartition_Error(t *testing.T) { + t.Parallel() + client := newMockClient(t, testUpdateFederatedLogPartitionErrorResponseJSON, http.StatusNotFound) + + updateInput := EntityManagementFederatedLogPartitionEntityUpdateInput{ + Name: "Test Partition Updated", + } + + result, err := client.EntityManagementUpdateFederatedLogPartition(updateInput, "non-existent-id", 1) + + require.Error(t, err) + require.Nil(t, result) +} diff --git a/pkg/pipelinecontrol/types.go b/pkg/pipelinecontrol/types.go index 76fbe838f..2b850310a 100644 --- a/pkg/pipelinecontrol/types.go +++ b/pkg/pipelinecontrol/types.go @@ -24,7 +24,7 @@ var AgentApplicationSegmentsListTypeTypes = struct { USER: "USER", } -// AgentApplicationSettingsBrowserLoader - Determines which browser loader will be configured. Some allowed return values are specified for backwards-compatability and do not represent currently allowed values for new applications. +// AgentApplicationSettingsBrowserLoader - Determines which browser loader will be configured. Some allowed return values are specified for backwards-compatibility and do not represent currently allowed values for new applications. // See [documentation](https://docs.newrelic.com/docs/browser/browser-monitoring/installation/install-browser-monitoring-agent/#agent-types) for further information. type AgentApplicationSettingsBrowserLoader string @@ -41,7 +41,7 @@ var AgentApplicationSettingsBrowserLoaderTypes = struct { RUM AgentApplicationSettingsBrowserLoader // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. SPA AgentApplicationSettingsBrowserLoader - // This value is specified for backwards-compatability. + // This value is specified for backwards-compatibility. XHR AgentApplicationSettingsBrowserLoader }{ // Use PRO instead @@ -56,7 +56,7 @@ var AgentApplicationSettingsBrowserLoaderTypes = struct { RUM: "RUM", // Pro+SPA: This is the default installed agent when you enable browser monitoring. Gives you access to all of the Browser Pro features and to Single Page App (SPA) monitoring. Provides detailed page timing data and the most up-to-date New Relic features, including distributed tracing, for all types of applications. SPA: "SPA", - // This value is specified for backwards-compatability. + // This value is specified for backwards-compatibility. XHR: "XHR", } @@ -1335,6 +1335,29 @@ var EntityManagementCategoryScopeTypeTypes = struct { GLOBAL: "GLOBAL", } +// EntityManagementCloudProvider - Supported cloud providers for federated log deployments. +type EntityManagementCloudProvider string + +var EntityManagementCloudProviderTypes = struct { + // Amazon Web Services + AWS EntityManagementCloudProvider + // Microsoft Azure + AZURE EntityManagementCloudProvider + // Google Cloud Platform + GCP EntityManagementCloudProvider + // Oracle Cloud Infrastructure + OCI EntityManagementCloudProvider +}{ + // Amazon Web Services + AWS: "AWS", + // Microsoft Azure + AZURE: "AZURE", + // Google Cloud Platform + GCP: "GCP", + // Oracle Cloud Infrastructure + OCI: "OCI", +} + // EntityManagementEncodingName - The Encoding names options type EntityManagementEncodingName string @@ -1415,6 +1438,29 @@ var EntityManagementExternalOwnerTypeTypes = struct { WORKSPACE: "WORKSPACE", } +// EntityManagementFederatedLogSetupStatus - Status of a federated log setup. +type EntityManagementFederatedLogSetupStatus string + +var EntityManagementFederatedLogSetupStatusTypes = struct { + // Indicates the federated log setup is active. + ACTIVE EntityManagementFederatedLogSetupStatus + // Indicates the federated log setup is being created. + CREATING EntityManagementFederatedLogSetupStatus + // Indicates the federated log setup is in an error state. + ERROR EntityManagementFederatedLogSetupStatus + // Indicates the federated log setup is inactive. + INACTIVE EntityManagementFederatedLogSetupStatus +}{ + // Indicates the federated log setup is active. + ACTIVE: "ACTIVE", + // Indicates the federated log setup is being created. + CREATING: "CREATING", + // Indicates the federated log setup is in an error state. + ERROR: "ERROR", + // Indicates the federated log setup is inactive. + INACTIVE: "INACTIVE", +} + // EntityManagementFleetDeploymentPhase - Phases a fleet deployment can have type EntityManagementFleetDeploymentPhase string @@ -1594,6 +1640,21 @@ var EntityManagementManagedEntityTypeTypes = struct { KUBERNETESCLUSTER: "KUBERNETESCLUSTER", } +// EntityManagementNrRegion - New Relic regions for federated log. +type EntityManagementNrRegion string + +var EntityManagementNrRegionTypes = struct { + // EU region + EU EntityManagementNrRegion + // US region + US EntityManagementNrRegion +}{ + // EU region + EU: "EU", + // US region + US: "US", +} + // EntityManagementStatusCode - Rule execution status codes type EntityManagementStatusCode string @@ -2551,7 +2612,7 @@ type ApmApplicationDeployment struct { Permalink string `json:"permalink,omitempty"` // The revision of the app that was deployed Revision string `json:"revision,omitempty"` - // The moment the deployment occured + // The moment the deployment occurred Timestamp *nrtime.EpochMilliseconds `json:"timestamp,omitempty"` // The user who triggered the deployment User string `json:"user,omitempty"` @@ -2616,7 +2677,7 @@ type ApmApplicationEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -2822,7 +2883,7 @@ type ApmDatabaseInstanceEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -2950,7 +3011,7 @@ type ApmExternalServiceEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -3094,7 +3155,7 @@ type BrowserApplicationEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -3376,7 +3437,7 @@ type DashboardEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -3787,7 +3848,7 @@ type Entity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -4447,6 +4508,201 @@ type EntityManagementExternalOwner struct { Type EntityManagementExternalOwnerType `json:"type"` } +// EntityManagementFederatedLogSetupEntity - Federated Log Setup Entity. +type EntityManagementFederatedLogSetupEntity struct { + // The cloud provider where this Federated Log setup is deployed. + CloudProvider EntityManagementCloudProvider `json:"cloudProvider"` + // The cloud provider region where the Federated Log setup is deployed. + CloudProviderRegion string `json:"cloudProviderRegion"` + // The object storage bucket where log data is stored. + DataLocationBucket string `json:"dataLocationBucket"` + // The data processing component that defines transformation rules and partition routing logic for this federated log setup. + DataProcessingComponent EntityManagementEntityInterface `json:"dataProcessingComponent,omitempty"` + // The connection manager entity used for data processing, transformation, and partition routing. + DataProcessingConnection EntityManagementEntityInterface `json:"dataProcessingConnection"` + // The description of the Federated Log setup. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the federated log setup. + Name string `json:"name"` + // The NR account ID associated with the federated log setup. + NrAccountId string `json:"nrAccountId"` + // The NR region associated with the federated log setup. + NrRegion EntityManagementNrRegion `json:"nrRegion"` + // The connection manager entity used by query workers for reading and accessing federated log resources. + QueryConnection EntityManagementEntityInterface `json:"queryConnection"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The status of the federated log setup. + Status EntityManagementFederatedLogSetupStatus `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +func (x *EntityManagementFederatedLogSetupEntity) ImplementsEntityManagementEntity() {} + +// special +func (x *EntityManagementFederatedLogSetupEntity) UnmarshalJSON(b []byte) error { + var objMap map[string]*json.RawMessage + err := json.Unmarshal(b, &objMap) + if err != nil { + return err + } + + for k, v := range objMap { + if v == nil { + continue + } + + switch k { + case "cloudProvider": + err = json.Unmarshal(*v, &x.CloudProvider) + if err != nil { + return err + } + case "cloudProviderRegion": + err = json.Unmarshal(*v, &x.CloudProviderRegion) + if err != nil { + return err + } + case "dataLocationBucket": + err = json.Unmarshal(*v, &x.DataLocationBucket) + if err != nil { + return err + } + case "dataProcessingComponent": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementEntityInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.DataProcessingComponent = *xxx + } + case "dataProcessingConnection": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementEntityInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.DataProcessingConnection = *xxx + } + case "description": + err = json.Unmarshal(*v, &x.Description) + if err != nil { + return err + } + case "id": + err = json.Unmarshal(*v, &x.ID) + if err != nil { + return err + } + case "metadata": + err = json.Unmarshal(*v, &x.Metadata) + if err != nil { + return err + } + case "name": + err = json.Unmarshal(*v, &x.Name) + if err != nil { + return err + } + case "nrAccountId": + err = json.Unmarshal(*v, &x.NrAccountId) + if err != nil { + return err + } + case "nrRegion": + err = json.Unmarshal(*v, &x.NrRegion) + if err != nil { + return err + } + case "queryConnection": + if v == nil { + continue + } + xxx, err := UnmarshalEntityManagementEntityInterface(*v) + if err != nil { + return err + } + + if xxx != nil { + x.QueryConnection = *xxx + } + case "scope": + err = json.Unmarshal(*v, &x.Scope) + if err != nil { + return err + } + case "status", "setupStatus": + err = json.Unmarshal(*v, &x.Status) + if err != nil { + return err + } + case "tags": + err = json.Unmarshal(*v, &x.Tags) + if err != nil { + return err + } + case "type": + err = json.Unmarshal(*v, &x.Type) + if err != nil { + return err + } + } + } + + return nil +} + +// EntityManagementFederatedLogSetupEntityCreateInput - Create input for FederatedLogSetupEntity entity type. +type EntityManagementFederatedLogSetupEntityCreateInput struct { + // See cloudProvider in FederatedLogSetupEntity. + CloudProvider EntityManagementCloudProvider `json:"cloudProvider"` + // See cloudProviderRegion in FederatedLogSetupEntity. + CloudProviderRegion string `json:"cloudProviderRegion"` + // See dataLocationBucket in FederatedLogSetupEntity. + DataLocationBucket string `json:"dataLocationBucket"` + // See dataProcessingComponentId in FederatedLogSetupEntity. + DataProcessingComponentId string `json:"dataProcessingComponentId,omitempty"` + // See dataProcessingConnectionId in FederatedLogSetupEntity. + DataProcessingConnectionId string `json:"dataProcessingConnectionId"` + // See description in FederatedLogSetupEntity. + Description string `json:"description,omitempty"` + // See name in FederatedLogSetupEntity. + Name string `json:"name"` + // See nrAccountId in FederatedLogSetupEntity. + NrAccountId string `json:"nrAccountId"` + // See nrRegion in FederatedLogSetupEntity. + NrRegion EntityManagementNrRegion `json:"nrRegion"` + // See queryConnectionId in FederatedLogSetupEntity. + QueryConnectionId string `json:"queryConnectionId"` + // See scope in FederatedLogSetupEntity. + Scope EntityManagementScopedReferenceInput `json:"scope,omitempty"` + // See status in FederatedLogSetupEntity. + Status EntityManagementFederatedLogSetupStatus `json:"status"` + // See tags in FederatedLogSetupEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogSetupEntityCreateResult - The result of creating an entity. +type EntityManagementFederatedLogSetupEntityCreateResult struct { + // The created entity. + Entity EntityManagementFederatedLogSetupEntity `json:"entity"` +} + // EntityManagementFleetDeployment - Deprecated: A set of configurations that are currently deployed type EntityManagementFleetDeployment struct { // A list of EntityGuid of Managed Entities selected for Canary deploy @@ -5588,7 +5844,7 @@ type ExternalEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -5703,7 +5959,7 @@ type GenericEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -5819,7 +6075,7 @@ type GenericInfrastructureEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -5940,7 +6196,7 @@ type InfrastructureAwsLambdaFunctionEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -6064,7 +6320,7 @@ type InfrastructureHostEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -6279,7 +6535,7 @@ type KeyTransactionEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -6478,7 +6734,7 @@ type MobileApplicationEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -6733,7 +6989,7 @@ type SecureCredentialEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -7183,7 +7439,7 @@ type SyntheticMonitorEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -7330,7 +7586,7 @@ type TeamEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -7447,7 +7703,7 @@ type ThirdPartyServiceEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -7578,7 +7834,7 @@ type UnavailableEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -7706,7 +7962,7 @@ type WorkloadEntity struct { // // See the [NRQL Docs](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/nrql-resources/nrql-syntax-components-functions) for more information about generating a query string. NRDBQuery NRDBResultContainer `json:"nrdbQuery,omitempty"` - // Poll for the results of a previously-executed asychronous NRDB query. + // Poll for the results of a previously-executed asynchronous NRDB query. // // The `queryId` is available in the `queryProgress` data returned by the original asynchronous query. // @@ -7852,6 +8108,9 @@ type EntityAlertViolationInt string // EntityGUID - An encoded Entity GUID type EntityGUID string +// EntityManagementDynamicString - A string meant to be generated at runtime by a function in the form of a directive. +type EntityManagementDynamicString string + // Float - The `Float` scalar type represents signed double-precision fractional // values as specified by // [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). @@ -8810,6 +9069,37 @@ func UnmarshalEntityManagementEntityInterface(b []byte) (*EntityManagementEntity var xxx EntityManagementEntityInterface = &interfaceType + return &xxx, nil + case "EntityManagementFederatedLogSetupEntity": + var interfaceType EntityManagementFederatedLogSetupEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + case "EntityManagementFederatedLogPartitionEntity": + var interfaceType EntityManagementFederatedLogPartitionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + + return &xxx, nil + + case "EntityManagementAwsConnectionEntity": + var interfaceType EntityManagementAwsConnectionEntity + err = json.Unmarshal(b, &interfaceType) + if err != nil { + return nil, err + } + + var xxx EntityManagementEntityInterface = &interfaceType + return &xxx, nil } } else { @@ -9328,3 +9618,305 @@ func (x *EntityManagementActorStitchedFields) UnmarshalJSON(b []byte) error { return nil } + +// EntityManagementAwsAssumeRoleConfig - Configuration for accessing an Aws account via AssumeRole +type EntityManagementAwsAssumeRoleConfig struct { + // External ID to use when assuming the role + ExternalId EntityManagementDynamicString `json:"externalId,omitempty"` + // The ARN of the role to assume + RoleArn string `json:"roleArn"` +} + +// EntityManagementAwsConnectionEntity - Connection entity type for Aws +type EntityManagementAwsConnectionEntity struct { + // A single credential from the choice of AwsCredential + Credential EntityManagementAwsCredentials `json:"credential"` + // The description of that connection. + Description string `json:"description,omitempty"` + // Flag to indicate if the connection is enabled. True by default + Enabled bool `json:"enabled,omitempty"` + // Optional field representing an identifier managed by the consumer + ExternalId string `json:"externalId,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of that connection. + Name string `json:"name"` + // Default region for this connection + Region string `json:"region,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // Optional list of connection settings + Settings []EntityManagementConnectionSettings `json:"settings"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity's type. + Type string `json:"type"` +} + +func (x *EntityManagementAwsConnectionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementAwsCredentials - Base Credential type for Aws +type EntityManagementAwsCredentials struct { + // AssumeRole type + AssumeRole EntityManagementAwsAssumeRoleConfig `json:"assumeRole,omitempty"` +} + +// EntityManagementConnectionSettings - Connection settings type for all connections +type EntityManagementConnectionSettings struct { + // The key or name of the setting + Key string `json:"key"` + // The value of the setting. + Value string `json:"value"` +} + +// EntityManagementAwsConnectionEntityCreateInput - Create input for AwsConnectionEntity entity type. +type EntityManagementAwsConnectionEntityCreateInput struct { + // See credential in AwsConnectionEntity. + Credential EntityManagementAwsCredentialsCreateInput `json:"credential,omitempty"` + // See description in AwsConnectionEntity. + Description string `json:"description,omitempty"` + // See enabled in AwsConnectionEntity. + Enabled bool `json:"enabled,omitempty"` + // See externalId in AwsConnectionEntity. + ExternalId string `json:"externalId,omitempty"` + // See name in AwsConnectionEntity. + Name string `json:"name"` + // See region in AwsConnectionEntity. + Region string `json:"region,omitempty"` + // See scope in AwsConnectionEntity. + Scope EntityManagementScopedReferenceInput `json:"scope,omitempty"` + // See settings in AwsConnectionEntity. + Settings []EntityManagementConnectionSettingsCreateInput `json:"settings,omitempty"` + // See tags in AwsConnectionEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementAwsConnectionEntityCreateResult - The result of creating an entity. +type EntityManagementAwsConnectionEntityCreateResult struct { + // The created entity. + Entity EntityManagementAwsConnectionEntity `json:"entity"` +} + +// EntityManagementConnectionSettingsCreateInput - Create input for ConnectionSettings. +type EntityManagementConnectionSettingsCreateInput struct { + // See key in ConnectionSettings. + Key string `json:"key"` + // See value in ConnectionSettings. + Value string `json:"value"` +} + +// EntityManagementAwsCredentialsCreateInput - Create input for AwsCredentials. +type EntityManagementAwsCredentialsCreateInput struct { + // See assumeRole in AwsCredentials. + AssumeRole EntityManagementAwsAssumeRoleConfigCreateInput `json:"assumeRole,omitempty"` +} + +// EntityManagementAwsAssumeRoleConfigCreateInput - Create input for AwsAssumeRoleConfig. +type EntityManagementAwsAssumeRoleConfigCreateInput struct { + // See roleArn in AwsAssumeRoleConfig. + RoleArn string `json:"roleArn"` +} + +// EntityManagementFederatedLogPartitionEntity - Federated Log partition entity. +type EntityManagementFederatedLogPartitionEntity struct { + // The URI location of the log partition in object storage. + DataLocationUri string `json:"dataLocationURI"` + // The description of the log partition. + Description string `json:"description,omitempty"` + // The entity's global unique identifier. + ID string `json:"id"` + // Indicates if this log partition is the default partition. + IsDefault bool `json:"isDefault"` + // Metadata about the entity. + Metadata EntityManagementMetadata `json:"metadata"` + // The name of the log partition. This corresponds to the partition/event type used in log queries. + Name string `json:"name"` + // The NR account ID associated with the federated log partition. + NrAccountId string `json:"nrAccountId"` + // The database name associated with the log partition. This could refer to a data catalog database or similar structure. + PartitionDatabase string `json:"partitionDatabase"` + // The table name associated with the log partition. This could refer to a data catalog table or similar structure. + PartitionTable string `json:"partitionTable"` + // The optional retention policy for logs in this partition. + RetentionPolicy EntityManagementRetentionPolicy `json:"retentionPolicy,omitempty"` + // The entity's scope. + Scope EntityManagementScopedReference `json:"scope"` + // The federated log setup this partition belongs to. + Setup EntityManagementFederatedLogSetupEntity `json:"setup"` + // The status of the log partition. + Status EntityManagementLogPartitionStatus `json:"status"` + // Collection of tags. + Tags []EntityManagementTag `json:"tags"` + // The entity type. + Type string `json:"type"` +} + +// EntityManagementRetentionPolicy - Retention policy for log data. +type EntityManagementRetentionPolicy struct { + // The duration value for retention. + Duration int `json:"duration"` + // The time unit for the retention duration. + Unit EntityManagementRetentionUnit `json:"unit"` +} + +// EntityManagementRetentionPolicyCreateInput - Create input for RetentionPolicy. +type EntityManagementRetentionPolicyCreateInput struct { + // See duration in RetentionPolicy. + Duration int `json:"duration"` + // See unit in RetentionPolicy. + Unit EntityManagementRetentionUnit `json:"unit"` +} + +func (x *EntityManagementFederatedLogPartitionEntity) ImplementsEntityManagementEntity() {} + +// EntityManagementFederatedLogPartitionEntityCreateInput - Create input for FederatedLogPartitionEntity entity type. +type EntityManagementFederatedLogPartitionEntityCreateInput struct { + // See dataLocationURI in FederatedLogPartitionEntity. + DataLocationUri string `json:"dataLocationURI"` + // See description in FederatedLogPartitionEntity. + Description string `json:"description,omitempty"` + // See isDefault in FederatedLogPartitionEntity. + IsDefault bool `json:"isDefault"` + // See name in FederatedLogPartitionEntity. + Name string `json:"name"` + // See nrAccountId in FederatedLogPartitionEntity. + NrAccountId string `json:"nrAccountId"` + // See partitionDatabase in FederatedLogPartitionEntity. + PartitionDatabase string `json:"partitionDatabase"` + // See partitionTable in FederatedLogPartitionEntity. + PartitionTable string `json:"partitionTable"` + // See retentionPolicy in FederatedLogPartitionEntity. + RetentionPolicy *EntityManagementRetentionPolicyCreateInput `json:"retentionPolicy,omitempty"` + // See scope in FederatedLogPartitionEntity. + Scope EntityManagementScopedReferenceInput `json:"scope,omitempty"` + // See setupId in FederatedLogPartitionEntity. + SetupId string `json:"setupId"` + // See status in FederatedLogPartitionEntity. + Status EntityManagementLogPartitionStatus `json:"status"` + // See tags in FederatedLogPartitionEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogPartitionEntityCreateResult - The result of creating an entity. +type EntityManagementFederatedLogPartitionEntityCreateResult struct { + // The created entity. + Entity EntityManagementFederatedLogPartitionEntity `json:"entity"` +} + +// EntityManagementLogPartitionStatus - Status of a log partition. +type EntityManagementLogPartitionStatus string + +var EntityManagementLogPartitionStatusTypes = struct { + // Indicates the log partition is active. + ACTIVE EntityManagementLogPartitionStatus + // Indicates the log partition is being created. + CREATING EntityManagementLogPartitionStatus + // Indicates the log partition is in an error state. + ERROR EntityManagementLogPartitionStatus + // Indicates the log partition is inactive. + INACTIVE EntityManagementLogPartitionStatus +}{ + // Indicates the log partition is active. + ACTIVE: "ACTIVE", + // Indicates the log partition is being created. + CREATING: "CREATING", + // Indicates the log partition is in an error state. + ERROR: "ERROR", + // Indicates the log partition is inactive. + INACTIVE: "INACTIVE", +} + +// EntityManagementRetentionUnit - Time units for retention policies. +type EntityManagementRetentionUnit string + +var EntityManagementRetentionUnitTypes = struct { + // Days + DAYS EntityManagementRetentionUnit + // Months + MONTHS EntityManagementRetentionUnit + // Weeks + WEEKS EntityManagementRetentionUnit +}{ + // Days + DAYS: "DAYS", + // Months + MONTHS: "MONTHS", + // Weeks + WEEKS: "WEEKS", +} + +// EntityManagementFederatedLogPartitionEntityUpdateResult - The result of updating an entity. +type EntityManagementFederatedLogPartitionEntityUpdateResult struct { + // The updated entity. + Entity EntityManagementFederatedLogPartitionEntity `json:"entity"` +} + +// EntityManagementFederatedLogPartitionEntityUpdateInput - Update input for FederatedLogPartitionEntity entity type. +type EntityManagementFederatedLogPartitionEntityUpdateInput struct { + // See dataLocationURI in FederatedLogPartitionEntity. + DataLocationUri string `json:"dataLocationURI,omitempty"` + // See description in FederatedLogPartitionEntity. + Description string `json:"description,omitempty"` + // See isDefault in FederatedLogPartitionEntity. + IsDefault bool `json:"isDefault,omitempty"` + // See name in FederatedLogPartitionEntity. + Name string `json:"name,omitempty"` + // See nrAccountId in FederatedLogPartitionEntity. + NrAccountId string `json:"nrAccountId,omitempty"` + // See partitionDatabase in FederatedLogPartitionEntity. + PartitionDatabase string `json:"partitionDatabase,omitempty"` + // See partitionTable in FederatedLogPartitionEntity. + PartitionTable string `json:"partitionTable,omitempty"` + // See retentionPolicy in FederatedLogPartitionEntity. + RetentionPolicy *EntityManagementRetentionPolicyUpdateInput `json:"retentionPolicy,omitempty"` + // See setupId in FederatedLogPartitionEntity. + SetupId string `json:"setupId,omitempty"` + // See status in FederatedLogPartitionEntity. + Status EntityManagementLogPartitionStatus `json:"status,omitempty"` + // See tags in FederatedLogPartitionEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementFederatedLogSetupEntityUpdateResult - The result of updating an entity. +type EntityManagementFederatedLogSetupEntityUpdateResult struct { + // The updated entity. + Entity EntityManagementFederatedLogSetupEntity `json:"entity"` +} + +// EntityManagementFederatedLogSetupEntityUpdateInput - Update input for FederatedLogSetupEntity entity type. +type EntityManagementFederatedLogSetupEntityUpdateInput struct { + // See cloudProvider in FederatedLogSetupEntity. + CloudProvider EntityManagementCloudProvider `json:"cloudProvider,omitempty"` + // See cloudProviderRegion in FederatedLogSetupEntity. + CloudProviderRegion string `json:"cloudProviderRegion,omitempty"` + // See dataLocationBucket in FederatedLogSetupEntity. + DataLocationBucket string `json:"dataLocationBucket,omitempty"` + // See dataProcessingComponentId in FederatedLogSetupEntity. + DataProcessingComponentId string `json:"dataProcessingComponentId,omitempty"` + // See dataProcessingConnectionId in FederatedLogSetupEntity. + DataProcessingConnectionId string `json:"dataProcessingConnectionId,omitempty"` + // See description in FederatedLogSetupEntity. + Description string `json:"description,omitempty"` + // See name in FederatedLogSetupEntity. + Name string `json:"name,omitempty"` + // See nrAccountId in FederatedLogSetupEntity. + NrAccountId string `json:"nrAccountId,omitempty"` + // See nrRegion in FederatedLogSetupEntity. + NrRegion EntityManagementNrRegion `json:"nrRegion,omitempty"` + // See queryConnectionId in FederatedLogSetupEntity. + QueryConnectionId string `json:"queryConnectionId,omitempty"` + // See status in FederatedLogSetupEntity. + Status EntityManagementFederatedLogSetupStatus `json:"status,omitempty"` + // See tags in FederatedLogSetupEntity. + Tags []EntityManagementTagInput `json:"tags,omitempty"` +} + +// EntityManagementRetentionPolicyUpdateInput - Update input for RetentionPolicy. +type EntityManagementRetentionPolicyUpdateInput struct { + // See duration in RetentionPolicy. + Duration int `json:"duration"` + // See unit in RetentionPolicy. + Unit EntityManagementRetentionUnit `json:"unit"` +}