Skip to content

Latest commit

 

History

History
208 lines (127 loc) · 5.51 KB

MessageChannelsApi.md

File metadata and controls

208 lines (127 loc) · 5.51 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}
GetMessageChannels 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()

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

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]