fix(provision): reconcile channel pricing and hosted access

This commit is contained in:
phamnazage-jpg
2026-05-20 22:09:40 +08:00
parent 83ee216a4d
commit ca1d448cc0
27 changed files with 1344 additions and 154 deletions

View File

@@ -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
}