Updates and corrects input aliasing according to the following rules (in priority order): 1. if the library name is usable, use it 2. if not, alias to the package name 3. if the package name is weird, alias sensibly 4. in case of collision, alias more distant imports 5. aliases should be consistent throughout --- #### Does this PR need a docs update or release note? - [x] ⛔ No #### Type of change - [x] 🧹 Tech Debt/Cleanup #### Issue(s) * #1970 #### Test Plan - [x] ⚡ Unit test
29 lines
870 B
Go
29 lines
870 B
Go
package sharepoint
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/microsoft/kiota-abstractions-go/serialization"
|
|
"github.com/microsoftgraph/msgraph-sdk-go/sites"
|
|
|
|
"github.com/alcionai/corso/src/internal/connector/graph"
|
|
)
|
|
|
|
// GetAllSitesForTenant makes a GraphQuery request retrieving all sites in the tenant.
|
|
// Due to restrictions in filter capabilities for site queries, the returned iterable
|
|
// will contain all personal sites for all users in the org.
|
|
func GetAllSitesForTenant(ctx context.Context, gs graph.Servicer) (serialization.Parsable, error) {
|
|
options := &sites.SitesRequestBuilderGetRequestConfiguration{
|
|
QueryParameters: &sites.SitesRequestBuilderGetQueryParameters{
|
|
Select: []string{"id", "name", "weburl"},
|
|
},
|
|
}
|
|
|
|
ss, err := gs.Client().Sites().Get(ctx, options)
|
|
if err != nil {
|
|
return nil, graph.Wrap(ctx, err, "getting sites")
|
|
}
|
|
|
|
return ss, nil
|
|
}
|