|
60 | 60 | build_pilots_delete_pilots_request,
|
61 | 61 | build_pilots_pilot_login_request,
|
62 | 62 | build_pilots_refresh_pilot_tokens_request,
|
| 63 | + build_pilots_search_logs_request, |
63 | 64 | build_pilots_search_request,
|
| 65 | + build_pilots_send_message_request, |
64 | 66 | build_pilots_update_pilot_fields_request,
|
65 | 67 | build_pilots_update_secrets_constraints_request,
|
66 | 68 | build_pilots_userinfo_request,
|
@@ -2979,6 +2981,143 @@ async def search(
|
2979 | 2981 |
|
2980 | 2982 | return deserialized # type: ignore
|
2981 | 2983 |
|
| 2984 | + @overload |
| 2985 | + async def search_logs( |
| 2986 | + self, |
| 2987 | + body: Optional[_models.SearchParams] = None, |
| 2988 | + *, |
| 2989 | + page: int = 1, |
| 2990 | + per_page: int = 100, |
| 2991 | + content_type: str = "application/json", |
| 2992 | + **kwargs: Any |
| 2993 | + ) -> List[Dict[str, Any]]: |
| 2994 | + """Search Logs. |
| 2995 | +
|
| 2996 | + Search Logs. |
| 2997 | +
|
| 2998 | + :param body: Default value is None. |
| 2999 | + :type body: ~_generated.models.SearchParams |
| 3000 | + :keyword page: Default value is 1. |
| 3001 | + :paramtype page: int |
| 3002 | + :keyword per_page: Default value is 100. |
| 3003 | + :paramtype per_page: int |
| 3004 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 3005 | + Default value is "application/json". |
| 3006 | + :paramtype content_type: str |
| 3007 | + :return: list of dict mapping str to any |
| 3008 | + :rtype: list[dict[str, any]] |
| 3009 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3010 | + """ |
| 3011 | + |
| 3012 | + @overload |
| 3013 | + async def search_logs( |
| 3014 | + self, |
| 3015 | + body: Optional[IO[bytes]] = None, |
| 3016 | + *, |
| 3017 | + page: int = 1, |
| 3018 | + per_page: int = 100, |
| 3019 | + content_type: str = "application/json", |
| 3020 | + **kwargs: Any |
| 3021 | + ) -> List[Dict[str, Any]]: |
| 3022 | + """Search Logs. |
| 3023 | +
|
| 3024 | + Search Logs. |
| 3025 | +
|
| 3026 | + :param body: Default value is None. |
| 3027 | + :type body: IO[bytes] |
| 3028 | + :keyword page: Default value is 1. |
| 3029 | + :paramtype page: int |
| 3030 | + :keyword per_page: Default value is 100. |
| 3031 | + :paramtype per_page: int |
| 3032 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 3033 | + Default value is "application/json". |
| 3034 | + :paramtype content_type: str |
| 3035 | + :return: list of dict mapping str to any |
| 3036 | + :rtype: list[dict[str, any]] |
| 3037 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3038 | + """ |
| 3039 | + |
| 3040 | + @distributed_trace_async |
| 3041 | + async def search_logs( |
| 3042 | + self, |
| 3043 | + body: Optional[Union[_models.SearchParams, IO[bytes]]] = None, |
| 3044 | + *, |
| 3045 | + page: int = 1, |
| 3046 | + per_page: int = 100, |
| 3047 | + **kwargs: Any |
| 3048 | + ) -> List[Dict[str, Any]]: |
| 3049 | + """Search Logs. |
| 3050 | +
|
| 3051 | + Search Logs. |
| 3052 | +
|
| 3053 | + :param body: Is either a SearchParams type or a IO[bytes] type. Default value is None. |
| 3054 | + :type body: ~_generated.models.SearchParams or IO[bytes] |
| 3055 | + :keyword page: Default value is 1. |
| 3056 | + :paramtype page: int |
| 3057 | + :keyword per_page: Default value is 100. |
| 3058 | + :paramtype per_page: int |
| 3059 | + :return: list of dict mapping str to any |
| 3060 | + :rtype: list[dict[str, any]] |
| 3061 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3062 | + """ |
| 3063 | + error_map: MutableMapping = { |
| 3064 | + 401: ClientAuthenticationError, |
| 3065 | + 404: ResourceNotFoundError, |
| 3066 | + 409: ResourceExistsError, |
| 3067 | + 304: ResourceNotModifiedError, |
| 3068 | + } |
| 3069 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 3070 | + |
| 3071 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 3072 | + _params = kwargs.pop("params", {}) or {} |
| 3073 | + |
| 3074 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3075 | + cls: ClsType[List[Dict[str, Any]]] = kwargs.pop("cls", None) |
| 3076 | + |
| 3077 | + content_type = content_type or "application/json" |
| 3078 | + _json = None |
| 3079 | + _content = None |
| 3080 | + if isinstance(body, (IOBase, bytes)): |
| 3081 | + _content = body |
| 3082 | + else: |
| 3083 | + if body is not None: |
| 3084 | + _json = self._serialize.body(body, "SearchParams") |
| 3085 | + else: |
| 3086 | + _json = None |
| 3087 | + |
| 3088 | + _request = build_pilots_search_logs_request( |
| 3089 | + page=page, |
| 3090 | + per_page=per_page, |
| 3091 | + content_type=content_type, |
| 3092 | + json=_json, |
| 3093 | + content=_content, |
| 3094 | + headers=_headers, |
| 3095 | + params=_params, |
| 3096 | + ) |
| 3097 | + _request.url = self._client.format_url(_request.url) |
| 3098 | + |
| 3099 | + _stream = False |
| 3100 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3101 | + _request, stream=_stream, **kwargs |
| 3102 | + ) |
| 3103 | + |
| 3104 | + response = pipeline_response.http_response |
| 3105 | + |
| 3106 | + if response.status_code not in [200, 206]: |
| 3107 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3108 | + raise HttpResponseError(response=response) |
| 3109 | + |
| 3110 | + response_headers = {} |
| 3111 | + if response.status_code == 206: |
| 3112 | + response_headers["Content-Range"] = self._deserialize("str", response.headers.get("Content-Range")) |
| 3113 | + |
| 3114 | + deserialized = self._deserialize("[{object}]", pipeline_response.http_response) |
| 3115 | + |
| 3116 | + if cls: |
| 3117 | + return cls(pipeline_response, deserialized, response_headers) # type: ignore |
| 3118 | + |
| 3119 | + return deserialized # type: ignore |
| 3120 | + |
2982 | 3121 | @overload
|
2983 | 3122 | async def pilot_login(
|
2984 | 3123 | self, body: _models.BodyPilotsPilotLogin, *, content_type: str = "application/json", **kwargs: Any
|
@@ -3176,3 +3315,115 @@ async def refresh_pilot_tokens(
|
3176 | 3315 | return cls(pipeline_response, deserialized, {}) # type: ignore
|
3177 | 3316 |
|
3178 | 3317 | return deserialized # type: ignore
|
| 3318 | + |
| 3319 | + @overload |
| 3320 | + async def send_message( |
| 3321 | + self, |
| 3322 | + body: _models.LogMessage, |
| 3323 | + *, |
| 3324 | + authorization: Optional[str] = None, |
| 3325 | + content_type: str = "application/json", |
| 3326 | + **kwargs: Any |
| 3327 | + ) -> None: |
| 3328 | + """Send Message. |
| 3329 | +
|
| 3330 | + Send Message. |
| 3331 | +
|
| 3332 | + :param body: Required. |
| 3333 | + :type body: ~_generated.models.LogMessage |
| 3334 | + :keyword authorization: Default value is None. |
| 3335 | + :paramtype authorization: str |
| 3336 | + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. |
| 3337 | + Default value is "application/json". |
| 3338 | + :paramtype content_type: str |
| 3339 | + :return: None |
| 3340 | + :rtype: None |
| 3341 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3342 | + """ |
| 3343 | + |
| 3344 | + @overload |
| 3345 | + async def send_message( |
| 3346 | + self, |
| 3347 | + body: IO[bytes], |
| 3348 | + *, |
| 3349 | + authorization: Optional[str] = None, |
| 3350 | + content_type: str = "application/json", |
| 3351 | + **kwargs: Any |
| 3352 | + ) -> None: |
| 3353 | + """Send Message. |
| 3354 | +
|
| 3355 | + Send Message. |
| 3356 | +
|
| 3357 | + :param body: Required. |
| 3358 | + :type body: IO[bytes] |
| 3359 | + :keyword authorization: Default value is None. |
| 3360 | + :paramtype authorization: str |
| 3361 | + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. |
| 3362 | + Default value is "application/json". |
| 3363 | + :paramtype content_type: str |
| 3364 | + :return: None |
| 3365 | + :rtype: None |
| 3366 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3367 | + """ |
| 3368 | + |
| 3369 | + @distributed_trace_async |
| 3370 | + async def send_message( |
| 3371 | + self, body: Union[_models.LogMessage, IO[bytes]], *, authorization: Optional[str] = None, **kwargs: Any |
| 3372 | + ) -> None: |
| 3373 | + """Send Message. |
| 3374 | +
|
| 3375 | + Send Message. |
| 3376 | +
|
| 3377 | + :param body: Is either a LogMessage type or a IO[bytes] type. Required. |
| 3378 | + :type body: ~_generated.models.LogMessage or IO[bytes] |
| 3379 | + :keyword authorization: Default value is None. |
| 3380 | + :paramtype authorization: str |
| 3381 | + :return: None |
| 3382 | + :rtype: None |
| 3383 | + :raises ~azure.core.exceptions.HttpResponseError: |
| 3384 | + """ |
| 3385 | + error_map: MutableMapping = { |
| 3386 | + 401: ClientAuthenticationError, |
| 3387 | + 404: ResourceNotFoundError, |
| 3388 | + 409: ResourceExistsError, |
| 3389 | + 304: ResourceNotModifiedError, |
| 3390 | + } |
| 3391 | + error_map.update(kwargs.pop("error_map", {}) or {}) |
| 3392 | + |
| 3393 | + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) |
| 3394 | + _params = kwargs.pop("params", {}) or {} |
| 3395 | + |
| 3396 | + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) |
| 3397 | + cls: ClsType[None] = kwargs.pop("cls", None) |
| 3398 | + |
| 3399 | + content_type = content_type or "application/json" |
| 3400 | + _json = None |
| 3401 | + _content = None |
| 3402 | + if isinstance(body, (IOBase, bytes)): |
| 3403 | + _content = body |
| 3404 | + else: |
| 3405 | + _json = self._serialize.body(body, "LogMessage") |
| 3406 | + |
| 3407 | + _request = build_pilots_send_message_request( |
| 3408 | + authorization=authorization, |
| 3409 | + content_type=content_type, |
| 3410 | + json=_json, |
| 3411 | + content=_content, |
| 3412 | + headers=_headers, |
| 3413 | + params=_params, |
| 3414 | + ) |
| 3415 | + _request.url = self._client.format_url(_request.url) |
| 3416 | + |
| 3417 | + _stream = False |
| 3418 | + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access |
| 3419 | + _request, stream=_stream, **kwargs |
| 3420 | + ) |
| 3421 | + |
| 3422 | + response = pipeline_response.http_response |
| 3423 | + |
| 3424 | + if response.status_code not in [204]: |
| 3425 | + map_error(status_code=response.status_code, response=response, error_map=error_map) |
| 3426 | + raise HttpResponseError(response=response) |
| 3427 | + |
| 3428 | + if cls: |
| 3429 | + return cls(pipeline_response, None, {}) # type: ignore |
0 commit comments