Skip to content

Latest commit

 

History

History
208 lines (129 loc) · 5.46 KB

File metadata and controls

208 lines (129 loc) · 5.46 KB

\MessageChannelsAPI

All URIs are relative to https://api.opal.dev/v1

Method HTTP request Description
CreateMessageChannel Post /message-channels
GetMessageChannel Get /message-channels/{message_channel_id} Get message channel by ID
GetMessageChannels Get /message-channels Get message channels

CreateMessageChannel

MessageChannel CreateMessageChannel(ctx).CreateMessageChannelInfo(createMessageChannelInfo).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	createMessageChannelInfo := *openapiclient.NewCreateMessageChannelInfo(openapiclient.MessageChannelProviderEnum("SLACK"), "C03FJR97276") // CreateMessageChannelInfo | The `MessageChannel` object to be created.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MessageChannelsAPI.CreateMessageChannel(context.Background()).CreateMessageChannelInfo(createMessageChannelInfo).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MessageChannelsAPI.CreateMessageChannel``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateMessageChannel`: MessageChannel
	fmt.Fprintf(os.Stdout, "Response from `MessageChannelsAPI.CreateMessageChannel`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
createMessageChannelInfo CreateMessageChannelInfo The `MessageChannel` object to be created.

Return type

MessageChannel

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]

GetMessageChannel

MessageChannel GetMessageChannel(ctx, messageChannelId).Execute()

Get message channel by ID

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	messageChannelId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the message_channel.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.MessageChannelsAPI.GetMessageChannel(context.Background(), messageChannelId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MessageChannelsAPI.GetMessageChannel``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetMessageChannel`: MessageChannel
	fmt.Fprintf(os.Stdout, "Response from `MessageChannelsAPI.GetMessageChannel`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
messageChannelId string The ID of the message_channel.

Other Parameters

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

Name Type Description Notes

Return type

MessageChannel

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]

GetMessageChannels

MessageChannelList GetMessageChannels(ctx).Execute()

Get message channels

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.MessageChannelsAPI.GetMessageChannels(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `MessageChannelsAPI.GetMessageChannels``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetMessageChannels`: MessageChannelList
	fmt.Fprintf(os.Stdout, "Response from `MessageChannelsAPI.GetMessageChannels`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

MessageChannelList

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]