@@ -24,7 +24,7 @@ def __init__(self, *, environment: RavenApiEnvironment, auth_key: str):
24
24
def add (self , app_id : AppId , user_id : UserId , * , request : Device ) -> Device :
25
25
_response = httpx .request (
26
26
"POST" ,
27
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices" ),
27
+ urllib .parse .urljoin (f"{ self ._environment . value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices" ),
28
28
json = jsonable_encoder (request ),
29
29
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
30
30
)
@@ -39,7 +39,9 @@ def add(self, app_id: AppId, user_id: UserId, *, request: Device) -> Device:
39
39
def update (self , app_id : AppId , user_id : UserId , device_id : DeviceId , * , request : Device ) -> Device :
40
40
_response = httpx .request (
41
41
"PUT" ,
42
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } " ),
42
+ urllib .parse .urljoin (
43
+ f"{ self ._environment .value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } "
44
+ ),
43
45
json = jsonable_encoder (request ),
44
46
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
45
47
)
@@ -54,7 +56,9 @@ def update(self, app_id: AppId, user_id: UserId, device_id: DeviceId, *, request
54
56
def delete (self , app_id : AppId , user_id : UserId , device_id : DeviceId ) -> None :
55
57
_response = httpx .request (
56
58
"DELETE" ,
57
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } " ),
59
+ urllib .parse .urljoin (
60
+ f"{ self ._environment .value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } "
61
+ ),
58
62
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
59
63
)
60
64
if 200 <= _response .status_code < 300 :
@@ -68,7 +72,9 @@ def delete(self, app_id: AppId, user_id: UserId, device_id: DeviceId) -> None:
68
72
def get_device (self , app_id : AppId , user_id : UserId , device_id : DeviceId ) -> Device :
69
73
_response = httpx .request (
70
74
"GET" ,
71
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } " ),
75
+ urllib .parse .urljoin (
76
+ f"{ self ._environment .value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } "
77
+ ),
72
78
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
73
79
)
74
80
if 200 <= _response .status_code < 300 :
@@ -89,7 +95,7 @@ async def add(self, app_id: AppId, user_id: UserId, *, request: Device) -> Devic
89
95
async with httpx .AsyncClient () as _client :
90
96
_response = await _client .request (
91
97
"POST" ,
92
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices" ),
98
+ urllib .parse .urljoin (f"{ self ._environment . value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices" ),
93
99
json = jsonable_encoder (request ),
94
100
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
95
101
)
@@ -105,7 +111,9 @@ async def update(self, app_id: AppId, user_id: UserId, device_id: DeviceId, *, r
105
111
async with httpx .AsyncClient () as _client :
106
112
_response = await _client .request (
107
113
"PUT" ,
108
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } " ),
114
+ urllib .parse .urljoin (
115
+ f"{ self ._environment .value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } "
116
+ ),
109
117
json = jsonable_encoder (request ),
110
118
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
111
119
)
@@ -121,7 +129,9 @@ async def delete(self, app_id: AppId, user_id: UserId, device_id: DeviceId) -> N
121
129
async with httpx .AsyncClient () as _client :
122
130
_response = await _client .request (
123
131
"DELETE" ,
124
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } " ),
132
+ urllib .parse .urljoin (
133
+ f"{ self ._environment .value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } "
134
+ ),
125
135
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
126
136
)
127
137
if 200 <= _response .status_code < 300 :
@@ -136,7 +146,9 @@ async def get_device(self, app_id: AppId, user_id: UserId, device_id: DeviceId)
136
146
async with httpx .AsyncClient () as _client :
137
147
_response = await _client .request (
138
148
"GET" ,
139
- urllib .parse .urljoin (f"{ self ._environment } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } " ),
149
+ urllib .parse .urljoin (
150
+ f"{ self ._environment .value } /" , f"v1/apps/{ app_id } /users/{ user_id } /devices/{ device_id } "
151
+ ),
140
152
headers = remove_none_from_headers ({"Authorization" : self .auth_key }),
141
153
)
142
154
if 200 <= _response .status_code < 300 :
0 commit comments