MCPcopy Create free account
hub / github.com/openclaw/gogcli / copyDataValidation

Function copyDataValidation

internal/cmd/sheets_validation.go:571–632  ·  view source on GitHub ↗
(ctx context.Context, svc *sheets.Service, spreadsheetID, sourceA1, destA1 string)

Source from the content-addressed store, hash-verified

569}
570
571func copyDataValidation(ctx context.Context, svc *sheets.Service, spreadsheetID, sourceA1, destA1 string) error {
572 catalog, err := fetchSpreadsheetRangeCatalog(ctx, svc, spreadsheetID)
573 if err != nil {
574 return err
575 }
576
577 sourceGrid, err := resolveGridRangeWithCatalog(sourceA1, catalog, "copy-validation-from")
578 if err != nil {
579 return err
580 }
581
582 destRange, err := parseSheetRange(destA1, "updated")
583 if err != nil {
584 return err
585 }
586 destGrid, err := gridRangeFromMap(destRange, catalog.SheetIDsByTitle, "updated")
587 if err != nil {
588 return err
589 }
590 sourceGrid = boundGridRangeToSheet(sourceGrid, catalog)
591 destGrid = boundGridRangeToSheet(destGrid, catalog)
592
593 spans, err := fetchTableValidationSpans(ctx, svc, spreadsheetID)
594 if err != nil {
595 return err
596 }
597 copyOptions, err := resolveTableValidationCopyOptions(
598 ctx,
599 svc,
600 spreadsheetID,
601 sourceGrid,
602 destGrid,
603 spans,
604 catalog,
605 false,
606 )
607 if err != nil {
608 return err
609 }
610 supplemental, err := sheetsvalidation.BuildCopyRequests(sourceGrid, destGrid, false, spans, copyOptions)
611 if err != nil {
612 return sheetsValidationPlannerError(err)
613 }
614 requests := make([]*sheets.Request, 0, 1+len(supplemental))
615 requests = append(requests, &sheets.Request{
616 CopyPaste: &sheets.CopyPasteRequest{
617 Source: sourceGrid,
618 Destination: destGrid,
619 PasteType: "PASTE_DATA_VALIDATION",
620 },
621 })
622 requests = append(requests, supplemental...)
623 req := &sheets.BatchUpdateSpreadsheetRequest{
624 Requests: requests,
625 }
626
627 _, err = svc.Spreadsheets.BatchUpdate(spreadsheetID, req).Do()
628 if err != nil {

Callers 3

RunMethod · 0.85
RunMethod · 0.85

Calls 12

BuildCopyRequestsFunction · 0.92
parseSheetRangeFunction · 0.85
gridRangeFromMapFunction · 0.85
boundGridRangeToSheetFunction · 0.85
ErrorfMethod · 0.80
DoMethod · 0.65
BatchUpdateMethod · 0.65