|
| 1 | +from __future__ import annotations |
| 2 | +from collections.abc import Callable |
| 3 | +from dataclasses import dataclass, field |
| 4 | +from kiota_abstractions.base_request_builder import BaseRequestBuilder |
| 5 | +from kiota_abstractions.base_request_configuration import RequestConfiguration |
| 6 | +from kiota_abstractions.default_query_parameters import QueryParameters |
| 7 | +from kiota_abstractions.get_path_parameters import get_path_parameters |
| 8 | +from kiota_abstractions.method import Method |
| 9 | +from kiota_abstractions.request_adapter import RequestAdapter |
| 10 | +from kiota_abstractions.request_information import RequestInformation |
| 11 | +from kiota_abstractions.request_option import RequestOption |
| 12 | +from kiota_abstractions.serialization import Parsable, ParsableFactory |
| 13 | +from typing import Any, Optional, TYPE_CHECKING, Union |
| 14 | +from warnings import warn |
| 15 | + |
| 16 | +if TYPE_CHECKING: |
| 17 | + from ....models.o_data_errors.o_data_error import ODataError |
| 18 | + from .confirm_compromised_post_request_body import ConfirmCompromisedPostRequestBody |
| 19 | + |
| 20 | +class ConfirmCompromisedRequestBuilder(BaseRequestBuilder): |
| 21 | + """ |
| 22 | + Provides operations to call the confirmCompromised method. |
| 23 | + """ |
| 24 | + def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None: |
| 25 | + """ |
| 26 | + Instantiates a new ConfirmCompromisedRequestBuilder and sets the default values. |
| 27 | + param path_parameters: The raw url or the url-template parameters for the request. |
| 28 | + param request_adapter: The request adapter to use to execute the requests. |
| 29 | + Returns: None |
| 30 | + """ |
| 31 | + super().__init__(request_adapter, "{+baseurl}/auditLogs/signIns/confirmCompromised", path_parameters) |
| 32 | + |
| 33 | + async def post(self,body: ConfirmCompromisedPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None: |
| 34 | + """ |
| 35 | + Mark an event in the Microsoft Entra sign-in logs as risky. Events marked as risky by an admin are immediately flagged as high risk in Microsoft Entra ID Protection, overriding previous risk states. Admins can confirm that events flagged as risky by Microsoft Entra ID Protection are in fact risky. For details about investigating Identity Protection risks, see How to investigate risk. |
| 36 | + param body: The request body |
| 37 | + param request_configuration: Configuration for the request such as headers, query parameters, and middleware options. |
| 38 | + Returns: None |
| 39 | + Find more info here: https://learn.microsoft.com/graph/api/signin-confirmcompromised?view=graph-rest-1.0 |
| 40 | + """ |
| 41 | + if body is None: |
| 42 | + raise TypeError("body cannot be null.") |
| 43 | + request_info = self.to_post_request_information( |
| 44 | + body, request_configuration |
| 45 | + ) |
| 46 | + from ....models.o_data_errors.o_data_error import ODataError |
| 47 | + |
| 48 | + error_mapping: dict[str, type[ParsableFactory]] = { |
| 49 | + "XXX": ODataError, |
| 50 | + } |
| 51 | + if not self.request_adapter: |
| 52 | + raise Exception("Http core is null") |
| 53 | + return await self.request_adapter.send_no_response_content_async(request_info, error_mapping) |
| 54 | + |
| 55 | + def to_post_request_information(self,body: ConfirmCompromisedPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation: |
| 56 | + """ |
| 57 | + Mark an event in the Microsoft Entra sign-in logs as risky. Events marked as risky by an admin are immediately flagged as high risk in Microsoft Entra ID Protection, overriding previous risk states. Admins can confirm that events flagged as risky by Microsoft Entra ID Protection are in fact risky. For details about investigating Identity Protection risks, see How to investigate risk. |
| 58 | + param body: The request body |
| 59 | + param request_configuration: Configuration for the request such as headers, query parameters, and middleware options. |
| 60 | + Returns: RequestInformation |
| 61 | + """ |
| 62 | + if body is None: |
| 63 | + raise TypeError("body cannot be null.") |
| 64 | + request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters) |
| 65 | + request_info.configure(request_configuration) |
| 66 | + request_info.headers.try_add("Accept", "application/json") |
| 67 | + request_info.set_content_from_parsable(self.request_adapter, "application/json", body) |
| 68 | + return request_info |
| 69 | + |
| 70 | + def with_url(self,raw_url: str) -> ConfirmCompromisedRequestBuilder: |
| 71 | + """ |
| 72 | + Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. |
| 73 | + param raw_url: The raw URL to use for the request builder. |
| 74 | + Returns: ConfirmCompromisedRequestBuilder |
| 75 | + """ |
| 76 | + if raw_url is None: |
| 77 | + raise TypeError("raw_url cannot be null.") |
| 78 | + return ConfirmCompromisedRequestBuilder(self.request_adapter, raw_url) |
| 79 | + |
| 80 | + @dataclass |
| 81 | + class ConfirmCompromisedRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]): |
| 82 | + """ |
| 83 | + Configuration for the request such as headers, query parameters, and middleware options. |
| 84 | + """ |
| 85 | + warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning) |
| 86 | + |
| 87 | + |
0 commit comments