Skip to content

Commit 88a787b

Browse files
committed
Updated SDK and dependencies
Made syntax changes as required
1 parent b01cf53 commit 88a787b

File tree

5 files changed

+54
-41
lines changed

5 files changed

+54
-41
lines changed

app-auth/graphapponlytutorial/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async def get_users(self):
4949
query_parameters=query_params
5050
)
5151

52-
users = await self.app_client.users().get(request_configuration=request_config)
52+
users = await self.app_client.users.get(request_configuration=request_config)
5353
return users
5454
# </GetUsersSnippet>
5555

app-auth/graphapponlytutorial/requirements.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ anyio==3.6.2
1212
# via httpcore
1313
async-timeout==4.0.2
1414
# via aiohttp
15-
attrs==22.1.0
15+
attrs==22.2.0
1616
# via aiohttp
17-
azure-core==1.26.1
17+
azure-core==1.26.2
1818
# via
1919
# azure-identity
2020
# microsoft-kiota-authentication-azure
2121
azure-identity==1.12.0
2222
# via
2323
# -r requirements.in
2424
# msgraph-sdk
25-
certifi==2022.9.24
25+
certifi==2022.12.7
2626
# via
2727
# httpcore
2828
# httpx
@@ -33,7 +33,7 @@ charset-normalizer==2.1.1
3333
# via
3434
# aiohttp
3535
# requests
36-
cryptography==38.0.4
36+
cryptography==39.0.0
3737
# via
3838
# azure-identity
3939
# msal
@@ -48,9 +48,9 @@ h2==4.1.0
4848
# via httpx
4949
hpack==4.0.0
5050
# via h2
51-
httpcore==0.16.2
51+
httpcore==0.16.3
5252
# via httpx
53-
httpx[http2]==0.23.1
53+
httpx[http2]==0.23.3
5454
# via
5555
# microsoft-kiota-http
5656
# msgraph-core
@@ -62,19 +62,19 @@ idna==3.4
6262
# requests
6363
# rfc3986
6464
# yarl
65-
microsoft-kiota-abstractions==0.2.0
65+
microsoft-kiota-abstractions==0.3.0
6666
# via
6767
# microsoft-kiota-authentication-azure
6868
# microsoft-kiota-http
6969
# microsoft-kiota-serialization-json
7070
# microsoft-kiota-serialization-text
7171
# msgraph-core
7272
# msgraph-sdk
73-
microsoft-kiota-authentication-azure==0.1.1
73+
microsoft-kiota-authentication-azure==0.2.0
7474
# via msgraph-sdk
75-
microsoft-kiota-http==0.2.3
75+
microsoft-kiota-http==0.3.1
7676
# via msgraph-core
77-
microsoft-kiota-serialization-json==0.2.0
77+
microsoft-kiota-serialization-json==0.2.1
7878
# via msgraph-sdk
7979
microsoft-kiota-serialization-text==0.2.0
8080
# via msgraph-sdk
@@ -84,15 +84,15 @@ msal==1.20.0
8484
# msal-extensions
8585
msal-extensions==1.0.0
8686
# via azure-identity
87-
msgraph-core==1.0.0a0
87+
msgraph-core==1.0.0a2
8888
# via msgraph-sdk
89-
msgraph-sdk==1.0.0a2
89+
msgraph-sdk==1.0.0a9
9090
# via -r requirements.in
91-
multidict==6.0.2
91+
multidict==6.0.4
9292
# via
9393
# aiohttp
9494
# yarl
95-
portalocker==2.6.0
95+
portalocker==2.7.0
9696
# via msal-extensions
9797
pycparser==2.21
9898
# via cffi
@@ -102,7 +102,7 @@ python-dateutil==2.8.2
102102
# via
103103
# microsoft-kiota-serialization-json
104104
# microsoft-kiota-serialization-text
105-
requests==2.28.1
105+
requests==2.28.2
106106
# via
107107
# azure-core
108108
# msal
@@ -122,7 +122,7 @@ typing-extensions==4.4.0
122122
# via azure-core
123123
uritemplate==4.1.1
124124
# via microsoft-kiota-abstractions
125-
urllib3==1.26.13
125+
urllib3==1.26.14
126126
# via requests
127-
yarl==1.8.1
127+
yarl==1.8.2
128128
# via aiohttp

user-auth/graphtutorial/graph.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def get_user(self):
5454
query_parameters=query_params
5555
)
5656

57-
user = await self.user_client.me().get(request_configuration=request_config)
57+
user = await self.user_client.me.get(request_configuration=request_config)
5858
return user
5959
# </GetUserSnippet>
6060

@@ -72,7 +72,7 @@ async def get_inbox(self):
7272
query_parameters= query_params
7373
)
7474

75-
messages = await self.user_client.me().mail_folders_by_id('inbox').messages().get(
75+
messages = await self.user_client.me.mail_folders_by_id('inbox').messages.get(
7676
request_configuration=request_config)
7777
return messages
7878
# </GetInboxSnippet>
@@ -95,11 +95,24 @@ async def send_mail(self, subject: str, body: str, recipient: str):
9595
request_body = SendMailPostRequestBody()
9696
request_body.message = message
9797

98-
await self.user_client.me().send_mail().post(body=request_body)
98+
await self.user_client.me.send_mail.post(body=request_body)
9999
# </SendMailSnippet>
100100

101101
# <MakeGraphCallSnippet>
102102
async def make_graph_call(self):
103103
# INSERT YOUR CODE HERE
104+
# Auth provider
105+
#auth_provider = AzureIdentityAuthenticationProvider(...)
106+
107+
# Get default middleware
108+
#middleware = GraphClientFactory.get_default_middleware()
109+
110+
# Add custom middleware
111+
# Implement a custom middleware by extending the BaseMiddleware class
112+
# https://github.com/microsoft/kiota-http-go/blob/main/kiota_http/middleware/middleware.py
113+
#middleware.append(MyCustomMiddleware())
114+
115+
# Create an HTTP client with the middleware
116+
#client = GraphClientFactory().create_with_custom_middleware(middleware)
104117
return
105118
# </MakeGraphCallSnippet>

user-auth/graphtutorial/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ async def list_inbox(graph: Graph):
7171
for message in message_page.value:
7272
print('Message:', message.subject)
7373
if (
74-
message.from_escaped is not None and
75-
message.from_escaped.email_address is not None
74+
message.from_ is not None and
75+
message.from_.email_address is not None
7676
):
77-
print(' From:', message.from_escaped.email_address.name or 'NONE')
77+
print(' From:', message.from_.email_address.name or 'NONE')
7878
else:
7979
print(' From: NONE')
8080
print(' Status:', 'Read' if message.is_read else 'Unread')

user-auth/graphtutorial/requirements.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ anyio==3.6.2
1212
# via httpcore
1313
async-timeout==4.0.2
1414
# via aiohttp
15-
attrs==22.1.0
15+
attrs==22.2.0
1616
# via aiohttp
17-
azure-core==1.26.1
17+
azure-core==1.26.2
1818
# via
1919
# azure-identity
2020
# microsoft-kiota-authentication-azure
2121
azure-identity==1.12.0
2222
# via
2323
# -r requirements.in
2424
# msgraph-sdk
25-
certifi==2022.9.24
25+
certifi==2022.12.7
2626
# via
2727
# httpcore
2828
# httpx
@@ -33,7 +33,7 @@ charset-normalizer==2.1.1
3333
# via
3434
# aiohttp
3535
# requests
36-
cryptography==38.0.4
36+
cryptography==39.0.0
3737
# via
3838
# azure-identity
3939
# msal
@@ -48,9 +48,9 @@ h2==4.1.0
4848
# via httpx
4949
hpack==4.0.0
5050
# via h2
51-
httpcore==0.16.2
51+
httpcore==0.16.3
5252
# via httpx
53-
httpx[http2]==0.23.1
53+
httpx[http2]==0.23.3
5454
# via
5555
# microsoft-kiota-http
5656
# msgraph-core
@@ -62,19 +62,19 @@ idna==3.4
6262
# requests
6363
# rfc3986
6464
# yarl
65-
microsoft-kiota-abstractions==0.2.0
65+
microsoft-kiota-abstractions==0.3.0
6666
# via
6767
# microsoft-kiota-authentication-azure
6868
# microsoft-kiota-http
6969
# microsoft-kiota-serialization-json
7070
# microsoft-kiota-serialization-text
7171
# msgraph-core
7272
# msgraph-sdk
73-
microsoft-kiota-authentication-azure==0.1.1
73+
microsoft-kiota-authentication-azure==0.2.0
7474
# via msgraph-sdk
75-
microsoft-kiota-http==0.2.3
75+
microsoft-kiota-http==0.3.1
7676
# via msgraph-core
77-
microsoft-kiota-serialization-json==0.2.0
77+
microsoft-kiota-serialization-json==0.2.1
7878
# via msgraph-sdk
7979
microsoft-kiota-serialization-text==0.2.0
8080
# via msgraph-sdk
@@ -84,15 +84,15 @@ msal==1.20.0
8484
# msal-extensions
8585
msal-extensions==1.0.0
8686
# via azure-identity
87-
msgraph-core==1.0.0a0
87+
msgraph-core==1.0.0a2
8888
# via msgraph-sdk
89-
msgraph-sdk==1.0.0a2
89+
msgraph-sdk==1.0.0a9
9090
# via -r requirements.in
91-
multidict==6.0.2
91+
multidict==6.0.4
9292
# via
9393
# aiohttp
9494
# yarl
95-
portalocker==2.6.0
95+
portalocker==2.7.0
9696
# via msal-extensions
9797
pycparser==2.21
9898
# via cffi
@@ -102,7 +102,7 @@ python-dateutil==2.8.2
102102
# via
103103
# microsoft-kiota-serialization-json
104104
# microsoft-kiota-serialization-text
105-
requests==2.28.1
105+
requests==2.28.2
106106
# via
107107
# azure-core
108108
# msal
@@ -122,7 +122,7 @@ typing-extensions==4.4.0
122122
# via azure-core
123123
uritemplate==4.1.1
124124
# via microsoft-kiota-abstractions
125-
urllib3==1.26.13
125+
urllib3==1.26.14
126126
# via requests
127-
yarl==1.8.1
127+
yarl==1.8.2
128128
# via aiohttp

0 commit comments

Comments
 (0)