Skip to content

Commit e252568

Browse files
committed
Add site controller/models
1 parent b412b39 commit e252568

File tree

3 files changed

+55
-1
lines changed

3 files changed

+55
-1
lines changed

src/controllers/site.tsp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import "@typespec/http";
2+
import "@typespec/rest";
3+
import "@typespec/openapi3";
4+
5+
import "../models/site.tsp";
6+
7+
using TypeSpec.Http;
8+
9+
namespace Graph.Community;
10+
11+
@tag("Site")
12+
@route("/{serverRelativeSiteUrl}/_api/site")
13+
op GetSite(
14+
...CommonParameters,
15+
...ODataSelectParameter,
16+
...ODataExpandParameter,
17+
): Site;

src/main.tsp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ import "./controllers/hubSites.tsp";
88
import "./controllers/lists.tsp";
99
import "./controllers/sitePages.tsp";
1010
import "./controllers/web.tsp";
11+
import "./controllers/site.tsp";
1112

1213
using TypeSpec.Http;
1314
using TypeSpec.OpenAPI;
1415

1516
@service({
1617
title: "Graph.Community SDK for Microsoft SharePoint REST API",
17-
version: "5.3.0",
18+
version: "5.5.0",
1819
})
1920
@tagMetadata(
2021
"Lists",
@@ -52,4 +53,13 @@ using TypeSpec.OpenAPI;
5253
},
5354
}
5455
)
56+
@tagMetadata(
57+
"Site",
58+
#{
59+
description: "Methods for working with the Site resource.",
60+
externalDocs: #{
61+
url: "https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/determine-sharepoint-rest-service-endpoint-uris?tabs=http",
62+
},
63+
}
64+
)
5565
namespace Graph.Community {}

src/models/site.tsp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import "@typespec/http";
2+
import "../models/web.tsp";
3+
4+
using TypeSpec.Http;
5+
6+
namespace Graph.Community;
7+
8+
model Site {
9+
Id: string;
10+
HubSiteId: string;
11+
IsHubSite: boolean;
12+
GroupId: string;
13+
ServerRelativeUrl: string;
14+
15+
/**
16+
* Represents the unique sequential location of a change within the change log.
17+
*/
18+
CurrentChangeToken?: ChangeToken;
19+
20+
GeoLocation?: string;
21+
PrimaryUri: url;
22+
}
23+
24+
model SPSiteResponse {
25+
...OkResponse;
26+
...Body<Site>;
27+
}

0 commit comments

Comments
 (0)