fix(provision): reconcile channel pricing and hosted access
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package sub2api
|
||||
|
||||
import "context"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (c *Client) CreateChannel(ctx context.Context, req CreateChannelRequest) (ChannelRef, error) {
|
||||
var ref ChannelRef
|
||||
@@ -9,3 +13,15 @@ func (c *Client) CreateChannel(ctx context.Context, req CreateChannelRequest) (C
|
||||
}
|
||||
return ref, nil
|
||||
}
|
||||
|
||||
func (c *Client) UpdateChannel(ctx context.Context, channelID string, req CreateChannelRequest) error {
|
||||
path := fmt.Sprintf("/api/v1/admin/channels/%s", channelID)
|
||||
statusCode, _, body, err := c.perform(ctx, http.MethodPut, path, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if statusCode < http.StatusOK || statusCode >= http.StatusMultipleChoices {
|
||||
return newHTTPError(http.MethodPut, path, statusCode, body)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user