selectors

package
v0.0.0-...-4fc5b5b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Example (Filters)

ExampleFilters demonstrates selector filters.

package main

import (
	"github.com/alcionai/corso/src/pkg/selectors"
)

func main() {
	ser := selectors.NewExchangeRestore(
		[]string{"your-user-id", "foo-user-id", "bar-user-id"})

	// In addition to data ownership details (user, folder, itemID), certain operations
	// like `backup details` and restores allow items to be selected by filtering on
	// previously gathered metadata.

	// Unlike `Include()`, which will incorporate data so long as any Scope matches,
	// scopes in the `Filter()` category work as an intersection.  Data must pass
	// every filter to be selected.  The following selector will only include emails
	// received before the data, and with the given subject
	ser.Filter(
		// Note that the ReceivedBefore scope only accepts a single string instead of
		// a slice.  Since Filters act as intersections rather than unions, it wouldn't
		// make much sense to accept multiple values here.
		ser.MailReceivedBefore("2006-01-02"),
		// But you can still make a compound filter by adding each scope individually.
		ser.MailSubject("the answer to life, the universe, and everything"))
}
Output:

Example (IncludeFoldersAndItems)

ExampleIncludeFoldersAndItems demonstrates how to select for granular data.

package main

import (
	"github.com/alcionai/corso/src/pkg/selectors"
)

func main() {
	seb := selectors.NewExchangeBackup(
		[]string{"your-user-id", "foo-user-id", "bar-user-id"})

	// Much of the data handled by Corso exists within an established hierarchy.
	// Resource Owner-level data (such as users) sits at the top, with Folder
	// structures and individual items below.  Higher level scopes will automatically
	// involve all descendant data in the hierarchy.

	// AllData will select all Exchange data owned by the users specified
	// in the selector.
	seb.AllData()

	// Lower level Scopes are described on a per-data-type basis.  This scope will
	// select all email in the Inbox folder, for all users in the tenant.
	seb.MailFolders([]string{"Inbox"})

	// Folder-level scopes will, by default, include every folder whose name matches
	// the provided value, regardless of its position in the hierarchy.  If you want
	// to restrict the scope to a specific path, you can use the PrefixMatch option.
	// This scope selects all data in /foolder, but will skip /other/foolder.
	seb.MailFolders(
		[]string{"foolder"},
		selectors.PrefixMatch())

	// Individual items can be selected, too.  You don't have to use the Any()
	// selection for users and folders when specifying an item, but these ids are
	// usually unique, and have a low chance of collision.
	seb.Mails(
		selectors.Any(),
		[]string{"item-id-1", "item-id-2"})
}
Output:

Example (NewSelector)

ExampleNewSelector demonstrates creation and distribution of a Selector.

package main

import (
	"fmt"

	"github.com/alcionai/corso/src/pkg/selectors"
)

func main() {
	// Selectors should use application-specific constructors.
	// Generate a selector for backup operations.
	seb := selectors.NewExchangeBackup(nil)

	// Generate a selector for restore and 'backup details' operations.
	ser := selectors.NewExchangeRestore(nil)

	// Selectors specify the data that should be handled
	// in an operation by specifying the Scope of data.
	// Initially, the selector will ask for the resource
	// owners (users, in this example).  Only these users
	// will be involved in the backup.
	seb = selectors.NewExchangeBackup(
		[]string{"your-user-id", "foo-user-id", "bar-user-id"})

	// The core selector can be passed around without slicing any
	// application-specific data.
	bSel := seb.Selector
	rSel := ser.Selector

	// And can be re-cast to the application instance again.
	seb, _ = bSel.ToExchangeBackup()
	ser, _ = rSel.ToExchangeRestore()

	// Casting the core selector to a different application will
	// result in an error.
	if _, err := bSel.ToOneDriveBackup(); err != nil {
		// this errors, because bSel is an Exchange selector.
		fmt.Println(err)
	}

	// You can inspect the selector.Service to know which application to use.
	switch bSel.Service {
	case selectors.ServiceExchange:
		//nolint
		bSel.ToExchangeBackup()
	case selectors.ServiceOneDrive:
		//nolint
		bSel.ToOneDriveBackup()
	}

}
Output:

wrong selector service type: OneDrive is not Exchange
Example (ReduceDetails)

ExampleReduceDetails demonstrates how selectors are used to filter backup details.

package main

import (
	"context"
	"fmt"

	"github.com/alcionai/corso/src/pkg/backup/details"
	"github.com/alcionai/corso/src/pkg/fault"
	"github.com/alcionai/corso/src/pkg/selectors"
)

var (
	ctxBG          = context.Background()
	exampleDetails = &details.Details{
		DetailsModel: details.DetailsModel{
			Entries: []details.Entry{
				{
					RepoRef:     "tID/exchange/your-user-id/email/example/itemID",
					LocationRef: "example",
					ShortRef:    "xyz",
					ItemRef:     "123",
					ItemInfo: details.ItemInfo{
						Exchange: &details.ExchangeInfo{
							ItemType: details.ExchangeMail,
							Subject:  "the answer to life, the universe, and everything",
						},
					},
				},
			},
		},
	}
)

func main() {
	ser := selectors.NewExchangeRestore(
		[]string{"your-user-id", "foo-user-id", "bar-user-id"})
	errAgg := fault.New(false)

	// The Reduce() call is where our constructed selectors are applied to the data
	// from a previous backup record.
	filteredDetails := ser.Reduce(ctxBG, exampleDetails, errAgg)

	// We haven't added any scopes to our selector yet, so none of the data is retained.
	fmt.Println("Before adding scopes:", len(filteredDetails.Entries))

	ser.Include(ser.Mails([]string{"example"}, []string{"xyz"}))
	ser.Filter(ser.MailSubject("the answer to life"))

	// Now that we've selected our data, we should find a result.
	filteredDetails = ser.Reduce(ctxBG, exampleDetails, errAgg)
	fmt.Println("After adding scopes:", len(filteredDetails.Entries))

}
Output:

Before adding scopes: 0
After adding scopes: 1
Example (ScopeMatching)

ExampleScopeMatching demonstrates how to compare data against an individual scope.

package main

import (
	"fmt"

	"github.com/alcionai/corso/src/pkg/selectors"
)

func main() {
	// Just like sets of backup data can be filtered down using Reduce(), we can check
	// if an individual bit of data matches our scopes, too.
	scope := selectors.
		NewExchangeBackup(
			[]string{"your-user-id", "foo-user-id", "bar-user-id"}).
		Mails([]string{"Inbox"}, selectors.Any())[0]

	// To compare data against a scope, you need to specify the category of data,
	// and input the value to check.
	result := scope.Matches(selectors.ExchangeMailFolder, "inbox")
	fmt.Println("Matches the mail folder 'inbox':", result)

	// Non-matching values will return false.
	result = scope.Matches(selectors.ExchangeMailFolder, "Archive")
	fmt.Println("Matches the mail folder by display name 'Archive':", result)

	// If you specify a category that doesn't belong to the expected
	// data type, the result is always false, even if the underlying
	// comparators match.
	result = scope.Matches(selectors.ExchangeContact, "id-1")
	fmt.Println("Matches the contact by id 'id-1':", result)

	// When in doubt, you can check the category of data in the scope
	// with the Category() method.
	cat := scope.Category()
	fmt.Println("Scope Category:", cat)

}
Output:

Matches the mail folder 'inbox': true
Matches the mail folder by display name 'Archive': false
Matches the contact by id 'id-1': false
Scope Category: ExchangeMail

Index

Examples

Constants

View Source
const (
	ExchangeCategoryUnknown exchangeCategory = ""

	// types of data identified by exchange
	ExchangeContact       exchangeCategory = "ExchangeContact"
	ExchangeContactFolder exchangeCategory = "ExchangeContactFolder"
	ExchangeEvent         exchangeCategory = "ExchangeEvent"
	ExchangeEventCalendar exchangeCategory = "ExchangeEventCalendar"
	ExchangeMail          exchangeCategory = "ExchangeMail"
	ExchangeMailFolder    exchangeCategory = "ExchangeMailFolder"
	ExchangeUser          exchangeCategory = "ExchangeUser"

	// data contained within details.ItemInfo
	ExchangeInfoMailSender         exchangeCategory = "ExchangeInfoMailSender"
	ExchangeInfoMailSubject        exchangeCategory = "ExchangeInfoMailSubject"
	ExchangeInfoMailReceivedAfter  exchangeCategory = "ExchangeInfoMailReceivedAfter"
	ExchangeInfoMailReceivedBefore exchangeCategory = "ExchangeInfoMailReceivedBefore"
	ExchangeInfoContactName        exchangeCategory = "ExchangeInfoContactName"
	ExchangeInfoEventOrganizer     exchangeCategory = "ExchangeInfoEventOrganizer"
	ExchangeInfoEventRecurs        exchangeCategory = "ExchangeInfoEventRecurs"
	ExchangeInfoEventStartsAfter   exchangeCategory = "ExchangeInfoEventStartsAfter"
	ExchangeInfoEventStartsBefore  exchangeCategory = "ExchangeInfoEventStartsBefore"
	ExchangeInfoEventSubject       exchangeCategory = "ExchangeInfoEventSubject"
)
View Source
const (
	GroupsCategoryUnknown groupsCategory = ""

	// types of data in Groups
	GroupsGroup            groupsCategory = "GroupsGroup"
	GroupsChannel          groupsCategory = "GroupsChannel"
	GroupsChannelMessage   groupsCategory = "GroupsChannelMessage"
	GroupsConversation     groupsCategory = "GroupsConversation"
	GroupsConversationPost groupsCategory = "GroupsConversationPost"
	GroupsLibraryFolder    groupsCategory = "GroupsLibraryFolder"
	GroupsLibraryItem      groupsCategory = "GroupsLibraryItem"
	GroupsList             groupsCategory = "GroupsList"
	GroupsListItem         groupsCategory = "GroupsListItem"
	GroupsPageFolder       groupsCategory = "GroupsPageFolder"
	GroupsPage             groupsCategory = "GroupsPage"

	// details.itemInfo comparables
	GroupsInfoLibraryItemCreatedAfter   groupsCategory = "GroupsInfoLibraryItemCreatedAfter"
	GroupsInfoLibraryItemCreatedBefore  groupsCategory = "GroupsInfoLibraryItemCreatedBefore"
	GroupsInfoLibraryItemModifiedAfter  groupsCategory = "GroupsInfoLibraryItemModifiedAfter"
	GroupsInfoLibraryItemModifiedBefore groupsCategory = "GroupsInfoLibraryItemModifiedBefore"

	// channel and drive selection
	GroupsInfoSite             groupsCategory = "GroupsInfoSite"
	GroupsInfoSiteLibraryDrive groupsCategory = "GroupsInfoSiteLibraryDrive"

	// data contained within details.ItemInfo
	GroupsInfoChannelMessageCreatedAfter    groupsCategory = "GroupsInfoChannelMessageCreatedAfter"
	GroupsInfoChannelMessageCreatedBefore   groupsCategory = "GroupsInfoChannelMessageCreatedBefore"
	GroupsInfoChannelMessageCreator         groupsCategory = "GroupsInfoChannelMessageCreator"
	GroupsInfoChannelMessageLastReplyAfter  groupsCategory = "GroupsInfoChannelMessageLastReplyAfter"
	GroupsInfoChannelMessageLastReplyBefore groupsCategory = "GroupsInfoChannelMessageLastReplyBefore"
)
View Source
const (
	OneDriveCategoryUnknown oneDriveCategory = ""

	// types of data in OneDrive
	OneDriveUser   oneDriveCategory = "OneDriveUser"
	OneDriveItem   oneDriveCategory = "OneDriveItem"
	OneDriveFolder oneDriveCategory = "OneDriveFolder"

	// details.ItemInfo comparables
	FileInfoCreatedAfter   oneDriveCategory = "FileInfoCreatedAfter"
	FileInfoCreatedBefore  oneDriveCategory = "FileInfoCreatedBefore"
	FileInfoModifiedAfter  oneDriveCategory = "FileInfoModifiedAfter"
	FileInfoModifiedBefore oneDriveCategory = "FileInfoModifiedBefore"
)
View Source
const (
	ServiceUnknown    service = 0 // Unknown Service
	ServiceExchange   service = 1 // Exchange
	ServiceOneDrive   service = 2 // OneDrive
	ServiceSharePoint service = 3 // SharePoint
	ServiceGroups     service = 4 // Groups
	ServiceTeamsChats service = 5 // TeamsChats
)
View Source
const (
	// AnyTgt is the target value used to select "any data of <type>"
	// Ex: {user: u1, events: AnyTgt) => all events for user u1.
	// In the event that "*" conflicts with a user value, such as a
	// folder named "*", calls to corso should escape the value with "\*"
	AnyTgt = "*"
	// NoneTgt is the target value used to select "no data of <type>"
	// This is primarily a fallback for empty values.  Adding NoneTgt or
	// None() to any selector will force all matches() checks on that
	// selector to fail.
	// Ex: {user: u1, events: NoneTgt} => matches nothing.
	NoneTgt = ""
)

The granularity exprerssed by the scope. Groups imply non-item granularity, such as a directory. Items are individual files or objects.

View Source
const (
	SharePointCategoryUnknown sharePointCategory = ""

	// types of data in SharePoint
	SharePointWebURL        sharePointCategory = "SharePointWebURL"
	SharePointSite          sharePointCategory = "SharePointSite"
	SharePointList          sharePointCategory = "SharePointList"
	SharePointListItem      sharePointCategory = "SharePointListItem"
	SharePointLibraryFolder sharePointCategory = "SharePointLibraryFolder"
	SharePointLibraryItem   sharePointCategory = "SharePointLibraryItem"
	SharePointPageFolder    sharePointCategory = "SharePointPageFolder"
	SharePointPage          sharePointCategory = "SharePointPage"

	// details.itemInfo comparables
	SharePointInfoCreatedAfter   sharePointCategory = "SharePointInfoCreatedAfter"
	SharePointInfoCreatedBefore  sharePointCategory = "SharePointInfoCreatedBefore"
	SharePointInfoModifiedAfter  sharePointCategory = "SharePointInfoModifiedAfter"
	SharePointInfoModifiedBefore sharePointCategory = "SharePointInfoModifiedBefore"

	SharePointListInfoModifiedAfter  sharePointCategory = "SharePointListInfoModifiedAfter"
	SharePointListInfoModifiedBefore sharePointCategory = "SharePointListInfoModifiedBefore"
	SharePointListInfoCreatedAfter   sharePointCategory = "SharePointListInfoCreatedAfter"
	SharePointListInfoCreatedBefore  sharePointCategory = "SharePointListInfoCreatedBefore"

	// library drive selection
	SharePointInfoLibraryDrive sharePointCategory = "SharePointInfoLibraryDrive"
)
View Source
const (
	TeamsChatsCategoryUnknown teamsChatsCategory = ""

	// types of data identified by teamsChats
	TeamsChatsUser teamsChatsCategory = "TeamsChatsUser"
	TeamsChatsChat teamsChatsCategory = "TeamsChatsChat"

	// data contained within details.ItemInfo
	TeamsChatsInfoChatMember teamsChatsCategory = "TeamsChatsInfoChatMember"
	TeamsChatsInfoChatName   teamsChatsCategory = "TeamsChatsInfoChatName"
)
View Source
const All = "All"

All is the resource name that gets output when the resource is AnyTgt. It is not used aside from printing resources.

Variables

View Source
var (
	ErrorBadSelectorCast     = clues.New("wrong selector service type")
	ErrorNoMatchingItems     = clues.New("no items match the provided selectors")
	ErrorUnrecognizedService = clues.New("unrecognized service")
)

Functions

func Any

func Any() []string

Any returns the set matching any value.

func ExactMatch

func ExactMatch() option

ExactMatch ensures the selector uses an Equals comparator, instead of contains. Will not override a default Any() or None() comparator.

func IsAnyTarget

func IsAnyTarget[T scopeT, C categoryT](s T, cat C) bool

returns true if the category is included in the scope's category type, and the value is set to Any().

func None

func None() []string

None returns the set matching None of the values. This is primarily a fallback for empty values. Adding None() to any selector will force all matches() checks on that selector to fail.

func PrefixMatch

func PrefixMatch() option

PrefixMatch ensures the selector uses a Prefix comparator, instead of contains or equals. Will not override a default Any() or None() comparator.

func StrictEqualMatch

func StrictEqualMatch() option

StrictEqualsMatch ensures the selector uses a StrictEquals comparator, instead of contains. Will not override a default Any() or None() comparator.

func SuffixMatch

func SuffixMatch() option

SuffixMatch ensures the selector uses a Suffix comparator, instead of contains or equals. Will not override a default Any() or None() comparator.

Types

type Config

type Config struct {
	// OnlyMatchItemNames tells the reducer to ignore matching on itemRef values
	// and other item IDs in favor of matching the item name.  Normal behavior only
	// matches on itemRefs.
	OnlyMatchItemNames bool
}

Config defines broad-scale selector behavior.

type ExchangeBackup

type ExchangeBackup struct {
	// contains filtered or unexported fields
}

ExchangeBackup provides an api for selecting data scopes applicable to the Exchange service, plus backup-specific methods.

func NewExchangeBackup

func NewExchangeBackup(users []string) *ExchangeBackup

NewExchange produces a new Selector with the service set to ServiceExchange.

func (*ExchangeBackup) AllData

func (s *ExchangeBackup) AllData() []ExchangeScope

Retrieves all exchange data. Each user id generates three scopes, one for each data type: contact, event, and mail. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeBackup) ContactFolders

func (s *ExchangeBackup) ContactFolders(folders []string, opts ...option) []ExchangeScope

Contactfolders produces one or more exchange contact folder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeBackup) Contacts

func (s *ExchangeBackup) Contacts(folders, contacts []string, opts ...option) []ExchangeScope

Contacts produces one or more exchange contact scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeBackup) EventCalendars

func (s *ExchangeBackup) EventCalendars(events []string, opts ...option) []ExchangeScope

EventCalendars produces one or more exchange event calendar scopes. Calendars act as folders to contain Events If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeBackup) Events

func (s *ExchangeBackup) Events(calendars, events []string, opts ...option) []ExchangeScope

Events produces one or more exchange event scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeBackup) Exclude

func (s *ExchangeBackup) Exclude(scopes ...[]ExchangeScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: Mail(u1, f1, m1) => only excludes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only excludes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all mail, events, and contacts, therefore it is the same as selecting all of the following: Mail(u1, Any(), Any()), Event(u1, Any()), Contacts(u1, Any(), Any())

func (*ExchangeBackup) Filter

func (s *ExchangeBackup) Filter(scopes ...[]ExchangeScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters (of the same data category).

All parts of the scope must match for data to pass the filter. Ex: Mail(u1, f1, m1) => only passes mail that is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only passes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all mail, events, and contacts, therefore it is the same as selecting all of the following: Mail(u1, Any(), Any()), Event(u1, Any()), Contacts(u1, Any(), Any())

func (*ExchangeBackup) Include

func (s *ExchangeBackup) Include(scopes ...[]ExchangeScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be included. Ex: Mail(u1, f1, m1) => only includes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only includes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all mail, events, and contacts, therefore it is the same as selecting all of the following: Mail(u1, Any(), Any()), Event(u1, Any()), Contacts(u1, Any(), Any())

func (*ExchangeBackup) MailFolders

func (s *ExchangeBackup) MailFolders(folders []string, opts ...option) []ExchangeScope

Produces one or more exchange mail folder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeBackup) Mails

func (s *ExchangeBackup) Mails(folders, mails []string, opts ...option) []ExchangeScope

Produces one or more mail scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (ExchangeBackup) PathCategories

func (s ExchangeBackup) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (ExchangeBackup) Reasons

func (s ExchangeBackup) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (ExchangeBackup) Reduce

func (s ExchangeBackup) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*ExchangeBackup) Scopes

func (s *ExchangeBackup) Scopes() []ExchangeScope

Scopes retrieves the list of exchangeScopes in the selector.

func (ExchangeBackup) SplitByResourceOwner

func (s ExchangeBackup) SplitByResourceOwner(users []string) []ExchangeBackup

type ExchangeItemScopeConstructor

type ExchangeItemScopeConstructor func([]string, []string, ...option) []ExchangeScope

type ExchangeRestore

type ExchangeRestore struct {
	// contains filtered or unexported fields
}

ExchangeRestore provides an api for selecting data scopes applicable to the Exchange service, plus restore-specific methods.

func NewExchangeRestore

func NewExchangeRestore(users []string) *ExchangeRestore

NewExchangeRestore produces a new Selector with the service set to ServiceExchange.

func (*ExchangeRestore) AllData

func (s *ExchangeRestore) AllData() []ExchangeScope

Retrieves all exchange data. Each user id generates three scopes, one for each data type: contact, event, and mail. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) ContactFolders

func (s *ExchangeRestore) ContactFolders(folders []string, opts ...option) []ExchangeScope

Contactfolders produces one or more exchange contact folder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeRestore) ContactName

func (sr *ExchangeRestore) ContactName(senderID string) []ExchangeScope

ContactName produces one or more exchange contact name info scopes. Matches any contact whose name contains the provided string. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) Contacts

func (s *ExchangeRestore) Contacts(folders, contacts []string, opts ...option) []ExchangeScope

Contacts produces one or more exchange contact scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeRestore) EventCalendars

func (s *ExchangeRestore) EventCalendars(events []string, opts ...option) []ExchangeScope

EventCalendars produces one or more exchange event calendar scopes. Calendars act as folders to contain Events If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeRestore) EventOrganizer

func (sr *ExchangeRestore) EventOrganizer(organizer string) []ExchangeScope

EventOrganizer produces one or more exchange event subject info scopes. Matches any event where the event subject contains one of the provided strings. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) EventRecurs

func (sr *ExchangeRestore) EventRecurs(recurs string) []ExchangeScope

EventRecurs produces one or more exchange event recurrence info scopes. Matches any event if the comparator flag matches the event recurrence flag. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) EventStartsAfter

func (sr *ExchangeRestore) EventStartsAfter(timeStrings string) []ExchangeScope

EventStartsAfter produces an exchange event starts-after info scope. Matches any event where the start time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*ExchangeRestore) EventStartsBefore

func (sr *ExchangeRestore) EventStartsBefore(timeStrings string) []ExchangeScope

EventStartsBefore produces an exchange event starts-before info scope. Matches any event where the start time is before the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*ExchangeRestore) EventSubject

func (sr *ExchangeRestore) EventSubject(subject string) []ExchangeScope

EventSubject produces one or more exchange event subject info scopes. Matches any event where the event subject contains one of the provided strings. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) Events

func (s *ExchangeRestore) Events(calendars, events []string, opts ...option) []ExchangeScope

Events produces one or more exchange event scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeRestore) Exclude

func (s *ExchangeRestore) Exclude(scopes ...[]ExchangeScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: Mail(u1, f1, m1) => only excludes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only excludes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all mail, events, and contacts, therefore it is the same as selecting all of the following: Mail(u1, Any(), Any()), Event(u1, Any()), Contacts(u1, Any(), Any())

func (*ExchangeRestore) Filter

func (s *ExchangeRestore) Filter(scopes ...[]ExchangeScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters (of the same data category).

All parts of the scope must match for data to pass the filter. Ex: Mail(u1, f1, m1) => only passes mail that is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only passes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all mail, events, and contacts, therefore it is the same as selecting all of the following: Mail(u1, Any(), Any()), Event(u1, Any()), Contacts(u1, Any(), Any())

func (*ExchangeRestore) Include

func (s *ExchangeRestore) Include(scopes ...[]ExchangeScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be included. Ex: Mail(u1, f1, m1) => only includes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only includes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all mail, events, and contacts, therefore it is the same as selecting all of the following: Mail(u1, Any(), Any()), Event(u1, Any()), Contacts(u1, Any(), Any())

func (*ExchangeRestore) MailFolders

func (s *ExchangeRestore) MailFolders(folders []string, opts ...option) []ExchangeScope

Produces one or more exchange mail folder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*ExchangeRestore) MailReceivedAfter

func (sr *ExchangeRestore) MailReceivedAfter(timeStrings string) []ExchangeScope

MailReceivedAfter produces an exchange mail received-after info scope. Matches any mail which was received after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*ExchangeRestore) MailReceivedBefore

func (sr *ExchangeRestore) MailReceivedBefore(timeStrings string) []ExchangeScope

MailReceivedBefore produces an exchange mail received-before info scope. Matches any mail which was received before the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*ExchangeRestore) MailSender

func (sr *ExchangeRestore) MailSender(sender string) []ExchangeScope

MailSender produces one or more exchange mail sender info scopes. Matches any mail whose sender contains one of the provided strings. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) MailSubject

func (sr *ExchangeRestore) MailSubject(subject string) []ExchangeScope

MailSubject produces one or more exchange mail subject line info scopes. Matches any mail whose subject contains one of the provided strings. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*ExchangeRestore) Mails

func (s *ExchangeRestore) Mails(folders, mails []string, opts ...option) []ExchangeScope

Produces one or more mail scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (ExchangeRestore) PathCategories

func (s ExchangeRestore) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (ExchangeRestore) Reasons

func (s ExchangeRestore) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (ExchangeRestore) Reduce

func (s ExchangeRestore) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*ExchangeRestore) Scopes

func (s *ExchangeRestore) Scopes() []ExchangeScope

Scopes retrieves the list of exchangeScopes in the selector.

func (ExchangeRestore) SplitByResourceOwner

func (sr ExchangeRestore) SplitByResourceOwner(users []string) []ExchangeRestore

type ExchangeScope

type ExchangeScope scope

ExchangeScope specifies the data available when interfacing with the Exchange service.

func (ExchangeScope) Category

func (s ExchangeScope) Category() exchangeCategory

Category describes the type of the data in scope.

func (ExchangeScope) Conceal

func (s ExchangeScope) Conceal() string

func (ExchangeScope) Format

func (s ExchangeScope) Format(fs fmt.State, r rune)

func (ExchangeScope) Get

func (s ExchangeScope) Get(cat exchangeCategory) []string

Get returns the data category in the scope. If the scope contains all data types for a user, it'll return the ExchangeUser category.

func (ExchangeScope) IncludesCategory

func (s ExchangeScope) IncludesCategory(cat exchangeCategory) bool

IncludeCategory checks whether the scope includes a certain category of data. Ex: to check if the scope includes mail data: s.IncludesCategory(selector.ExchangeMail)

func (ExchangeScope) InfoCategory

func (s ExchangeScope) InfoCategory() exchangeCategory

InfoCategory returns the category enum of the scope info. If the scope is not an info type, returns ExchangeUnknownCategory.

func (ExchangeScope) IsAny

func (s ExchangeScope) IsAny(cat exchangeCategory) bool

returns true if the category is included in the scope's data type, and the value is set to Any().

func (ExchangeScope) Matches

func (s ExchangeScope) Matches(cat exchangeCategory, target string) bool

Matches returns true if the category is included in the scope's data type, and the target string matches that category's comparator.

func (ExchangeScope) PlainString

func (s ExchangeScope) PlainString() string

func (ExchangeScope) String

func (s ExchangeScope) String() string

type GroupsBackup

type GroupsBackup struct {
	// contains filtered or unexported fields
}

groups provides an api for selecting data scopes applicable to the groups service, plus backup-specific methods.

func NewGroupsBackup

func NewGroupsBackup(resources []string) *GroupsBackup

NewGroupsBackup produces a new Selector with the service set to ServiceGroups.

func (*GroupsBackup) AllData

func (s *GroupsBackup) AllData() []GroupsScope

Produces one or more Groups scopes. One scope is created per group entry. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) ChannelMessages

func (s *GroupsBackup) ChannelMessages(channels, messages []string, opts ...option) []GroupsScope

ChannelMessages produces one or more Groups channel message scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) Channels

func (s *GroupsBackup) Channels(channels []string, opts ...option) []GroupsScope

Channels produces one or more SharePoint channel scopes, where the channel matches upon a given channel by ID or Name. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) Conversation

func (s *GroupsBackup) Conversation(conversations []string, opts ...option) []GroupsScope

Conversations produces one or more SharePoint conversation scopes, where the conversation matches with a given conversation by ID or Topic. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) ConversationPosts

func (s *GroupsBackup) ConversationPosts(conversations, posts []string, opts ...option) []GroupsScope

ConversationPosts produces one or more Groups conversation post scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) CreatedAfter

func (s *GroupsBackup) CreatedAfter(timeStrings string) []GroupsScope

func (*GroupsBackup) CreatedBefore

func (s *GroupsBackup) CreatedBefore(timeStrings string) []GroupsScope

func (*GroupsBackup) Exclude

func (s *GroupsBackup) Exclude(scopes ...[]GroupsScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*GroupsBackup) Filter

func (s *GroupsBackup) Filter(scopes ...[]GroupsScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*GroupsBackup) Include

func (s *GroupsBackup) Include(scopes ...[]GroupsScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*GroupsBackup) Library

func (s *GroupsBackup) Library(library string) []GroupsScope

Library produces one or more Group library scopes, where the library matches upon a given drive by ID or Name. In order to ensure library selection this should always be embedded within the Filter() set; include(Library()) will select all items in the library without further filtering. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) LibraryFolders

func (s *GroupsBackup) LibraryFolders(libraryFolders []string, opts ...option) []GroupsScope

LibraryFolders produces one or more SharePoint libraryFolder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsBackup) LibraryItems

func (s *GroupsBackup) LibraryItems(libraries, items []string, opts ...option) []GroupsScope

LibraryItems produces one or more Groups library item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the library scopes.

func (*GroupsBackup) ListItems

func (s *GroupsBackup) ListItems(lists, items []string, opts ...option) []GroupsScope

ListItems produces one or more Groups list item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the list scopes.

func (*GroupsBackup) Lists

func (s *GroupsBackup) Lists(lists []string, opts ...option) []GroupsScope

Lists produces one or more Groups list scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None Any empty slice defaults to selectors.None

func (*GroupsBackup) ModifiedAfter

func (s *GroupsBackup) ModifiedAfter(timeStrings string) []GroupsScope

func (*GroupsBackup) ModifiedBefore

func (s *GroupsBackup) ModifiedBefore(timeStrings string) []GroupsScope

func (*GroupsBackup) PageItems

func (s *GroupsBackup) PageItems(pages, items []string, opts ...option) []GroupsScope

PageItems produces one or more Groups page item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the page scopes.

func (*GroupsBackup) Pages

func (s *GroupsBackup) Pages(pages []string, opts ...option) []GroupsScope

Pages produces one or more Groups page scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (GroupsBackup) PathCategories

func (s GroupsBackup) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete resources described by each type of scope.

func (GroupsBackup) Reasons

func (s GroupsBackup) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (GroupsBackup) Reduce

func (s GroupsBackup) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*GroupsBackup) Scopes

func (s *GroupsBackup) Scopes() []GroupsScope

Scopes retrieves the list of groupsScopes in the selector.

func (*GroupsBackup) Site

func (s *GroupsBackup) Site(site string) []GroupsScope

Sites produces one or more Groups site scopes, where the site matches upon a given site by ID or URL. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (GroupsBackup) SplitByResourceOwner

func (s GroupsBackup) SplitByResourceOwner(resources []string) []GroupsBackup

type GroupsRestore

type GroupsRestore struct {
	// contains filtered or unexported fields
}

GroupsRestorep provides an api for selecting data scopes applicable to the Groups service, plus restore-specific methods.

func NewGroupsRestore

func NewGroupsRestore(resources []string) *GroupsRestore

NewGroupsRestore produces a new Selector with the service set to ServiceGroups.

func (*GroupsRestore) AllData

func (s *GroupsRestore) AllData() []GroupsScope

Produces one or more Groups scopes. One scope is created per group entry. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) ChannelMessages

func (s *GroupsRestore) ChannelMessages(channels, messages []string, opts ...option) []GroupsScope

ChannelMessages produces one or more Groups channel message scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) Channels

func (s *GroupsRestore) Channels(channels []string, opts ...option) []GroupsScope

Channels produces one or more SharePoint channel scopes, where the channel matches upon a given channel by ID or Name. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) Conversation

func (s *GroupsRestore) Conversation(conversations []string, opts ...option) []GroupsScope

Conversations produces one or more SharePoint conversation scopes, where the conversation matches with a given conversation by ID or Topic. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) ConversationPosts

func (s *GroupsRestore) ConversationPosts(conversations, posts []string, opts ...option) []GroupsScope

ConversationPosts produces one or more Groups conversation post scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) CreatedAfter

func (s *GroupsRestore) CreatedAfter(timeStrings string) []GroupsScope

func (*GroupsRestore) CreatedBefore

func (s *GroupsRestore) CreatedBefore(timeStrings string) []GroupsScope

func (*GroupsRestore) Exclude

func (s *GroupsRestore) Exclude(scopes ...[]GroupsScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*GroupsRestore) Filter

func (s *GroupsRestore) Filter(scopes ...[]GroupsScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*GroupsRestore) Include

func (s *GroupsRestore) Include(scopes ...[]GroupsScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*GroupsRestore) Library

func (s *GroupsRestore) Library(library string) []GroupsScope

Library produces one or more Group library scopes, where the library matches upon a given drive by ID or Name. In order to ensure library selection this should always be embedded within the Filter() set; include(Library()) will select all items in the library without further filtering. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) LibraryFolders

func (s *GroupsRestore) LibraryFolders(libraryFolders []string, opts ...option) []GroupsScope

LibraryFolders produces one or more SharePoint libraryFolder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) LibraryItems

func (s *GroupsRestore) LibraryItems(libraries, items []string, opts ...option) []GroupsScope

LibraryItems produces one or more Groups library item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the library scopes.

func (*GroupsRestore) ListItems

func (s *GroupsRestore) ListItems(lists, items []string, opts ...option) []GroupsScope

ListItems produces one or more Groups list item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the list scopes.

func (*GroupsRestore) Lists

func (s *GroupsRestore) Lists(lists []string, opts ...option) []GroupsScope

Lists produces one or more Groups list scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None Any empty slice defaults to selectors.None

func (*GroupsRestore) MessageCreatedAfter

func (s *GroupsRestore) MessageCreatedAfter(timeStrings string) []GroupsScope

MessageCreatedAfter produces a channel message created-after info scope. Matches any message where the creation time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*GroupsRestore) MessageCreatedBefore

func (s *GroupsRestore) MessageCreatedBefore(timeStrings string) []GroupsScope

MessageCreatedBefore produces a channel message created-before info scope. Matches any message where the creation time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*GroupsRestore) MessageCreator

func (s *GroupsRestore) MessageCreator(creator string) []GroupsScope

MessageCreator produces one or more groups channelMessage info scopes. Matches any channel message created by the specified user. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*GroupsRestore) MessageLastReplyAfter

func (s *GroupsRestore) MessageLastReplyAfter(timeStrings string) []GroupsScope

MessageLastReplyAfter produces a channel message last-response-after info scope. Matches any message where last response time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*GroupsRestore) MessageLastReplyBefore

func (s *GroupsRestore) MessageLastReplyBefore(timeStrings string) []GroupsScope

MessageLastReplyBefore produces a channel message last-response-before info scope. Matches any message where last response time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*GroupsRestore) ModifiedAfter

func (s *GroupsRestore) ModifiedAfter(timeStrings string) []GroupsScope

func (*GroupsRestore) ModifiedBefore

func (s *GroupsRestore) ModifiedBefore(timeStrings string) []GroupsScope

func (*GroupsRestore) PageItems

func (s *GroupsRestore) PageItems(pages, items []string, opts ...option) []GroupsScope

PageItems produces one or more Groups page item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the page scopes.

func (*GroupsRestore) Pages

func (s *GroupsRestore) Pages(pages []string, opts ...option) []GroupsScope

Pages produces one or more Groups page scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (GroupsRestore) PathCategories

func (s GroupsRestore) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete resources described by each type of scope.

func (GroupsRestore) Reasons

func (s GroupsRestore) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (GroupsRestore) Reduce

func (s GroupsRestore) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*GroupsRestore) Scopes

func (s *GroupsRestore) Scopes() []GroupsScope

Scopes retrieves the list of groupsScopes in the selector.

func (*GroupsRestore) Site

func (s *GroupsRestore) Site(site string) []GroupsScope

Sites produces one or more Groups site scopes, where the site matches upon a given site by ID or URL. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (GroupsRestore) SplitByResourceOwner

func (s GroupsRestore) SplitByResourceOwner(resources []string) []GroupsRestore

type GroupsScope

type GroupsScope scope

GroupsScope specifies the data available when interfacing with the Groups service.

func (GroupsScope) Category

func (s GroupsScope) Category() groupsCategory

Category describes the type of the data in scope.

func (GroupsScope) Conceal

func (s GroupsScope) Conceal() string

func (GroupsScope) Format

func (s GroupsScope) Format(fs fmt.State, r rune)

func (GroupsScope) Get

func (s GroupsScope) Get(cat groupsCategory) []string

Get returns the data category in the scope. If the scope contains all data types for a user, it'll return the GroupsUser category.

func (GroupsScope) IncludesCategory

func (s GroupsScope) IncludesCategory(cat groupsCategory) bool

IncludeCategory checks whether the scope includes a certain category of data. Ex: to check if the scope includes file data: s.IncludesCategory(selector.GroupsFile)

func (GroupsScope) InfoCategory

func (s GroupsScope) InfoCategory() groupsCategory

InfoCategory returns the category enum of the scope info. If the scope is not an info type, returns GroupsUnknownCategory.

func (GroupsScope) IsAny

func (s GroupsScope) IsAny(cat groupsCategory) bool

returns true if the category is included in the scope's data type, and the value is set to Any().

func (GroupsScope) Matches

func (s GroupsScope) Matches(cat groupsCategory, target string) bool

Matches returns true if the category is included in the scope's data type, and the target string matches that category's comparator.

func (GroupsScope) PlainString

func (s GroupsScope) PlainString() string

func (GroupsScope) String

func (s GroupsScope) String() string

type OneDriveBackup

type OneDriveBackup struct {
	// contains filtered or unexported fields
}

OneDriveBackup provides an api for selecting data scopes applicable to the OneDrive service, plus backup-specific methods.

func NewOneDriveBackup

func NewOneDriveBackup(users []string) *OneDriveBackup

NewOneDriveBackup produces a new Selector with the service set to ServiceOneDrive.

func (*OneDriveBackup) AllData

func (s *OneDriveBackup) AllData() []OneDriveScope

Retrieves all OneDrive data. One scope is created per user entry. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*OneDriveBackup) CreatedAfter

func (s *OneDriveBackup) CreatedAfter(timeStrings string) []OneDriveScope

CreatedAfter produces a OneDrive item created-after info scope. Matches any item where the created time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*OneDriveBackup) CreatedBefore

func (s *OneDriveBackup) CreatedBefore(timeStrings string) []OneDriveScope

CreatedBefore produces a OneDrive item created-before info scope. Matches any item where the created time is before the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*OneDriveBackup) Exclude

func (s *OneDriveBackup) Exclude(scopes ...[]OneDriveScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion.

All parts of the scope must match for data to be exclucded. Ex: File(u1, f1, m1) => only excludes a file if it is owned by user u1, located in folder f1, and ID'd as m1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all folders and files owned by u1.

func (*OneDriveBackup) Filter

func (s *OneDriveBackup) Filter(scopes ...[]OneDriveScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters.

All parts of the scope must match for data to be exclucded. Ex: File(u1, f1, m1) => only excludes a file if it is owned by user u1, located in folder f1, and ID'd as m1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all folders and files owned by u1.

func (*OneDriveBackup) Folders

func (s *OneDriveBackup) Folders(folders []string, opts ...option) []OneDriveScope

Folders produces one or more OneDrive folder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*OneDriveBackup) Include

func (s *OneDriveBackup) Include(scopes ...[]OneDriveScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: File(u1, f1, m1) => only excludes a file if it is owned by user u1, located in folder f1, and ID'd as m1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all folders and files owned by u1.

func (*OneDriveBackup) Items

func (s *OneDriveBackup) Items(folders, items []string, opts ...option) []OneDriveScope

Items produces one or more OneDrive item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*OneDriveBackup) ModifiedAfter

func (s *OneDriveBackup) ModifiedAfter(timeStrings string) []OneDriveScope

ModifiedAfter produces a OneDrive item modified-after info scope. Matches any item where the modified time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*OneDriveBackup) ModifiedBefore

func (s *OneDriveBackup) ModifiedBefore(timeStrings string) []OneDriveScope

ModifiedBefore produces a OneDrive item modified-before info scope. Matches any item where the modified time is before the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (OneDriveBackup) PathCategories

func (s OneDriveBackup) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (OneDriveBackup) Reasons

func (s OneDriveBackup) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (OneDriveBackup) Reduce

func (s OneDriveBackup) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*OneDriveBackup) Scopes

func (s *OneDriveBackup) Scopes() []OneDriveScope

Scopes retrieves the list of oneDriveScopes in the selector.

func (OneDriveBackup) SplitByResourceOwner

func (s OneDriveBackup) SplitByResourceOwner(users []string) []OneDriveBackup

type OneDriveRestore

type OneDriveRestore struct {
	// contains filtered or unexported fields
}

OneDriveRestorep provides an api for selecting data scopes applicable to the OneDrive service, plus restore-specific methods.

func NewOneDriveRestore

func NewOneDriveRestore(users []string) *OneDriveRestore

NewOneDriveRestore produces a new Selector with the service set to ServiceOneDrive.

func (*OneDriveRestore) AllData

func (s *OneDriveRestore) AllData() []OneDriveScope

Retrieves all OneDrive data. One scope is created per user entry. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*OneDriveRestore) CreatedAfter

func (s *OneDriveRestore) CreatedAfter(timeStrings string) []OneDriveScope

CreatedAfter produces a OneDrive item created-after info scope. Matches any item where the created time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*OneDriveRestore) CreatedBefore

func (s *OneDriveRestore) CreatedBefore(timeStrings string) []OneDriveScope

CreatedBefore produces a OneDrive item created-before info scope. Matches any item where the created time is before the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*OneDriveRestore) Exclude

func (s *OneDriveRestore) Exclude(scopes ...[]OneDriveScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion.

All parts of the scope must match for data to be exclucded. Ex: File(u1, f1, m1) => only excludes a file if it is owned by user u1, located in folder f1, and ID'd as m1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all folders and files owned by u1.

func (*OneDriveRestore) Filter

func (s *OneDriveRestore) Filter(scopes ...[]OneDriveScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters.

All parts of the scope must match for data to be exclucded. Ex: File(u1, f1, m1) => only excludes a file if it is owned by user u1, located in folder f1, and ID'd as m1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all folders and files owned by u1.

func (*OneDriveRestore) Folders

func (s *OneDriveRestore) Folders(folders []string, opts ...option) []OneDriveScope

Folders produces one or more OneDrive folder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*OneDriveRestore) Include

func (s *OneDriveRestore) Include(scopes ...[]OneDriveScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: File(u1, f1, m1) => only excludes a file if it is owned by user u1, located in folder f1, and ID'd as m1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all folders and files owned by u1.

func (*OneDriveRestore) Items

func (s *OneDriveRestore) Items(folders, items []string, opts ...option) []OneDriveScope

Items produces one or more OneDrive item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*OneDriveRestore) ModifiedAfter

func (s *OneDriveRestore) ModifiedAfter(timeStrings string) []OneDriveScope

ModifiedAfter produces a OneDrive item modified-after info scope. Matches any item where the modified time is after the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (*OneDriveRestore) ModifiedBefore

func (s *OneDriveRestore) ModifiedBefore(timeStrings string) []OneDriveScope

ModifiedBefore produces a OneDrive item modified-before info scope. Matches any item where the modified time is before the timestring. If the input equals selectors.Any, the scope will match all times. If the input is empty or selectors.None, the scope will always fail comparisons.

func (OneDriveRestore) PathCategories

func (s OneDriveRestore) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (OneDriveRestore) Reasons

func (s OneDriveRestore) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (OneDriveRestore) Reduce

func (s OneDriveRestore) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*OneDriveRestore) Scopes

func (s *OneDriveRestore) Scopes() []OneDriveScope

Scopes retrieves the list of oneDriveScopes in the selector.

func (OneDriveRestore) SplitByResourceOwner

func (s OneDriveRestore) SplitByResourceOwner(users []string) []OneDriveRestore

type OneDriveScope

type OneDriveScope scope

OneDriveScope specifies the data available when interfacing with the OneDrive service.

func (OneDriveScope) Category

func (s OneDriveScope) Category() oneDriveCategory

Category describes the type of the data in scope.

func (OneDriveScope) Conceal

func (s OneDriveScope) Conceal() string

func (OneDriveScope) Format

func (s OneDriveScope) Format(fs fmt.State, r rune)

func (OneDriveScope) Get

func (s OneDriveScope) Get(cat oneDriveCategory) []string

Get returns the data category in the scope. If the scope contains all data types for a user, it'll return the OneDriveUser category.

func (OneDriveScope) IncludesCategory

func (s OneDriveScope) IncludesCategory(cat oneDriveCategory) bool

IncludeCategory checks whether the scope includes a certain category of data. Ex: to check if the scope includes file data: s.IncludesCategory(selector.OneDriveFile)

func (OneDriveScope) InfoCategory

func (s OneDriveScope) InfoCategory() oneDriveCategory

InfoCategory returns the category enum of the scope info. If the scope is not an info type, returns OneDriveUnknownCategory.

func (OneDriveScope) IsAny

func (s OneDriveScope) IsAny(cat oneDriveCategory) bool

returns true if the category is included in the scope's data type, and the value is set to Any().

func (OneDriveScope) Matches

func (s OneDriveScope) Matches(cat oneDriveCategory, target string) bool

Matches returns true if the category is included in the scope's data type, and the target string matches that category's comparator.

func (OneDriveScope) PlainString

func (s OneDriveScope) PlainString() string

func (OneDriveScope) String

func (s OneDriveScope) String() string

type Reducer

type Reducer interface {
	Reduce(context.Context, *details.Details, *fault.Bus) *details.Details
}

type Selector

type Selector struct {
	// The service scope of the data.  Exchange, Teams, SharePoint, etc.
	Service service `json:"service,omitempty"`

	// A record of the resource owners matched by this selector.
	ResourceOwners filters.Filter `json:"resourceOwners,omitempty"`

	// The single resource owner being observed by the selector.
	// Selectors are constructed by passing in a list of ResourceOwners,
	// and those owners represent the "total" data that should be operated
	// across all corso operations.  But any single operation (backup,restore,
	// etc) will only observe a single user at a time, and that user is
	// represented by this value.
	//
	// If the constructor is passed a len=1 list of owners, this value is
	// automatically matched to that entry.  For lists with more than one
	// owner, the user is expected to call SplitByResourceOwner(), and
	// iterate over the results, where each one will populate this field
	// with a different owner.
	DiscreteOwner string `json:"discreteOwner,omitempty"`
	// display name for the DiscreteOwner.
	DiscreteOwnerName string `json:"discreteOwnerName,omitempty"`

	// A slice of exclusion scopes.  Exclusions apply globally to all
	// inclusions/filters, with any-match behavior.
	Excludes []scope `json:"exclusions,omitempty"`
	// A slice of info scopes.  All inclusions must also match ALL filters.
	Filters []scope `json:"filters,omitempty"`
	// A slice of inclusion scopes.  Comparators must match either one of these,
	// or all filters, to be included.
	Includes []scope `json:"includes,omitempty"`

	Cfg Config `json:"cfg,omitempty"`
}

The core selector. Has no api for setting or retrieving data. Is only used to pass along more specific selector instances.

func (Selector) AllHumanPathCategories

func (s Selector) AllHumanPathCategories() ([]string, error)

AllHumanPathCategories returns the sets of include and filter path categories across all scope sets. This is good for logging because it returns the string version of the categories and sorts the slice so the category set is easier to search for or bin across multiple logs.

func (Selector) Conceal

func (s Selector) Conceal() string

func (*Selector) Configure

func (s *Selector) Configure(cfg Config)

Configure sets the selector configuration.

func (Selector) Format

func (s Selector) Format(fs fmt.State, _ rune)

func (Selector) ID

func (s Selector) ID() string

ID returns s.discreteOwner, which is assumed to be a stable ID.

func (Selector) Name

func (s Selector) Name() string

Name returns s.discreteOwnerName. If that value is empty, it returns s.DiscreteOwner instead.

func (Selector) PathCategories

func (s Selector) PathCategories() (selectorPathCategories, error)

PathCategories returns the sets of path categories identified in each scope set.

func (Selector) PathService

func (s Selector) PathService() path.ServiceType

Returns the path.ServiceType matching the selector service.

func (Selector) PlainString

func (s Selector) PlainString() string

func (Selector) Reasons

func (s Selector) Reasons(tenantID string, useOwnerNameForID bool) ([]identity.Reasoner, error)

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (Selector) Reduce

func (s Selector) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) (*details.Details, error)

Reduce is a quality-of-life interpreter that allows Reduce to be called from the generic selector by interpreting the selector service type rather than have the caller make that interpretation. Returns an error if the service is unsupported.

func (Selector) SetDiscreteOwnerIDName

func (s Selector) SetDiscreteOwnerIDName(id, name string) Selector

SetDiscreteOwnerIDName ensures the selector has the correct discrete owner id and name. Assumes that these values are sourced using the current s.DiscreteOwner as input. The reason for taking in both the id and name, and not just the name, is so that constructors can input owner aliases in place of ids, with the expectation that the two will get sorted and re-written later on with this setter.

If the id is empty, the original DiscreteOwner value is retained. If the name is empty, the id is duplicated as the name.

func (Selector) String

func (s Selector) String() string

func (Selector) ToExchangeBackup

func (s Selector) ToExchangeBackup() (*ExchangeBackup, error)

ToExchangeBackup transforms the generic selector into an ExchangeBackup. Errors if the service defined by the selector is not ServiceExchange.

func (Selector) ToExchangeRestore

func (s Selector) ToExchangeRestore() (*ExchangeRestore, error)

ToExchangeRestore transforms the generic selector into an ExchangeRestore. Errors if the service defined by the selector is not ServiceExchange.

func (Selector) ToGroupsBackup

func (s Selector) ToGroupsBackup() (*GroupsBackup, error)

ToGroupsBackup transforms the generic selector into an GroupsBackup. Errors if the service defined by the selector is not ServiceGroups.

func (Selector) ToGroupsRestore

func (s Selector) ToGroupsRestore() (*GroupsRestore, error)

ToGroupsRestore transforms the generic selector into an GroupsRestore. Errors if the service defined by the selector is not ServiceGroups.

func (Selector) ToOneDriveBackup

func (s Selector) ToOneDriveBackup() (*OneDriveBackup, error)

ToOneDriveBackup transforms the generic selector into an OneDriveBackup. Errors if the service defined by the selector is not ServiceOneDrive.

func (Selector) ToOneDriveRestore

func (s Selector) ToOneDriveRestore() (*OneDriveRestore, error)

ToOneDriveRestore transforms the generic selector into an OneDriveRestore. Errors if the service defined by the selector is not ServiceOneDrive.

func (Selector) ToSharePointBackup

func (s Selector) ToSharePointBackup() (*SharePointBackup, error)

ToSharePointBackup transforms the generic selector into an SharePointBackup. Errors if the service defined by the selector is not ServiceSharePoint.

func (Selector) ToSharePointRestore

func (s Selector) ToSharePointRestore() (*SharePointRestore, error)

ToSharePointRestore transforms the generic selector into an SharePointRestore. Errors if the service defined by the selector is not ServiceSharePoint.

func (Selector) ToTeamsChatsBackup

func (s Selector) ToTeamsChatsBackup() (*TeamsChatsBackup, error)

ToTeamsChatsBackup transforms the generic selector into an TeamsChatsBackup. Errors if the service defined by the selector is not ServiceTeamsChats.

func (Selector) ToTeamsChatsRestore

func (s Selector) ToTeamsChatsRestore() (*TeamsChatsRestore, error)

ToTeamsChatsRestore transforms the generic selector into an TeamsChatsRestore. Errors if the service defined by the selector is not ServiceTeamsChats.

type SharePointBackup

type SharePointBackup struct {
	// contains filtered or unexported fields
}

SharePointBackup provides an api for selecting data scopes applicable to the SharePoint service, plus backup-specific methods.

func NewSharePointBackup

func NewSharePointBackup(sites []string) *SharePointBackup

NewSharePointBackup produces a new Selector with the service set to ServiceSharePoint.

func (*SharePointBackup) AllData

func (s *SharePointBackup) AllData() []SharePointScope

Produces one or more SharePoint site scopes. One scope is created per site entry. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*SharePointBackup) CreatedAfter

func (s *SharePointBackup) CreatedAfter(timeStrings string) []SharePointScope

func (*SharePointBackup) CreatedBefore

func (s *SharePointBackup) CreatedBefore(timeStrings string) []SharePointScope

func (*SharePointBackup) Exclude

func (s *SharePointBackup) Exclude(scopes ...[]SharePointScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*SharePointBackup) Filter

func (s *SharePointBackup) Filter(scopes ...[]SharePointScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*SharePointBackup) Include

func (s *SharePointBackup) Include(scopes ...[]SharePointScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*SharePointBackup) Library

func (s *SharePointBackup) Library(library string) []SharePointScope

Library produces one or more SharePoint library scopes, where the library matches upon a given drive by ID or Name. In order to ensure library selection this should always be embedded within the Filter() set; include(Library()) will select all items in the library without further filtering. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*SharePointBackup) LibraryFolders

func (s *SharePointBackup) LibraryFolders(libraryFolders []string, opts ...option) []SharePointScope

LibraryFolders produces one or more SharePoint libraryFolder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*SharePointBackup) LibraryItems

func (s *SharePointBackup) LibraryItems(libraries, items []string, opts ...option) []SharePointScope

LibraryItems produces one or more SharePoint library item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the library scopes.

func (*SharePointBackup) ListCreatedAfter

func (s *SharePointBackup) ListCreatedAfter(timeStrings string) []SharePointScope

func (*SharePointBackup) ListCreatedBefore

func (s *SharePointBackup) ListCreatedBefore(timeStrings string) []SharePointScope

func (*SharePointBackup) ListItems

func (s *SharePointBackup) ListItems(lists, items []string, opts ...option) []SharePointScope

ListItems produces one or more SharePoint list item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the list scopes.

func (*SharePointBackup) ListModifiedAfter

func (s *SharePointBackup) ListModifiedAfter(timeStrings string) []SharePointScope

func (*SharePointBackup) ListModifiedBefore

func (s *SharePointBackup) ListModifiedBefore(timeStrings string) []SharePointScope

func (*SharePointBackup) Lists

func (s *SharePointBackup) Lists(lists []string, opts ...option) []SharePointScope

Lists produces one or more SharePoint list scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None Any empty slice defaults to selectors.None

func (*SharePointBackup) ModifiedAfter

func (s *SharePointBackup) ModifiedAfter(timeStrings string) []SharePointScope

func (*SharePointBackup) ModifiedBefore

func (s *SharePointBackup) ModifiedBefore(timeStrings string) []SharePointScope

func (*SharePointBackup) PageItems

func (s *SharePointBackup) PageItems(pages, items []string, opts ...option) []SharePointScope

PageItems produces one or more SharePoint page item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the page scopes.

func (*SharePointBackup) Pages

func (s *SharePointBackup) Pages(pages []string, opts ...option) []SharePointScope

Pages produces one or more SharePoint page scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (SharePointBackup) PathCategories

func (s SharePointBackup) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (SharePointBackup) Reasons

func (s SharePointBackup) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (SharePointBackup) Reduce

func (s SharePointBackup) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*SharePointBackup) Scopes

func (s *SharePointBackup) Scopes() []SharePointScope

Scopes retrieves the list of sharePointScopes in the selector.

func (SharePointBackup) SplitByResourceOwner

func (s SharePointBackup) SplitByResourceOwner(sites []string) []SharePointBackup

type SharePointRestore

type SharePointRestore struct {
	// contains filtered or unexported fields
}

SharePointRestorep provides an api for selecting data scopes applicable to the SharePoint service, plus restore-specific methods.

func NewSharePointRestore

func NewSharePointRestore(sites []string) *SharePointRestore

NewSharePointRestore produces a new Selector with the service set to ServiceSharePoint.

func (*SharePointRestore) AllData

func (s *SharePointRestore) AllData() []SharePointScope

Produces one or more SharePoint site scopes. One scope is created per site entry. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*SharePointRestore) CreatedAfter

func (s *SharePointRestore) CreatedAfter(timeStrings string) []SharePointScope

func (*SharePointRestore) CreatedBefore

func (s *SharePointRestore) CreatedBefore(timeStrings string) []SharePointScope

func (*SharePointRestore) Exclude

func (s *SharePointRestore) Exclude(scopes ...[]SharePointScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*SharePointRestore) Filter

func (s *SharePointRestore) Filter(scopes ...[]SharePointScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters.

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*SharePointRestore) Include

func (s *SharePointRestore) Include(scopes ...[]SharePointScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: File(s1, f1, i1) => only excludes an item if it is owned by site s1, located in folder f1, and ID'd as i1. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: Site(u1) automatically cascades to all folders and files owned by s1.

func (*SharePointRestore) Library

func (s *SharePointRestore) Library(library string) []SharePointScope

Library produces one or more SharePoint library scopes, where the library matches upon a given drive by ID or Name. In order to ensure library selection this should always be embedded within the Filter() set; include(Library()) will select all items in the library without further filtering. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*SharePointRestore) LibraryFolders

func (s *SharePointRestore) LibraryFolders(libraryFolders []string, opts ...option) []SharePointScope

LibraryFolders produces one or more SharePoint libraryFolder scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*SharePointRestore) LibraryItems

func (s *SharePointRestore) LibraryItems(libraries, items []string, opts ...option) []SharePointScope

LibraryItems produces one or more SharePoint library item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the library scopes.

func (*SharePointRestore) ListCreatedAfter

func (s *SharePointRestore) ListCreatedAfter(timeStrings string) []SharePointScope

func (*SharePointRestore) ListCreatedBefore

func (s *SharePointRestore) ListCreatedBefore(timeStrings string) []SharePointScope

func (*SharePointRestore) ListItems

func (s *SharePointRestore) ListItems(lists, items []string, opts ...option) []SharePointScope

ListItems produces one or more SharePoint list item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the list scopes.

func (*SharePointRestore) ListModifiedAfter

func (s *SharePointRestore) ListModifiedAfter(timeStrings string) []SharePointScope

func (*SharePointRestore) ListModifiedBefore

func (s *SharePointRestore) ListModifiedBefore(timeStrings string) []SharePointScope

func (*SharePointRestore) Lists

func (s *SharePointRestore) Lists(lists []string, opts ...option) []SharePointScope

Lists produces one or more SharePoint list scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None Any empty slice defaults to selectors.None

func (*SharePointRestore) ModifiedAfter

func (s *SharePointRestore) ModifiedAfter(timeStrings string) []SharePointScope

func (*SharePointRestore) ModifiedBefore

func (s *SharePointRestore) ModifiedBefore(timeStrings string) []SharePointScope

func (*SharePointRestore) PageItems

func (s *SharePointRestore) PageItems(pages, items []string, opts ...option) []SharePointScope

PageItems produces one or more SharePoint page item scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the page scopes.

func (*SharePointRestore) Pages

func (s *SharePointRestore) Pages(pages []string, opts ...option) []SharePointScope

Pages produces one or more SharePoint page scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (SharePointRestore) PathCategories

func (s SharePointRestore) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (SharePointRestore) Reasons

func (s SharePointRestore) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (SharePointRestore) Reduce

func (s SharePointRestore) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*SharePointRestore) Scopes

func (s *SharePointRestore) Scopes() []SharePointScope

Scopes retrieves the list of sharePointScopes in the selector.

func (SharePointRestore) SplitByResourceOwner

func (s SharePointRestore) SplitByResourceOwner(sites []string) []SharePointRestore

func (*SharePointRestore) WebURL

func (s *SharePointRestore) WebURL(urls []string, opts ...option) []SharePointScope

Produces one or more SharePoint webURL scopes. One scope is created per webURL entry. Defaults to equals check, on the assumption we identify fully qualified urls, and do not want to default to contains. ie: https://host/sites/foo should not match https://host/sites/foo/bar. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

type SharePointScope

type SharePointScope scope

SharePointScope specifies the data available when interfacing with the SharePoint service.

func (SharePointScope) Category

func (s SharePointScope) Category() sharePointCategory

Category describes the type of the data in scope.

func (SharePointScope) Conceal

func (s SharePointScope) Conceal() string

func (SharePointScope) Format

func (s SharePointScope) Format(fs fmt.State, r rune)

func (SharePointScope) Get

func (s SharePointScope) Get(cat sharePointCategory) []string

Get returns the data category in the scope. If the scope contains all data types for a user, it'll return the SharePointUser category.

func (SharePointScope) IncludesCategory

func (s SharePointScope) IncludesCategory(cat sharePointCategory) bool

IncludeCategory checks whether the scope includes a certain category of data. Ex: to check if the scope includes file data: s.IncludesCategory(selector.SharePointFile)

func (SharePointScope) InfoCategory

func (s SharePointScope) InfoCategory() sharePointCategory

InfoCategory returns the category enum of the scope info. If the scope is not an info type, returns SharePointUnknownCategory.

func (SharePointScope) IsAny

func (s SharePointScope) IsAny(cat sharePointCategory) bool

returns true if the category is included in the scope's data type, and the value is set to Any().

func (SharePointScope) Matches

func (s SharePointScope) Matches(cat sharePointCategory, target string) bool

Matches returns true if the category is included in the scope's data type, and the target string matches that category's comparator.

func (SharePointScope) PlainString

func (s SharePointScope) PlainString() string

func (SharePointScope) String

func (s SharePointScope) String() string

type TeamsChatsBackup

type TeamsChatsBackup struct {
	// contains filtered or unexported fields
}

TeamsChatsBackup provides an api for selecting data scopes applicable to the TeamsChats service, plus backup-specific methods.

func NewTeamsChatsBackup

func NewTeamsChatsBackup(users []string) *TeamsChatsBackup

NewTeamsChats produces a new Selector with the service set to ServiceTeamsChats.

func (*TeamsChatsBackup) AllData

func (s *TeamsChatsBackup) AllData() []TeamsChatsScope

Retrieves all teamsChats data. Each user id generates a scope for each data type: chats (only one data type at this time). If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*TeamsChatsBackup) Chats

func (s *TeamsChatsBackup) Chats(chats []string, opts ...option) []TeamsChatsScope

Chats produces one or more teamsChats scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*TeamsChatsBackup) Exclude

func (s *TeamsChatsBackup) Exclude(scopes ...[]TeamsChatsScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: Mail(u1, f1, m1) => only excludes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only excludes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all chats,

func (*TeamsChatsBackup) Filter

func (s *TeamsChatsBackup) Filter(scopes ...[]TeamsChatsScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters (of the same data category).

All parts of the scope must match for data to pass the filter. Ex: Mail(u1, f1, m1) => only passes mail that is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only passes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all chats,

func (*TeamsChatsBackup) Include

func (s *TeamsChatsBackup) Include(scopes ...[]TeamsChatsScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be included. Ex: Mail(u1, f1, m1) => only includes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only includes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all chats,

func (TeamsChatsBackup) PathCategories

func (s TeamsChatsBackup) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (TeamsChatsBackup) Reasons

func (s TeamsChatsBackup) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (TeamsChatsBackup) Reduce

func (s TeamsChatsBackup) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*TeamsChatsBackup) Scopes

func (s *TeamsChatsBackup) Scopes() []TeamsChatsScope

Scopes retrieves the list of teamsChatsScopes in the selector.

func (TeamsChatsBackup) SplitByResourceOwner

func (s TeamsChatsBackup) SplitByResourceOwner(users []string) []TeamsChatsBackup

type TeamsChatsItemScopeConstructor

type TeamsChatsItemScopeConstructor func([]string, []string, ...option) []TeamsChatsScope

type TeamsChatsRestore

type TeamsChatsRestore struct {
	// contains filtered or unexported fields
}

TeamsChatsRestore provides an api for selecting data scopes applicable to the TeamsChats service, plus restore-specific methods.

func NewTeamsChatsRestore

func NewTeamsChatsRestore(users []string) *TeamsChatsRestore

NewTeamsChatsRestore produces a new Selector with the service set to ServiceTeamsChats.

func (*TeamsChatsRestore) AllData

func (s *TeamsChatsRestore) AllData() []TeamsChatsScope

Retrieves all teamsChats data. Each user id generates a scope for each data type: chats (only one data type at this time). If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*TeamsChatsRestore) ChatMember

func (sr *TeamsChatsRestore) ChatMember(memberID string) []TeamsChatsScope

ChatMember produces one or more teamsChats chat member info scopes. Matches any chat member whose email contains the provided string. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*TeamsChatsRestore) ChatName

func (sr *TeamsChatsRestore) ChatName(memberID string) []TeamsChatsScope

ChatName produces one or more teamsChats chat name info scopes. Matches any chat whose name contains the provided string. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None

func (*TeamsChatsRestore) Chats

func (s *TeamsChatsRestore) Chats(chats []string, opts ...option) []TeamsChatsScope

Chats produces one or more teamsChats scopes. If any slice contains selectors.Any, that slice is reduced to selectors.Any If any slice contains selectors.None, that slice is reduced to selectors.None If any slice is empty, it defaults to selectors.None options are only applied to the folder scopes.

func (*TeamsChatsRestore) Exclude

func (s *TeamsChatsRestore) Exclude(scopes ...[]TeamsChatsScope)

Exclude appends the provided scopes to the selector's exclusion set. Every Exclusion scope applies globally, affecting all inclusion scopes. Data is excluded if it matches ANY exclusion (of the same data category).

All parts of the scope must match for data to be exclucded. Ex: Mail(u1, f1, m1) => only excludes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only excludes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all chats,

func (*TeamsChatsRestore) Filter

func (s *TeamsChatsRestore) Filter(scopes ...[]TeamsChatsScope)

Filter appends the provided scopes to the selector's filters set. A selector with >0 filters and 0 inclusions will include any data that passes all filters. A selector with >0 filters and >0 inclusions will reduce the inclusion set to only the data that passes all filters. Data is retained if it passes ALL filters (of the same data category).

All parts of the scope must match for data to pass the filter. Ex: Mail(u1, f1, m1) => only passes mail that is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only passes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all chats,

func (*TeamsChatsRestore) Include

func (s *TeamsChatsRestore) Include(scopes ...[]TeamsChatsScope)

Include appends the provided scopes to the selector's inclusion set. Data is included if it matches ANY inclusion. The inclusion set is later filtered (all included data must pass ALL filters) and excluded (all included data must not match ANY exclusion). Data is included if it matches ANY inclusion (of the same data category).

All parts of the scope must match for data to be included. Ex: Mail(u1, f1, m1) => only includes mail if it is owned by user u1, located in folder f1, and ID'd as m1. MailSender(foo) => only includes mail whose sender is foo. Use selectors.Any() to wildcard a scope value. No value will match if selectors.None() is provided.

Group-level scopes will automatically apply the Any() wildcard to child properties. ex: User(u1) automatically cascades to all chats,

func (TeamsChatsRestore) PathCategories

func (s TeamsChatsRestore) PathCategories() selectorPathCategories

PathCategories produces the aggregation of discrete users described by each type of scope.

func (TeamsChatsRestore) Reasons

func (s TeamsChatsRestore) Reasons(tenantID string, useOwnerNameForID bool) []identity.Reasoner

Reasons returns a deduplicated set of the backup reasons produced using the selector's discrete owner and each scopes' service and category types.

func (TeamsChatsRestore) Reduce

func (s TeamsChatsRestore) Reduce(
	ctx context.Context,
	deets *details.Details,
	errs *fault.Bus,
) *details.Details

Reduce filters the entries in a details struct to only those that match the inclusions, filters, and exclusions in the selector.

func (*TeamsChatsRestore) Scopes

func (s *TeamsChatsRestore) Scopes() []TeamsChatsScope

Scopes retrieves the list of teamsChatsScopes in the selector.

func (TeamsChatsRestore) SplitByResourceOwner

func (sr TeamsChatsRestore) SplitByResourceOwner(users []string) []TeamsChatsRestore

type TeamsChatsScope

type TeamsChatsScope scope

TeamsChatsScope specifies the data available when interfacing with the TeamsChats service.

func (TeamsChatsScope) Category

func (s TeamsChatsScope) Category() teamsChatsCategory

Category describes the type of the data in scope.

func (TeamsChatsScope) Conceal

func (s TeamsChatsScope) Conceal() string

func (TeamsChatsScope) Format

func (s TeamsChatsScope) Format(fs fmt.State, r rune)

func (TeamsChatsScope) Get

func (s TeamsChatsScope) Get(cat teamsChatsCategory) []string

Get returns the data category in the scope. If the scope contains all data types for a user, it'll return the TeamsChatsUser category.

func (TeamsChatsScope) IncludesCategory

func (s TeamsChatsScope) IncludesCategory(cat teamsChatsCategory) bool

IncludeCategory checks whether the scope includes a certain category of data. Ex: to check if the scope includes mail data: s.IncludesCategory(selector.TeamsChatsMail)

func (TeamsChatsScope) InfoCategory

func (s TeamsChatsScope) InfoCategory() teamsChatsCategory

InfoCategory returns the category enum of the scope info. If the scope is not an info type, returns TeamsChatsUnknownCategory.

func (TeamsChatsScope) IsAny

func (s TeamsChatsScope) IsAny(cat teamsChatsCategory) bool

returns true if the category is included in the scope's data type, and the value is set to Any().

func (TeamsChatsScope) Matches

func (s TeamsChatsScope) Matches(cat teamsChatsCategory, target string) bool

Matches returns true if the category is included in the scope's data type, and the target string matches that category's comparator.

func (TeamsChatsScope) PlainString

func (s TeamsChatsScope) PlainString() string

func (TeamsChatsScope) String

func (s TeamsChatsScope) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL