(ctx context.Context, docsSvc *docs.Service, docID, imageURL string, target docsImageTarget, result docsInsertImageResult)
| 275 | } |
| 276 | |
| 277 | func (c *DocsInsertImageCmd) insertImageURL(ctx context.Context, docsSvc *docs.Service, docID, imageURL string, target docsImageTarget, result docsInsertImageResult) (docsInsertImageResult, error) { |
| 278 | reqs, index, tabID, err := c.buildInsertRequests(ctx, docsSvc, docID, target, imageURL) |
| 279 | if err != nil { |
| 280 | return result, err |
| 281 | } |
| 282 | if err := batchUpdateImageInsertRequests(ctx, docsSvc, docID, reqs); err != nil { |
| 283 | return result, fmt.Errorf("insert image: %w", err) |
| 284 | } |
| 285 | result.documentID = docID |
| 286 | result.atIndex = index |
| 287 | result.tabID = tabID |
| 288 | result.requests = len(reqs) |
| 289 | return result, nil |
| 290 | } |
| 291 | |
| 292 | func (c *DocsInsertImageCmd) insertRestrictedImageFallback(ctx context.Context, docsSvc *docs.Service, docID string, uploaded *drive.File, target docsImageTarget, result docsInsertImageResult) (docsInsertImageResult, error) { |
| 293 | link := uploaded.WebViewLink |
no test coverage detected