-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edd8f22
commit 1c5137a
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package eventing | ||
|
||
import ( | ||
"github.com/project-kessel/inventory-api/internal/biz/model" | ||
"time" | ||
) | ||
|
||
type Event struct { | ||
Specversion string `json:"specversion"` | ||
Type string `json:"type"` | ||
Source string `json:"source"` | ||
Id string `json:"id"` | ||
Subject string `json:"subject"` | ||
Time time.Time `json:"time"` | ||
DataContentType string `json:"datacontenttype"` | ||
Data interface{} `json:"data"` | ||
} | ||
|
||
type ResourceData struct { | ||
Metadata ResourceMetadata `json:"metadata"` | ||
ReporterData ResourceReporter `json:"reporter_data"` | ||
ResourceData model.JsonObject `json:"resource_data,omitempty"` | ||
} | ||
|
||
type RelationshipData struct { | ||
Metadata RelationshipMetadata `json:"metadata"` | ||
ReporterData RelationshipReporter `json:"reporter_data"` | ||
ResourceData model.JsonObject `json:"resource_data,omitempty"` | ||
} | ||
|
||
type ResourceMetadata struct { | ||
Id string `json:"id"` | ||
ResourceType string `json:"resource_type"` | ||
OrgId string `json:"org_id"` | ||
CreatedAt *time.Time `json:"created_at,omitempty"` | ||
UpdatedAt *time.Time `json:"updated_at,omitempty"` | ||
DeletedAt *time.Time `json:"deleted_at,omitempty"` | ||
WorkspaceId string `json:"workspace_id"` | ||
Labels []ResourceLabel `json:"labels,omitempty"` | ||
} | ||
|
||
type ResourceLabel struct { | ||
Key string `json:"key"` | ||
Value string `json:"value"` | ||
} | ||
|
||
type ResourceReporter struct { | ||
ReporterInstanceId string `json:"reporter_instance_id"` | ||
ReporterType string `json:"reporter_type"` | ||
ConsoleHref string `json:"console_href"` | ||
ApiHref string `json:"api_href"` | ||
LocalResourceId string `json:"local_resource_id"` | ||
ReporterVersion string `json:"reporter_version"` | ||
} | ||
|
||
type RelationshipMetadata struct { | ||
Id string `json:"id"` | ||
RelationshipType string `json:"relationship_type"` | ||
CreatedAt *time.Time `json:"created_at,omitempty"` | ||
UpdatedAt *time.Time `json:"updated_at,omitempty"` | ||
DeletedAt *time.Time `json:"deleted_at,omitempty"` | ||
} | ||
|
||
type RelationshipReporter struct { | ||
ReporterType string `json:"reporter_type"` | ||
SubjectLocalResourceId string `json:"subject_local_resource_id"` | ||
ObjectLocalResourceId string `json:"object_local_resource_id"` | ||
ReporterVersion string `json:"reporter_version"` | ||
ReporterInstanceId string `json:"reporter_instance_id"` | ||
} |