Skip to content

Latest commit

 

History

History
279 lines (175 loc) · 7.18 KB

File metadata and controls

279 lines (175 loc) · 7.18 KB

\EventStreamsAPI

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

CreateEventStream

EventStream CreateEventStream(ctx).CreateEventStreamInfo(createEventStreamInfo).Execute()

Create event stream

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateEventStreamRequest struct via the builder pattern

Name Type Description Notes
createEventStreamInfo CreateEventStreamInfo

Return type

EventStream

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteEventStream

DeleteEventStream(ctx, eventStreamId).Execute()

Delete event stream

Example

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)
	}
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDeleteEventStreamRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetEventStreams

EventStreamList GetEventStreams(ctx).Execute()

Get event streams

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetEventStreamsRequest struct via the builder pattern

Return type

EventStreamList

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateEventStream

EventStream UpdateEventStream(ctx, eventStreamId).UpdateEventStreamInfo(updateEventStreamInfo).Execute()

Update event stream

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiUpdateEventStreamRequest struct via the builder pattern

Name Type Description Notes

updateEventStreamInfo | UpdateEventStreamInfo | |

Return type

EventStream

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]