@@ -935,18 +935,56 @@ async def complete_authorization_flow(
935
935
936
936
return deserialized # type: ignore
937
937
938
+ @overload
939
+ async def pilot_login (
940
+ self ,
941
+ body : _models .BodyAuthPilotLogin ,
942
+ * ,
943
+ content_type : str = "application/json" ,
944
+ ** kwargs : Any ,
945
+ ) -> _models .TokenResponse :
946
+ """Pilot Login.
947
+
948
+ Endpoint without policy, the pilot uses only its secret.
949
+
950
+ :param body: Required.
951
+ :type body: ~_generated.models.BodyAuthPilotLogin
952
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
953
+ Default value is "application/json".
954
+ :paramtype content_type: str
955
+ :return: TokenResponse
956
+ :rtype: ~_generated.models.TokenResponse
957
+ :raises ~azure.core.exceptions.HttpResponseError:
958
+ """
959
+
960
+ @overload
961
+ async def pilot_login (
962
+ self , body : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
963
+ ) -> _models .TokenResponse :
964
+ """Pilot Login.
965
+
966
+ Endpoint without policy, the pilot uses only its secret.
967
+
968
+ :param body: Required.
969
+ :type body: IO[bytes]
970
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
971
+ Default value is "application/json".
972
+ :paramtype content_type: str
973
+ :return: TokenResponse
974
+ :rtype: ~_generated.models.TokenResponse
975
+ :raises ~azure.core.exceptions.HttpResponseError:
976
+ """
977
+
938
978
@distributed_trace_async
939
979
async def pilot_login (
940
- self , * , pilot_job_reference : str , pilot_secret : str , ** kwargs : Any
980
+ self , body : Union [ _models . BodyAuthPilotLogin , IO [ bytes ]] , ** kwargs : Any
941
981
) -> _models .TokenResponse :
942
982
"""Pilot Login.
943
983
944
984
Endpoint without policy, the pilot uses only its secret.
945
985
946
- :keyword pilot_job_reference: Required.
947
- :paramtype pilot_job_reference: str
948
- :keyword pilot_secret: Required.
949
- :paramtype pilot_secret: str
986
+ :param body: Is either a BodyAuthPilotLogin type or a IO[bytes] type. Required.
987
+ :type body: ~_generated.models.BodyAuthPilotLogin or IO[bytes]
950
988
:return: TokenResponse
951
989
:rtype: ~_generated.models.TokenResponse
952
990
:raises ~azure.core.exceptions.HttpResponseError:
@@ -959,14 +997,26 @@ async def pilot_login(
959
997
}
960
998
error_map .update (kwargs .pop ("error_map" , {}) or {})
961
999
962
- _headers = kwargs .pop ("headers" , {}) or {}
1000
+ _headers = case_insensitive_dict ( kwargs .pop ("headers" , {}) or {})
963
1001
_params = kwargs .pop ("params" , {}) or {}
964
1002
1003
+ content_type : Optional [str ] = kwargs .pop (
1004
+ "content_type" , _headers .pop ("Content-Type" , None )
1005
+ )
965
1006
cls : ClsType [_models .TokenResponse ] = kwargs .pop ("cls" , None )
966
1007
1008
+ content_type = content_type or "application/json"
1009
+ _json = None
1010
+ _content = None
1011
+ if isinstance (body , (IOBase , bytes )):
1012
+ _content = body
1013
+ else :
1014
+ _json = self ._serialize .body (body , "BodyAuthPilotLogin" )
1015
+
967
1016
_request = build_auth_pilot_login_request (
968
- pilot_job_reference = pilot_job_reference ,
969
- pilot_secret = pilot_secret ,
1017
+ content_type = content_type ,
1018
+ json = _json ,
1019
+ content = _content ,
970
1020
headers = _headers ,
971
1021
params = _params ,
972
1022
)
@@ -996,16 +1046,56 @@ async def pilot_login(
996
1046
997
1047
return deserialized # type: ignore
998
1048
1049
+ @overload
1050
+ async def refresh_pilot_tokens (
1051
+ self ,
1052
+ body : _models .BodyAuthRefreshPilotTokens ,
1053
+ * ,
1054
+ content_type : str = "application/json" ,
1055
+ ** kwargs : Any ,
1056
+ ) -> _models .TokenResponse :
1057
+ """Refresh Pilot Tokens.
1058
+
1059
+ Endpoint where a pilot can exchange a refresh token for a token.
1060
+
1061
+ :param body: Required.
1062
+ :type body: ~_generated.models.BodyAuthRefreshPilotTokens
1063
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1064
+ Default value is "application/json".
1065
+ :paramtype content_type: str
1066
+ :return: TokenResponse
1067
+ :rtype: ~_generated.models.TokenResponse
1068
+ :raises ~azure.core.exceptions.HttpResponseError:
1069
+ """
1070
+
1071
+ @overload
1072
+ async def refresh_pilot_tokens (
1073
+ self , body : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
1074
+ ) -> _models .TokenResponse :
1075
+ """Refresh Pilot Tokens.
1076
+
1077
+ Endpoint where a pilot can exchange a refresh token for a token.
1078
+
1079
+ :param body: Required.
1080
+ :type body: IO[bytes]
1081
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1082
+ Default value is "application/json".
1083
+ :paramtype content_type: str
1084
+ :return: TokenResponse
1085
+ :rtype: ~_generated.models.TokenResponse
1086
+ :raises ~azure.core.exceptions.HttpResponseError:
1087
+ """
1088
+
999
1089
@distributed_trace_async
1000
1090
async def refresh_pilot_tokens (
1001
- self , * , refresh_token : str , ** kwargs : Any
1091
+ self , body : Union [ _models . BodyAuthRefreshPilotTokens , IO [ bytes ]] , ** kwargs : Any
1002
1092
) -> _models .TokenResponse :
1003
1093
"""Refresh Pilot Tokens.
1004
1094
1005
1095
Endpoint where a pilot can exchange a refresh token for a token.
1006
1096
1007
- :keyword refresh_token: Required.
1008
- :paramtype refresh_token: str
1097
+ :param body: Is either a BodyAuthRefreshPilotTokens type or a IO[bytes] type. Required.
1098
+ :type body: ~_generated.models.BodyAuthRefreshPilotTokens or IO[bytes]
1009
1099
:return: TokenResponse
1010
1100
:rtype: ~_generated.models.TokenResponse
1011
1101
:raises ~azure.core.exceptions.HttpResponseError:
@@ -1018,13 +1108,26 @@ async def refresh_pilot_tokens(
1018
1108
}
1019
1109
error_map .update (kwargs .pop ("error_map" , {}) or {})
1020
1110
1021
- _headers = kwargs .pop ("headers" , {}) or {}
1111
+ _headers = case_insensitive_dict ( kwargs .pop ("headers" , {}) or {})
1022
1112
_params = kwargs .pop ("params" , {}) or {}
1023
1113
1114
+ content_type : Optional [str ] = kwargs .pop (
1115
+ "content_type" , _headers .pop ("Content-Type" , None )
1116
+ )
1024
1117
cls : ClsType [_models .TokenResponse ] = kwargs .pop ("cls" , None )
1025
1118
1119
+ content_type = content_type or "application/json"
1120
+ _json = None
1121
+ _content = None
1122
+ if isinstance (body , (IOBase , bytes )):
1123
+ _content = body
1124
+ else :
1125
+ _json = self ._serialize .body (body , "BodyAuthRefreshPilotTokens" )
1126
+
1026
1127
_request = build_auth_refresh_pilot_tokens_request (
1027
- refresh_token = refresh_token ,
1128
+ content_type = content_type ,
1129
+ json = _json ,
1130
+ content = _content ,
1028
1131
headers = _headers ,
1029
1132
params = _params ,
1030
1133
)
@@ -1059,78 +1162,64 @@ async def register_new_pilots_to_db(
1059
1162
self ,
1060
1163
body : _models .BodyAuthRegisterNewPilotsToDb ,
1061
1164
* ,
1062
- vo : str ,
1063
- grid_type : str = "Dirac" ,
1064
1165
content_type : str = "application/json" ,
1065
1166
** kwargs : Any ,
1066
- ) -> Any :
1167
+ ) -> _models . PilotCredentialsResponse :
1067
1168
"""Register New Pilots To Db.
1068
1169
1069
- Endpoint where a you can create pilots with their credentials.
1170
+ Endpoint where a you can create pilots with their references.
1171
+ It will return the pilot secrets as well as an expiration date.
1172
+
1173
+ If a pilot reference already exists, it will block the insertion.
1070
1174
1071
1175
:param body: Required.
1072
1176
:type body: ~_generated.models.BodyAuthRegisterNewPilotsToDb
1073
- :keyword vo: Required.
1074
- :paramtype vo: str
1075
- :keyword grid_type: Default value is "Dirac".
1076
- :paramtype grid_type: str
1077
1177
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
1078
1178
Default value is "application/json".
1079
1179
:paramtype content_type: str
1080
- :return: any
1081
- :rtype: any
1180
+ :return: PilotCredentialsResponse
1181
+ :rtype: ~_generated.models.PilotCredentialsResponse
1082
1182
:raises ~azure.core.exceptions.HttpResponseError:
1083
1183
"""
1084
1184
1085
1185
@overload
1086
1186
async def register_new_pilots_to_db (
1087
- self ,
1088
- body : IO [bytes ],
1089
- * ,
1090
- vo : str ,
1091
- grid_type : str = "Dirac" ,
1092
- content_type : str = "application/json" ,
1093
- ** kwargs : Any ,
1094
- ) -> Any :
1187
+ self , body : IO [bytes ], * , content_type : str = "application/json" , ** kwargs : Any
1188
+ ) -> _models .PilotCredentialsResponse :
1095
1189
"""Register New Pilots To Db.
1096
1190
1097
- Endpoint where a you can create pilots with their credentials.
1191
+ Endpoint where a you can create pilots with their references.
1192
+ It will return the pilot secrets as well as an expiration date.
1193
+
1194
+ If a pilot reference already exists, it will block the insertion.
1098
1195
1099
1196
:param body: Required.
1100
1197
:type body: IO[bytes]
1101
- :keyword vo: Required.
1102
- :paramtype vo: str
1103
- :keyword grid_type: Default value is "Dirac".
1104
- :paramtype grid_type: str
1105
1198
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
1106
1199
Default value is "application/json".
1107
1200
:paramtype content_type: str
1108
- :return: any
1109
- :rtype: any
1201
+ :return: PilotCredentialsResponse
1202
+ :rtype: ~_generated.models.PilotCredentialsResponse
1110
1203
:raises ~azure.core.exceptions.HttpResponseError:
1111
1204
"""
1112
1205
1113
1206
@distributed_trace_async
1114
1207
async def register_new_pilots_to_db (
1115
1208
self ,
1116
1209
body : Union [_models .BodyAuthRegisterNewPilotsToDb , IO [bytes ]],
1117
- * ,
1118
- vo : str ,
1119
- grid_type : str = "Dirac" ,
1120
1210
** kwargs : Any ,
1121
- ) -> Any :
1211
+ ) -> _models . PilotCredentialsResponse :
1122
1212
"""Register New Pilots To Db.
1123
1213
1124
- Endpoint where a you can create pilots with their credentials.
1214
+ Endpoint where a you can create pilots with their references.
1215
+ It will return the pilot secrets as well as an expiration date.
1216
+
1217
+ If a pilot reference already exists, it will block the insertion.
1125
1218
1126
1219
:param body: Is either a BodyAuthRegisterNewPilotsToDb type or a IO[bytes] type. Required.
1127
1220
:type body: ~_generated.models.BodyAuthRegisterNewPilotsToDb or IO[bytes]
1128
- :keyword vo: Required.
1129
- :paramtype vo: str
1130
- :keyword grid_type: Default value is "Dirac".
1131
- :paramtype grid_type: str
1132
- :return: any
1133
- :rtype: any
1221
+ :return: PilotCredentialsResponse
1222
+ :rtype: ~_generated.models.PilotCredentialsResponse
1134
1223
:raises ~azure.core.exceptions.HttpResponseError:
1135
1224
"""
1136
1225
error_map : MutableMapping = {
@@ -1147,7 +1236,7 @@ async def register_new_pilots_to_db(
1147
1236
content_type : Optional [str ] = kwargs .pop (
1148
1237
"content_type" , _headers .pop ("Content-Type" , None )
1149
1238
)
1150
- cls : ClsType [Any ] = kwargs .pop ("cls" , None )
1239
+ cls : ClsType [_models . PilotCredentialsResponse ] = kwargs .pop ("cls" , None )
1151
1240
1152
1241
content_type = content_type or "application/json"
1153
1242
_json = None
@@ -1158,8 +1247,6 @@ async def register_new_pilots_to_db(
1158
1247
_json = self ._serialize .body (body , "BodyAuthRegisterNewPilotsToDb" )
1159
1248
1160
1249
_request = build_auth_register_new_pilots_to_db_request (
1161
- vo = vo ,
1162
- grid_type = grid_type ,
1163
1250
content_type = content_type ,
1164
1251
json = _json ,
1165
1252
content = _content ,
@@ -1183,7 +1270,9 @@ async def register_new_pilots_to_db(
1183
1270
)
1184
1271
raise HttpResponseError (response = response )
1185
1272
1186
- deserialized = self ._deserialize ("object" , pipeline_response .http_response )
1273
+ deserialized = self ._deserialize (
1274
+ "PilotCredentialsResponse" , pipeline_response .http_response
1275
+ )
1187
1276
1188
1277
if cls :
1189
1278
return cls (pipeline_response , deserialized , {}) # type: ignore
0 commit comments