msgraph-sdk 1.52.0__py3-none-any.whl → 1.54.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. msgraph/_version.py +1 -1
  2. msgraph/generated/admin/teams/policy/microsoft_graph_teams_administration_get_policy_id_with_type_with_name/get_policy_id_with_type_with_name_get_response.py +58 -0
  3. msgraph/generated/admin/teams/policy/microsoft_graph_teams_administration_get_policy_id_with_type_with_name/microsoft_graph_teams_administration_get_policy_id_with_type_with_name_request_builder.py +143 -0
  4. msgraph/generated/admin/teams/policy/policy_request_builder.py +214 -0
  5. msgraph/generated/admin/teams/policy/user_assignments/count/count_request_builder.py +104 -0
  6. msgraph/generated/admin/teams/policy/user_assignments/item/teams_policy_user_assignment_item_request_builder.py +188 -0
  7. msgraph/generated/admin/teams/policy/user_assignments/microsoft_graph_teams_administration_assign/assign_post_request_body.py +57 -0
  8. msgraph/generated/admin/teams/policy/user_assignments/microsoft_graph_teams_administration_assign/microsoft_graph_teams_administration_assign_request_builder.py +87 -0
  9. msgraph/generated/admin/teams/policy/user_assignments/microsoft_graph_teams_administration_unassign/microsoft_graph_teams_administration_unassign_request_builder.py +87 -0
  10. msgraph/generated/admin/teams/policy/user_assignments/microsoft_graph_teams_administration_unassign/unassign_post_request_body.py +57 -0
  11. msgraph/generated/admin/teams/policy/user_assignments/user_assignments_request_builder.py +228 -0
  12. msgraph/generated/admin/teams/teams_request_builder.py +13 -3
  13. msgraph/generated/kiota-dom-export.txt +453 -25
  14. msgraph/generated/kiota-lock.json +2 -2
  15. msgraph/generated/models/admin.py +1 -1
  16. msgraph/generated/models/ai_agent_info.py +57 -0
  17. msgraph/generated/models/ai_interaction_entity.py +85 -0
  18. msgraph/generated/models/ai_interaction_plugin.py +14 -23
  19. msgraph/generated/models/authentication.py +7 -0
  20. msgraph/generated/models/authentication_method.py +12 -0
  21. msgraph/generated/models/cloud_pc_domain_join_configuration.py +1 -1
  22. msgraph/generated/models/cloud_pc_on_premises_connection_health_check.py +1 -1
  23. msgraph/generated/models/entity.py +35 -0
  24. msgraph/generated/models/external_authentication_method.py +61 -0
  25. msgraph/generated/models/external_authentication_method_collection_response.py +58 -0
  26. msgraph/generated/models/fido2_authentication_method.py +0 -5
  27. msgraph/generated/models/identity_provider_base.py +7 -0
  28. msgraph/generated/models/microsoft_authenticator_authentication_method.py +0 -5
  29. msgraph/generated/models/oidc_address_inbound_claims.py +70 -0
  30. msgraph/generated/models/oidc_client_authentication.py +73 -0
  31. msgraph/generated/models/oidc_client_secret_authentication.py +57 -0
  32. msgraph/generated/models/oidc_identity_provider.py +90 -0
  33. msgraph/generated/models/oidc_inbound_claim_mapping_override.py +93 -0
  34. msgraph/generated/models/oidc_private_jwt_key_client_authentication.py +53 -0
  35. msgraph/generated/models/oidc_response_type.py +8 -0
  36. msgraph/generated/models/password_authentication_method.py +0 -5
  37. msgraph/generated/models/platform_credential_authentication_method.py +0 -5
  38. msgraph/generated/models/process_conversation_metadata.py +14 -0
  39. msgraph/generated/models/protection_policy_artifact_count.py +66 -0
  40. msgraph/generated/models/protection_policy_base.py +11 -0
  41. msgraph/generated/models/resource_access_detail.py +92 -0
  42. msgraph/generated/models/resource_access_status.py +8 -0
  43. msgraph/generated/models/resource_access_type.py +9 -0
  44. msgraph/generated/models/security/alert.py +1 -1
  45. msgraph/generated/models/security/ediscovery_purge_data_operation.py +7 -0
  46. msgraph/generated/models/security/incident.py +4 -0
  47. msgraph/generated/models/security/sensor.py +7 -0
  48. msgraph/generated/models/security/sensor_candidate.py +4 -0
  49. msgraph/generated/models/security/service_status.py +11 -0
  50. msgraph/generated/models/service_principal.py +1 -1
  51. msgraph/generated/models/teams_administration/policy_identifier_detail.py +61 -0
  52. msgraph/generated/models/teams_administration/teams_admin_root.py +8 -1
  53. msgraph/generated/models/teams_administration/teams_policy_assignment.py +60 -0
  54. msgraph/generated/models/teams_administration/teams_policy_user_assignment.py +65 -0
  55. msgraph/generated/models/teams_administration/teams_policy_user_assignment_collection_response.py +58 -0
  56. msgraph/generated/models/temporary_access_pass_authentication_method.py +0 -4
  57. msgraph/generated/models/usage_rights.py +1 -0
  58. msgraph/generated/models/windows_hello_for_business_authentication_method.py +0 -5
  59. msgraph/generated/policies/authentication_methods_policy/authentication_method_configurations/authentication_method_configurations_request_builder.py +3 -3
  60. msgraph/generated/policies/authentication_methods_policy/authentication_method_configurations/item/authentication_method_configuration_item_request_builder.py +10 -7
  61. msgraph/generated/users/item/authentication/authentication_request_builder.py +10 -0
  62. msgraph/generated/users/item/authentication/external_authentication_methods/count/count_request_builder.py +104 -0
  63. msgraph/generated/users/item/authentication/external_authentication_methods/external_authentication_methods_request_builder.py +209 -0
  64. msgraph/generated/users/item/authentication/external_authentication_methods/item/external_authentication_method_item_request_builder.py +189 -0
  65. {msgraph_sdk-1.52.0.dist-info → msgraph_sdk-1.54.0.dist-info}/METADATA +1 -1
  66. {msgraph_sdk-1.52.0.dist-info → msgraph_sdk-1.54.0.dist-info}/RECORD +68 -35
  67. {msgraph_sdk-1.52.0.dist-info → msgraph_sdk-1.54.0.dist-info}/WHEEL +0 -0
  68. {msgraph_sdk-1.52.0.dist-info → msgraph_sdk-1.54.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,188 @@
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 ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
19
+
20
+ class TeamsPolicyUserAssignmentItemRequestBuilder(BaseRequestBuilder):
21
+ """
22
+ Provides operations to manage the userAssignments property of the microsoft.graph.teamsAdministration.teamsPolicyAssignment entity.
23
+ """
24
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
25
+ """
26
+ Instantiates a new TeamsPolicyUserAssignmentItemRequestBuilder 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}/admin/teams/policy/userAssignments/{teamsPolicyUserAssignment%2Did}{?%24expand,%24select}", path_parameters)
32
+
33
+ async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34
+ """
35
+ Delete navigation property userAssignments for admin
36
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
37
+ Returns: None
38
+ """
39
+ request_info = self.to_delete_request_information(
40
+ request_configuration
41
+ )
42
+ from ......models.o_data_errors.o_data_error import ODataError
43
+
44
+ error_mapping: dict[str, type[ParsableFactory]] = {
45
+ "XXX": ODataError,
46
+ }
47
+ if not self.request_adapter:
48
+ raise Exception("Http core is null")
49
+ return await self.request_adapter.send_no_response_content_async(request_info, error_mapping)
50
+
51
+ async def get(self,request_configuration: Optional[RequestConfiguration[TeamsPolicyUserAssignmentItemRequestBuilderGetQueryParameters]] = None) -> Optional[TeamsPolicyUserAssignment]:
52
+ """
53
+ The collection of user policy assignments.
54
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
55
+ Returns: Optional[TeamsPolicyUserAssignment]
56
+ """
57
+ request_info = self.to_get_request_information(
58
+ request_configuration
59
+ )
60
+ from ......models.o_data_errors.o_data_error import ODataError
61
+
62
+ error_mapping: dict[str, type[ParsableFactory]] = {
63
+ "XXX": ODataError,
64
+ }
65
+ if not self.request_adapter:
66
+ raise Exception("Http core is null")
67
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
68
+
69
+ return await self.request_adapter.send_async(request_info, TeamsPolicyUserAssignment, error_mapping)
70
+
71
+ async def patch(self,body: TeamsPolicyUserAssignment, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[TeamsPolicyUserAssignment]:
72
+ """
73
+ Update the navigation property userAssignments in admin
74
+ param body: The request body
75
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
76
+ Returns: Optional[TeamsPolicyUserAssignment]
77
+ """
78
+ if body is None:
79
+ raise TypeError("body cannot be null.")
80
+ request_info = self.to_patch_request_information(
81
+ body, request_configuration
82
+ )
83
+ from ......models.o_data_errors.o_data_error import ODataError
84
+
85
+ error_mapping: dict[str, type[ParsableFactory]] = {
86
+ "XXX": ODataError,
87
+ }
88
+ if not self.request_adapter:
89
+ raise Exception("Http core is null")
90
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
91
+
92
+ return await self.request_adapter.send_async(request_info, TeamsPolicyUserAssignment, error_mapping)
93
+
94
+ def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
95
+ """
96
+ Delete navigation property userAssignments for admin
97
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
98
+ Returns: RequestInformation
99
+ """
100
+ request_info = RequestInformation(Method.DELETE, self.url_template, self.path_parameters)
101
+ request_info.configure(request_configuration)
102
+ request_info.headers.try_add("Accept", "application/json")
103
+ return request_info
104
+
105
+ def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[TeamsPolicyUserAssignmentItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
106
+ """
107
+ The collection of user policy assignments.
108
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
109
+ Returns: RequestInformation
110
+ """
111
+ request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
112
+ request_info.configure(request_configuration)
113
+ request_info.headers.try_add("Accept", "application/json")
114
+ return request_info
115
+
116
+ def to_patch_request_information(self,body: TeamsPolicyUserAssignment, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
117
+ """
118
+ Update the navigation property userAssignments in admin
119
+ param body: The request body
120
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
121
+ Returns: RequestInformation
122
+ """
123
+ if body is None:
124
+ raise TypeError("body cannot be null.")
125
+ request_info = RequestInformation(Method.PATCH, self.url_template, self.path_parameters)
126
+ request_info.configure(request_configuration)
127
+ request_info.headers.try_add("Accept", "application/json")
128
+ request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
129
+ return request_info
130
+
131
+ def with_url(self,raw_url: str) -> TeamsPolicyUserAssignmentItemRequestBuilder:
132
+ """
133
+ Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
134
+ param raw_url: The raw URL to use for the request builder.
135
+ Returns: TeamsPolicyUserAssignmentItemRequestBuilder
136
+ """
137
+ if raw_url is None:
138
+ raise TypeError("raw_url cannot be null.")
139
+ return TeamsPolicyUserAssignmentItemRequestBuilder(self.request_adapter, raw_url)
140
+
141
+ @dataclass
142
+ class TeamsPolicyUserAssignmentItemRequestBuilderDeleteRequestConfiguration(RequestConfiguration[QueryParameters]):
143
+ """
144
+ Configuration for the request such as headers, query parameters, and middleware options.
145
+ """
146
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
147
+
148
+ @dataclass
149
+ class TeamsPolicyUserAssignmentItemRequestBuilderGetQueryParameters():
150
+ """
151
+ The collection of user policy assignments.
152
+ """
153
+ def get_query_parameter(self,original_name: str) -> str:
154
+ """
155
+ Maps the query parameters names to their encoded names for the URI template parsing.
156
+ param original_name: The original query parameter name in the class.
157
+ Returns: str
158
+ """
159
+ if original_name is None:
160
+ raise TypeError("original_name cannot be null.")
161
+ if original_name == "expand":
162
+ return "%24expand"
163
+ if original_name == "select":
164
+ return "%24select"
165
+ return original_name
166
+
167
+ # Expand related entities
168
+ expand: Optional[list[str]] = None
169
+
170
+ # Select properties to be returned
171
+ select: Optional[list[str]] = None
172
+
173
+
174
+ @dataclass
175
+ class TeamsPolicyUserAssignmentItemRequestBuilderGetRequestConfiguration(RequestConfiguration[TeamsPolicyUserAssignmentItemRequestBuilderGetQueryParameters]):
176
+ """
177
+ Configuration for the request such as headers, query parameters, and middleware options.
178
+ """
179
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
180
+
181
+ @dataclass
182
+ class TeamsPolicyUserAssignmentItemRequestBuilderPatchRequestConfiguration(RequestConfiguration[QueryParameters]):
183
+ """
184
+ Configuration for the request such as headers, query parameters, and middleware options.
185
+ """
186
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
187
+
188
+
@@ -0,0 +1,57 @@
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
+ if TYPE_CHECKING:
9
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
10
+
11
+ @dataclass
12
+ class AssignPostRequestBody(AdditionalDataHolder, BackedModel, Parsable):
13
+ # Stores model information.
14
+ backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)
15
+
16
+ # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
17
+ additional_data: dict[str, Any] = field(default_factory=dict)
18
+ # The value property
19
+ value: Optional[list[TeamsPolicyUserAssignment]] = None
20
+
21
+ @staticmethod
22
+ def create_from_discriminator_value(parse_node: ParseNode) -> AssignPostRequestBody:
23
+ """
24
+ Creates a new instance of the appropriate class based on discriminator value
25
+ param parse_node: The parse node to use to read the discriminator value and create the object
26
+ Returns: AssignPostRequestBody
27
+ """
28
+ if parse_node is None:
29
+ raise TypeError("parse_node cannot be null.")
30
+ return AssignPostRequestBody()
31
+
32
+ def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
33
+ """
34
+ The deserialization information for the current model
35
+ Returns: dict[str, Callable[[ParseNode], None]]
36
+ """
37
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
38
+
39
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
40
+
41
+ fields: dict[str, Callable[[Any], None]] = {
42
+ "value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(TeamsPolicyUserAssignment)),
43
+ }
44
+ return fields
45
+
46
+ def serialize(self,writer: SerializationWriter) -> None:
47
+ """
48
+ Serializes information the current object
49
+ param writer: Serialization writer to use to serialize this model
50
+ Returns: None
51
+ """
52
+ if writer is None:
53
+ raise TypeError("writer cannot be null.")
54
+ writer.write_collection_of_object_values("value", self.value)
55
+ writer.write_additional_data_value(self.additional_data)
56
+
57
+
@@ -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 .assign_post_request_body import AssignPostRequestBody
19
+
20
+ class MicrosoftGraphTeamsAdministrationAssignRequestBuilder(BaseRequestBuilder):
21
+ """
22
+ Provides operations to call the assign method.
23
+ """
24
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
25
+ """
26
+ Instantiates a new MicrosoftGraphTeamsAdministrationAssignRequestBuilder 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}/admin/teams/policy/userAssignments/microsoft.graph.teamsAdministration.assign", path_parameters)
32
+
33
+ async def post(self,body: AssignPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34
+ """
35
+ Assign a Teams policy to a user using the user ID, policy type, and policy ID.
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/teamsadministration-teamspolicyuserassignment-assign?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: AssignPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
56
+ """
57
+ Assign a Teams policy to a user using the user ID, policy type, and policy ID.
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) -> MicrosoftGraphTeamsAdministrationAssignRequestBuilder:
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: MicrosoftGraphTeamsAdministrationAssignRequestBuilder
75
+ """
76
+ if raw_url is None:
77
+ raise TypeError("raw_url cannot be null.")
78
+ return MicrosoftGraphTeamsAdministrationAssignRequestBuilder(self.request_adapter, raw_url)
79
+
80
+ @dataclass
81
+ class MicrosoftGraphTeamsAdministrationAssignRequestBuilderPostRequestConfiguration(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,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 .unassign_post_request_body import UnassignPostRequestBody
19
+
20
+ class MicrosoftGraphTeamsAdministrationUnassignRequestBuilder(BaseRequestBuilder):
21
+ """
22
+ Provides operations to call the unassign method.
23
+ """
24
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
25
+ """
26
+ Instantiates a new MicrosoftGraphTeamsAdministrationUnassignRequestBuilder 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}/admin/teams/policy/userAssignments/microsoft.graph.teamsAdministration.unassign", path_parameters)
32
+
33
+ async def post(self,body: UnassignPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34
+ """
35
+ Unassign a Teams policy from a user using the user ID and policy type.
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/teamsadministration-teamspolicyuserassignment-unassign?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: UnassignPostRequestBody, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
56
+ """
57
+ Unassign a Teams policy from a user using the user ID and policy type.
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) -> MicrosoftGraphTeamsAdministrationUnassignRequestBuilder:
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: MicrosoftGraphTeamsAdministrationUnassignRequestBuilder
75
+ """
76
+ if raw_url is None:
77
+ raise TypeError("raw_url cannot be null.")
78
+ return MicrosoftGraphTeamsAdministrationUnassignRequestBuilder(self.request_adapter, raw_url)
79
+
80
+ @dataclass
81
+ class MicrosoftGraphTeamsAdministrationUnassignRequestBuilderPostRequestConfiguration(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,0 +1,57 @@
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
+ if TYPE_CHECKING:
9
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
10
+
11
+ @dataclass
12
+ class UnassignPostRequestBody(AdditionalDataHolder, BackedModel, Parsable):
13
+ # Stores model information.
14
+ backing_store: BackingStore = field(default_factory=BackingStoreFactorySingleton(backing_store_factory=None).backing_store_factory.create_backing_store, repr=False)
15
+
16
+ # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
17
+ additional_data: dict[str, Any] = field(default_factory=dict)
18
+ # The value property
19
+ value: Optional[list[TeamsPolicyUserAssignment]] = None
20
+
21
+ @staticmethod
22
+ def create_from_discriminator_value(parse_node: ParseNode) -> UnassignPostRequestBody:
23
+ """
24
+ Creates a new instance of the appropriate class based on discriminator value
25
+ param parse_node: The parse node to use to read the discriminator value and create the object
26
+ Returns: UnassignPostRequestBody
27
+ """
28
+ if parse_node is None:
29
+ raise TypeError("parse_node cannot be null.")
30
+ return UnassignPostRequestBody()
31
+
32
+ def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
33
+ """
34
+ The deserialization information for the current model
35
+ Returns: dict[str, Callable[[ParseNode], None]]
36
+ """
37
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
38
+
39
+ from ......models.teams_administration.teams_policy_user_assignment import TeamsPolicyUserAssignment
40
+
41
+ fields: dict[str, Callable[[Any], None]] = {
42
+ "value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(TeamsPolicyUserAssignment)),
43
+ }
44
+ return fields
45
+
46
+ def serialize(self,writer: SerializationWriter) -> None:
47
+ """
48
+ Serializes information the current object
49
+ param writer: Serialization writer to use to serialize this model
50
+ Returns: None
51
+ """
52
+ if writer is None:
53
+ raise TypeError("writer cannot be null.")
54
+ writer.write_collection_of_object_values("value", self.value)
55
+ writer.write_additional_data_value(self.additional_data)
56
+
57
+