Skip to content

Latest commit

 

History

History
110 lines (86 loc) · 6.18 KB

README.md

File metadata and controls

110 lines (86 loc) · 6.18 KB

Channel

(Channel)

Available Operations

GetMessagingChannel

Retrieve a channel

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.GetMessagingChannelRequest{
        ConnectionID: "<value>",
        ID: "<id>",
    }
    ctx := context.Background()
    res, err := s.Channel.GetMessagingChannel(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.MessagingChannel != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetMessagingChannelRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetMessagingChannelResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /

ListMessagingChannels

List all channels

Example Usage

package main

import(
	"os"
	unifiedgosdk "github.com/unified-to/unified-go-sdk"
	"github.com/unified-to/unified-go-sdk/pkg/models/operations"
	"context"
	"log"
)

func main() {
    s := unifiedgosdk.New(
        unifiedgosdk.WithSecurity(os.Getenv("JWT")),
    )
    request := operations.ListMessagingChannelsRequest{
        ConnectionID: "<value>",
    }
    ctx := context.Background()
    res, err := s.Channel.ListMessagingChannels(ctx, request)
    if err != nil {
        log.Fatal(err)
    }
    if res.MessagingChannels != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.ListMessagingChannelsRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.ListMessagingChannelsResponse, error

Error Object Status Code Content Type
sdkerrors.SDKError 4xx-5xx /