Abin Simon 5d90483bfa
Enforce site filter for Groups restore (#4496)
This PR reworks the groups restore to and makes the site to restore to mandatory. This also updates some missing filtering capabilities in groups export.

---

#### Does this PR need a docs update or release note?

- [x]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [ ]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* closes https://github.com/alcionai/corso/issues/4462

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2023-10-16 12:05:55 +00:00

118 lines
3.1 KiB
Go

package testdata
import (
"strings"
"github.com/spf13/cobra"
)
func FlgInputs(in []string) string { return strings.Join(in, ",") }
var (
BackupInput = "backup-id"
SiteInput = "site-id"
GroupsInput = []string{"team1", "group2"}
MailboxInput = []string{"mailbox1", "mailbox2"}
UsersInput = []string{"users1", "users2"}
SiteIDInput = []string{"siteID1", "siteID2"}
WebURLInput = []string{"webURL1", "webURL2"}
ExchangeCategoryDataInput = []string{"email", "events", "contacts"}
SharepointCategoryDataInput = []string{"files", "lists", "pages"}
GroupsCategoryDataInput = []string{"files", "lists", "pages", "messages"}
ContactInput = []string{"contact1", "contact2"}
ContactFldInput = []string{"contactFld1", "contactFld2"}
ContactNameInput = "contactName"
EmailInput = []string{"mail1", "mail2"}
EmailFldInput = []string{"mailFld1", "mailFld2"}
EmailReceivedAfterInput = "mailReceivedAfter"
EmailReceivedBeforeInput = "mailReceivedBefore"
EmailSenderInput = "mailSender"
EmailSubjectInput = "mailSubject"
EventInput = []string{"event1", "event2"}
EventCalInput = []string{"eventCal1", "eventCal2"}
EventOrganizerInput = "eventOrganizer"
EventRecursInput = "eventRecurs"
EventStartsAfterInput = "eventStartsAfter"
EventStartsBeforeInput = "eventStartsBefore"
EventSubjectInput = "eventSubject"
LibraryInput = "library"
FileNameInput = []string{"fileName1", "fileName2"}
FolderPathInput = []string{"folderPath1", "folderPath2"}
FileCreatedAfterInput = "fileCreatedAfter"
FileCreatedBeforeInput = "fileCreatedBefore"
FileModifiedAfterInput = "fileModifiedAfter"
FileModifiedBeforeInput = "fileModifiedBefore"
ListFolderInput = []string{"listFolder1", "listFolder2"}
ListItemInput = []string{"listItem1", "listItem2"}
PageFolderInput = []string{"pageFolder1", "pageFolder2"}
PageInput = []string{"page1", "page2"}
Collisions = "collisions"
Destination = "destination"
ToResource = "toResource"
SkipPermissions = false
DeltaPageSize = "7"
Archive = true
FormatType = "json"
AzureClientID = "testAzureClientId"
AzureTenantID = "testAzureTenantId"
AzureClientSecret = "testAzureClientSecret"
AWSAccessKeyID = "testAWSAccessKeyID"
AWSSecretAccessKey = "testAWSSecretAccessKey"
AWSSessionToken = "testAWSSessionToken"
CorsoPassphrase = "testCorsoPassphrase"
RestoreDestination = "test-restore-destination"
FetchParallelism = "3"
FailFast = true
DisableIncrementals = true
ForceItemDataDownload = true
DisableDelta = true
EnableImmutableID = true
DisableConcurrencyLimiter = true
)
func WithFlags2(
cc *cobra.Command,
command string,
flagSets ...[]string,
) {
args := []string{command}
for _, sl := range flagSets {
args = append(args, sl...)
}
cc.SetArgs(args)
}
func WithFlags(
command string,
flagSets ...[]string,
) func(*cobra.Command) {
return func(cc *cobra.Command) {
args := []string{command}
for _, sl := range flagSets {
args = append(args, sl...)
}
cc.SetArgs(args)
}
}