приватные каналы
This commit is contained in:
@@ -542,6 +542,26 @@ type Channel struct {
|
||||
Username *string `json:"username"`
|
||||
}
|
||||
|
||||
type CreateChannelInput struct {
|
||||
Username *string `json:"username,omitempty"`
|
||||
InviteLink *string `json:"invite_link,omitempty"`
|
||||
}
|
||||
|
||||
type CreateChannelsInput struct {
|
||||
Channels []CreateChannelInput `json:"channels"`
|
||||
}
|
||||
|
||||
type CreateChannelResult struct {
|
||||
Index int `json:"index"`
|
||||
Status string `json:"status"`
|
||||
Channel *Channel `json:"channel,omitempty"`
|
||||
Error *string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type CreateChannelsOutput struct {
|
||||
Results []CreateChannelResult `json:"results"`
|
||||
}
|
||||
|
||||
type CostInfo struct {
|
||||
Type string `json:"type"`
|
||||
Value float64 `json:"value"`
|
||||
@@ -588,10 +608,10 @@ type PostOutput struct {
|
||||
}
|
||||
|
||||
type CreatePlacementChannelInput struct {
|
||||
Username string `json:"username"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
Comment *string `json:"comment,omitempty"`
|
||||
Details *PlacementDetails `json:"details,omitempty"`
|
||||
ChannelID string `json:"channel_id"`
|
||||
Status *string `json:"status,omitempty"`
|
||||
Comment *string `json:"comment,omitempty"`
|
||||
Details *PlacementDetails `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
type CreatePlacementsInput struct {
|
||||
@@ -635,6 +655,24 @@ func (c *Client) CreatePlacements(
|
||||
return &placements, err
|
||||
}
|
||||
|
||||
func (c *Client) CreateChannels(
|
||||
ctx context.Context,
|
||||
jwt string,
|
||||
input CreateChannelsInput,
|
||||
) (*CreateChannelsOutput, error) {
|
||||
var response CreateChannelsOutput
|
||||
err := c.do(
|
||||
ctx,
|
||||
http.MethodPost,
|
||||
"api/v1/channels",
|
||||
input,
|
||||
&response,
|
||||
withBearer(jwt),
|
||||
)
|
||||
|
||||
return &response, err
|
||||
}
|
||||
|
||||
func (c *Client) GetPlacements(
|
||||
ctx context.Context,
|
||||
jwt string,
|
||||
|
||||
Reference in New Issue
Block a user