All URIs are relative to https://api.opal.dev/v1
| Method | HTTP request | Description |
|---|---|---|
| CreateEventStream | Post /event-streams | Create event stream |
| DeleteEventStream | Delete /event-streams/{event_stream_id} | Delete event stream |
| GetEventStreams | Get /event-streams | Get event streams |
| UpdateEventStream | Put /event-streams/{event_stream_id} | Update event stream |
EventStream CreateEventStream(ctx).CreateEventStreamInfo(createEventStreamInfo).Execute()
Create event stream
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
createEventStreamInfo := *openapiclient.NewCreateEventStreamInfo("Name_example", openapiclient.EventStreamConnectionTypeEnum("WEBHOOK")) // CreateEventStreamInfo |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EventStreamsAPI.CreateEventStream(context.Background()).CreateEventStreamInfo(createEventStreamInfo).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EventStreamsAPI.CreateEventStream``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateEventStream`: EventStream
fmt.Fprintf(os.Stdout, "Response from `EventStreamsAPI.CreateEventStream`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateEventStreamRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createEventStreamInfo | CreateEventStreamInfo |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteEventStream(ctx, eventStreamId).Execute()
Delete event stream
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
eventStreamId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the event stream.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.EventStreamsAPI.DeleteEventStream(context.Background(), eventStreamId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EventStreamsAPI.DeleteEventStream``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| eventStreamId | string | The ID of the event stream. |
Other parameters are passed through a pointer to a apiDeleteEventStreamRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EventStreamList GetEventStreams(ctx).Execute()
Get event streams
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EventStreamsAPI.GetEventStreams(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EventStreamsAPI.GetEventStreams``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetEventStreams`: EventStreamList
fmt.Fprintf(os.Stdout, "Response from `EventStreamsAPI.GetEventStreams`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetEventStreamsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
EventStream UpdateEventStream(ctx, eventStreamId).UpdateEventStreamInfo(updateEventStreamInfo).Execute()
Update event stream
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
eventStreamId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the event stream.
updateEventStreamInfo := *openapiclient.NewUpdateEventStreamInfo() // UpdateEventStreamInfo |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EventStreamsAPI.UpdateEventStream(context.Background(), eventStreamId).UpdateEventStreamInfo(updateEventStreamInfo).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EventStreamsAPI.UpdateEventStream``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateEventStream`: EventStream
fmt.Fprintf(os.Stdout, "Response from `EventStreamsAPI.UpdateEventStream`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| eventStreamId | string | The ID of the event stream. |
Other parameters are passed through a pointer to a apiUpdateEventStreamRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
updateEventStreamInfo | UpdateEventStreamInfo | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]