| 2483 | } |
| 2484 | |
| 2485 | func (c *unixSocketClient) UpdateBridge( |
| 2486 | ctx context.Context, |
| 2487 | id string, |
| 2488 | request UpdateBridgeRequest, |
| 2489 | ) (BridgeRecord, error) { |
| 2490 | var response struct { |
| 2491 | Bridge BridgeRecord `json:"bridge"` |
| 2492 | } |
| 2493 | path := "/api/bridges/" + url.PathEscape(strings.TrimSpace(id)) |
| 2494 | if err := c.doJSON(ctx, http.MethodPatch, path, nil, request, &response); err != nil { |
| 2495 | return BridgeRecord{}, err |
| 2496 | } |
| 2497 | return response.Bridge, nil |
| 2498 | } |
| 2499 | |
| 2500 | func (c *unixSocketClient) EnableBridge(ctx context.Context, id string) (BridgeRecord, error) { |
| 2501 | return c.bridgeAction(ctx, strings.TrimSpace(id), "enable") |