Skip to content

Commit 9ea8655

Browse files
authored
Merge pull request #1283 from microsoftgraph/v1.0/pipelinebuild/192501
Generated models and request builders
2 parents 63c1f5a + f7de565 commit 9ea8655

File tree

165 files changed

+7214
-406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+7214
-406
lines changed

msgraph/generated/applications/get_available_extension_properties/get_available_extension_properties_request_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, d
3333

3434
async def post(self,body: GetAvailableExtensionPropertiesPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[GetAvailableExtensionPropertiesPostResponse]:
3535
"""
36-
Return all directory extension definitions that have been registered in a directory, including through multi-tenant apps. The following entities support extension properties:
36+
Return all directory extension definitions that are registered in a directory, including through multitenant apps. The following entities support extension properties:
3737
param body: The request body
3838
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
3939
Returns: Optional[GetAvailableExtensionPropertiesPostResponse]
@@ -57,7 +57,7 @@ async def post(self,body: GetAvailableExtensionPropertiesPostRequestBody, reques
5757

5858
def to_post_request_information(self,body: GetAvailableExtensionPropertiesPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
5959
"""
60-
Return all directory extension definitions that have been registered in a directory, including through multi-tenant apps. The following entities support extension properties:
60+
Return all directory extension definitions that are registered in a directory, including through multitenant apps. The following entities support extension properties:
6161
param body: The request body
6262
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
6363
Returns: RequestInformation

msgraph/generated/applications/item/add_key/add_key_request_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, d
3333

3434
async def post(self,body: AddKeyPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[KeyCredential]:
3535
"""
36-
Add a key credential to an application. This method, along with removeKey can be used by an application to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. Applications that dont have any existing valid certificates (no certificates have been added yet, or all certificates have expired), wont be able to use this service action. You can use the Update application operation to perform an update instead.
36+
Add a key credential to an application. This method, along with removeKey can be used by an application to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. Applications that don't have any existing valid certificates (no certificates have been added yet, or all certificates have expired), won't be able to use this service action. You can use the Update application operation to perform an update instead.
3737
param body: The request body
3838
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
3939
Returns: Optional[KeyCredential]
@@ -57,7 +57,7 @@ async def post(self,body: AddKeyPostRequestBody, request_configuration: Optional
5757

5858
def to_post_request_information(self,body: AddKeyPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
5959
"""
60-
Add a key credential to an application. This method, along with removeKey can be used by an application to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. Applications that dont have any existing valid certificates (no certificates have been added yet, or all certificates have expired), wont be able to use this service action. You can use the Update application operation to perform an update instead.
60+
Add a key credential to an application. This method, along with removeKey can be used by an application to automate rolling its expiring keys. As part of the request validation for this method, a proof of possession of an existing key is verified before the action can be performed. Applications that don't have any existing valid certificates (no certificates have been added yet, or all certificates have expired), won't be able to use this service action. You can use the Update application operation to perform an update instead.
6161
param body: The request body
6262
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
6363
Returns: RequestInformation
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from __future__ import annotations
2+
from collections.abc import Callable
3+
from dataclasses import dataclass, field
4+
from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter
5+
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton
6+
from typing import Any, Optional, TYPE_CHECKING, Union
7+
8+
@dataclass
9+
class ConfirmCompromisedPostRequestBody(AdditionalDataHolder, BackedModel, Parsable):
10+
# Stores model information.
11+
backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)
12+
13+
# Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
14+
additional_data: dict[str, Any] = field(default_factory=dict)
15+
# The requestIds property
16+
request_ids: Optional[list[str]] = None
17+
18+
@staticmethod
19+
def create_from_discriminator_value(parse_node: ParseNode) -> ConfirmCompromisedPostRequestBody:
20+
"""
21+
Creates a new instance of the appropriate class based on discriminator value
22+
param parse_node: The parse node to use to read the discriminator value and create the object
23+
Returns: ConfirmCompromisedPostRequestBody
24+
"""
25+
if parse_node is None:
26+
raise TypeError("parse_node cannot be null.")
27+
return ConfirmCompromisedPostRequestBody()
28+
29+
def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
30+
"""
31+
The deserialization information for the current model
32+
Returns: dict[str, Callable[[ParseNode], None]]
33+
"""
34+
fields: dict[str, Callable[[Any], None]] = {
35+
"requestIds": lambda n : setattr(self, 'request_ids', n.get_collection_of_primitive_values(str)),
36+
}
37+
return fields
38+
39+
def serialize(self,writer: SerializationWriter) -> None:
40+
"""
41+
Serializes information the current object
42+
param writer: Serialization writer to use to serialize this model
43+
Returns: None
44+
"""
45+
if writer is None:
46+
raise TypeError("writer cannot be null.")
47+
writer.write_collection_of_primitive_values("requestIds", self.request_ids)
48+
writer.write_additional_data_value(self.additional_data)
49+
50+
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from __future__ import annotations
2+
from collections.abc import Callable
3+
from dataclasses import dataclass, field
4+
from kiota_abstractions.serialization import AdditionalDataHolder, Parsable, ParseNode, SerializationWriter
5+
from kiota_abstractions.store import BackedModel, BackingStore, BackingStoreFactorySingleton
6+
from typing import Any, Optional, TYPE_CHECKING, Union
7+
8+
@dataclass
9+
class ConfirmSafePostRequestBody(AdditionalDataHolder, BackedModel, Parsable):
10+
# Stores model information.
11+
backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)
12+
13+
# Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
14+
additional_data: dict[str, Any] = field(default_factory=dict)
15+
# The requestIds property
16+
request_ids: Optional[list[str]] = None
17+
18+
@staticmethod
19+
def create_from_discriminator_value(parse_node: ParseNode) -> ConfirmSafePostRequestBody:
20+
"""
21+
Creates a new instance of the appropriate class based on discriminator value
22+
param parse_node: The parse node to use to read the discriminator value and create the object
23+
Returns: ConfirmSafePostRequestBody
24+
"""
25+
if parse_node is None:
26+
raise TypeError("parse_node cannot be null.")
27+
return ConfirmSafePostRequestBody()
28+
29+
def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
30+
"""
31+
The deserialization information for the current model
32+
Returns: dict[str, Callable[[ParseNode], None]]
33+
"""
34+
fields: dict[str, Callable[[Any], None]] = {
35+
"requestIds": lambda n : setattr(self, 'request_ids', n.get_collection_of_primitive_values(str)),
36+
}
37+
return fields
38+
39+
def serialize(self,writer: SerializationWriter) -> None:
40+
"""
41+
Serializes information the current object
42+
param writer: Serialization writer to use to serialize this model
43+
Returns: None
44+
"""
45+
if writer is None:
46+
raise TypeError("writer cannot be null.")
47+
writer.write_collection_of_primitive_values("requestIds", self.request_ids)
48+
writer.write_additional_data_value(self.additional_data)
49+
50+
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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_safe_post_request_body import ConfirmSafePostRequestBody
19+
20+
class ConfirmSafeRequestBuilder(BaseRequestBuilder):
21+
"""
22+
Provides operations to call the confirmSafe method.
23+
"""
24+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
25+
"""
26+
Instantiates a new ConfirmSafeRequestBuilder 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/confirmSafe", path_parameters)
32+
33+
async def post(self,body: ConfirmSafePostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34+
"""
35+
Mark an event in Microsoft Entra sign-in logs as safe. Admins can either mark the events flagged as risky by Microsoft Entra ID Protection as safe, or they can mark unflagged events as safe. 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-confirmsafe?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: ConfirmSafePostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
56+
"""
57+
Mark an event in Microsoft Entra sign-in logs as safe. Admins can either mark the events flagged as risky by Microsoft Entra ID Protection as safe, or they can mark unflagged events as safe. 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) -> ConfirmSafeRequestBuilder:
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: ConfirmSafeRequestBuilder
75+
"""
76+
if raw_url is None:
77+
raise TypeError("raw_url cannot be null.")
78+
return ConfirmSafeRequestBuilder(self.request_adapter, raw_url)
79+
80+
@dataclass
81+
class ConfirmSafeRequestBuilderPostRequestConfiguration(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

Comments
 (0)