Skip to content

Commit 2b25198

Browse files
authored
Merge pull request #81 from microsoftgraph/task/client-factory-design
Task/client factory design
2 parents 0a6615d + 3638fc7 commit 2b25198

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/design/client_factory.puml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@startuml ClientFactory
2+
enum NationalClouds {
3+
+GERMANY
4+
+PUBLIC
5+
+US_GOV
6+
+CHINA
7+
}
8+
9+
class HttpClientFactory {
10+
-TIMEOUT: string
11+
-SDK_VERSION: string
12+
-BASE_URL: string
13+
-pipeline: MiddlewarePipeline
14+
15+
+__init__(session: Session, cloud: NationalClouds)
16+
+with_default_middleware(auth_provider: TokenCredential): Session
17+
+with_user_middleware(middleware: [Middleware]): Session
18+
}
19+
20+
21+
class Session {}
22+
23+
class GraphClient {
24+
-session: Session
25+
26+
+__init__(session: Session, credential: TokenCredential,
27+
version: ApiVersion, cloud: NationalClouds)
28+
+get()
29+
+post()
30+
+put()
31+
+patch()
32+
+delete()
33+
}
34+
35+
package "middleware" {
36+
class MiddlewarePipeline {}
37+
}
38+
39+
HttpClientFactory --> NationalClouds
40+
HttpClientFactory -right-> middleware
41+
HttpClientFactory --> Session
42+
43+
GraphClient -right-> HttpClientFactory
44+
45+
note right of Session: HTTPClient imported from requests
46+
@enduml

0 commit comments

Comments
 (0)