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
msgraph/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # The SDK version
2
2
  # x-release-please-start-version
3
- VERSION: str = '1.52.0'
3
+ VERSION: str = '1.54.0'
4
4
  # x-release-please-end
@@ -0,0 +1,58 @@
1
+ from __future__ import annotations
2
+ from collections.abc import Callable
3
+ from dataclasses import dataclass, field
4
+ from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
5
+ from typing import Any, Optional, TYPE_CHECKING, Union
6
+
7
+ if TYPE_CHECKING:
8
+ from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
9
+ from .....models.teams_administration.policy_identifier_detail import PolicyIdentifierDetail
10
+
11
+ from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
12
+
13
+ @dataclass
14
+ class GetPolicyIdWithTypeWithNameGetResponse(BaseCollectionPaginationCountResponse, Parsable):
15
+ # The value property
16
+ value: Optional[list[PolicyIdentifierDetail]] = None
17
+
18
+ @staticmethod
19
+ def create_from_discriminator_value(parse_node: ParseNode) -> GetPolicyIdWithTypeWithNameGetResponse:
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: GetPolicyIdWithTypeWithNameGetResponse
24
+ """
25
+ if parse_node is None:
26
+ raise TypeError("parse_node cannot be null.")
27
+ return GetPolicyIdWithTypeWithNameGetResponse()
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
+ from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
35
+ from .....models.teams_administration.policy_identifier_detail import PolicyIdentifierDetail
36
+
37
+ from .....models.base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
38
+ from .....models.teams_administration.policy_identifier_detail import PolicyIdentifierDetail
39
+
40
+ fields: dict[str, Callable[[Any], None]] = {
41
+ "value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(PolicyIdentifierDetail)),
42
+ }
43
+ super_fields = super().get_field_deserializers()
44
+ fields.update(super_fields)
45
+ return fields
46
+
47
+ def serialize(self,writer: SerializationWriter) -> None:
48
+ """
49
+ Serializes information the current object
50
+ param writer: Serialization writer to use to serialize this model
51
+ Returns: None
52
+ """
53
+ if writer is None:
54
+ raise TypeError("writer cannot be null.")
55
+ super().serialize(writer)
56
+ writer.write_collection_of_object_values("value", self.value)
57
+
58
+
@@ -0,0 +1,143 @@
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 .get_policy_id_with_type_with_name_get_response import GetPolicyIdWithTypeWithNameGetResponse
19
+
20
+ class MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder(BaseRequestBuilder):
21
+ """
22
+ Provides operations to call the getPolicyId method.
23
+ """
24
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]], name: Optional[str] = None, type: Optional[str] = None) -> None:
25
+ """
26
+ Instantiates a new MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder and sets the default values.
27
+ param name: Usage: name='{name}'
28
+ param path_parameters: The raw url or the url-template parameters for the request.
29
+ param request_adapter: The request adapter to use to execute the requests.
30
+ param type: Usage: type='{type}'
31
+ Returns: None
32
+ """
33
+ if isinstance(path_parameters, dict):
34
+ path_parameters['name'] = name
35
+ path_parameters['type'] = type
36
+ super().__init__(request_adapter, "{+baseurl}/admin/teams/policy/microsoft.graph.teamsAdministration.getPolicyId(type='{type}',name='{name}'){?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", path_parameters)
37
+
38
+ async def get(self,request_configuration: Optional[RequestConfiguration[MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilderGetQueryParameters]] = None) -> Optional[GetPolicyIdWithTypeWithNameGetResponse]:
39
+ """
40
+ Get the policy ID for a given policy name and policy type within Teams administration.
41
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
42
+ Returns: Optional[GetPolicyIdWithTypeWithNameGetResponse]
43
+ Find more info here: https://learn.microsoft.com/graph/api/teamsadministration-teamspolicyassignment-getpolicyid?view=graph-rest-1.0
44
+ """
45
+ request_info = self.to_get_request_information(
46
+ request_configuration
47
+ )
48
+ from .....models.o_data_errors.o_data_error import ODataError
49
+
50
+ error_mapping: dict[str, type[ParsableFactory]] = {
51
+ "XXX": ODataError,
52
+ }
53
+ if not self.request_adapter:
54
+ raise Exception("Http core is null")
55
+ from .get_policy_id_with_type_with_name_get_response import GetPolicyIdWithTypeWithNameGetResponse
56
+
57
+ return await self.request_adapter.send_async(request_info, GetPolicyIdWithTypeWithNameGetResponse, error_mapping)
58
+
59
+ def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
60
+ """
61
+ Get the policy ID for a given policy name and policy type within Teams administration.
62
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
63
+ Returns: RequestInformation
64
+ """
65
+ request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
66
+ request_info.configure(request_configuration)
67
+ request_info.headers.try_add("Accept", "application/json")
68
+ return request_info
69
+
70
+ def with_url(self,raw_url: str) -> MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder:
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: MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder
75
+ """
76
+ if raw_url is None:
77
+ raise TypeError("raw_url cannot be null.")
78
+ return MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder(self.request_adapter, raw_url)
79
+
80
+ @dataclass
81
+ class MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilderGetQueryParameters():
82
+ """
83
+ Get the policy ID for a given policy name and policy type within Teams administration.
84
+ """
85
+ def get_query_parameter(self,original_name: str) -> str:
86
+ """
87
+ Maps the query parameters names to their encoded names for the URI template parsing.
88
+ param original_name: The original query parameter name in the class.
89
+ Returns: str
90
+ """
91
+ if original_name is None:
92
+ raise TypeError("original_name cannot be null.")
93
+ if original_name == "count":
94
+ return "%24count"
95
+ if original_name == "expand":
96
+ return "%24expand"
97
+ if original_name == "filter":
98
+ return "%24filter"
99
+ if original_name == "orderby":
100
+ return "%24orderby"
101
+ if original_name == "search":
102
+ return "%24search"
103
+ if original_name == "select":
104
+ return "%24select"
105
+ if original_name == "skip":
106
+ return "%24skip"
107
+ if original_name == "top":
108
+ return "%24top"
109
+ return original_name
110
+
111
+ # Include count of items
112
+ count: Optional[bool] = None
113
+
114
+ # Expand related entities
115
+ expand: Optional[list[str]] = None
116
+
117
+ # Filter items by property values
118
+ filter: Optional[str] = None
119
+
120
+ # Order items by property values
121
+ orderby: Optional[list[str]] = None
122
+
123
+ # Search items by search phrases
124
+ search: Optional[str] = None
125
+
126
+ # Select properties to be returned
127
+ select: Optional[list[str]] = None
128
+
129
+ # Skip the first n items
130
+ skip: Optional[int] = None
131
+
132
+ # Show only the first n items
133
+ top: Optional[int] = None
134
+
135
+
136
+ @dataclass
137
+ class MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilderGetRequestConfiguration(RequestConfiguration[MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilderGetQueryParameters]):
138
+ """
139
+ Configuration for the request such as headers, query parameters, and middleware options.
140
+ """
141
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
142
+
143
+
@@ -0,0 +1,214 @@
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_assignment import TeamsPolicyAssignment
19
+ from .microsoft_graph_teams_administration_get_policy_id_with_type_with_name.microsoft_graph_teams_administration_get_policy_id_with_type_with_name_request_builder import MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder
20
+ from .user_assignments.user_assignments_request_builder import UserAssignmentsRequestBuilder
21
+
22
+ class PolicyRequestBuilder(BaseRequestBuilder):
23
+ """
24
+ Provides operations to manage the policy property of the microsoft.graph.teamsAdministration.teamsAdminRoot entity.
25
+ """
26
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
27
+ """
28
+ Instantiates a new PolicyRequestBuilder and sets the default values.
29
+ param path_parameters: The raw url or the url-template parameters for the request.
30
+ param request_adapter: The request adapter to use to execute the requests.
31
+ Returns: None
32
+ """
33
+ super().__init__(request_adapter, "{+baseurl}/admin/teams/policy{?%24expand,%24select}", path_parameters)
34
+
35
+ async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
36
+ """
37
+ Delete navigation property policy for admin
38
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
39
+ Returns: None
40
+ """
41
+ request_info = self.to_delete_request_information(
42
+ request_configuration
43
+ )
44
+ from ....models.o_data_errors.o_data_error import ODataError
45
+
46
+ error_mapping: dict[str, type[ParsableFactory]] = {
47
+ "XXX": ODataError,
48
+ }
49
+ if not self.request_adapter:
50
+ raise Exception("Http core is null")
51
+ return await self.request_adapter.send_no_response_content_async(request_info, error_mapping)
52
+
53
+ async def get(self,request_configuration: Optional[RequestConfiguration[PolicyRequestBuilderGetQueryParameters]] = None) -> Optional[TeamsPolicyAssignment]:
54
+ """
55
+ Represents a navigation property to the Teams policy assignment object.
56
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
57
+ Returns: Optional[TeamsPolicyAssignment]
58
+ """
59
+ request_info = self.to_get_request_information(
60
+ request_configuration
61
+ )
62
+ from ....models.o_data_errors.o_data_error import ODataError
63
+
64
+ error_mapping: dict[str, type[ParsableFactory]] = {
65
+ "XXX": ODataError,
66
+ }
67
+ if not self.request_adapter:
68
+ raise Exception("Http core is null")
69
+ from ....models.teams_administration.teams_policy_assignment import TeamsPolicyAssignment
70
+
71
+ return await self.request_adapter.send_async(request_info, TeamsPolicyAssignment, error_mapping)
72
+
73
+ def microsoft_graph_teams_administration_get_policy_id_with_type_with_name(self,name: str, type: str) -> MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder:
74
+ """
75
+ Provides operations to call the getPolicyId method.
76
+ param name: Usage: name='{name}'
77
+ param type: Usage: type='{type}'
78
+ Returns: MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder
79
+ """
80
+ if name is None:
81
+ raise TypeError("name cannot be null.")
82
+ if type is None:
83
+ raise TypeError("type cannot be null.")
84
+ from .microsoft_graph_teams_administration_get_policy_id_with_type_with_name.microsoft_graph_teams_administration_get_policy_id_with_type_with_name_request_builder import MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder
85
+
86
+ return MicrosoftGraphTeamsAdministrationGetPolicyIdWithTypeWithNameRequestBuilder(self.request_adapter, self.path_parameters, name, type)
87
+
88
+ async def patch(self,body: TeamsPolicyAssignment, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[TeamsPolicyAssignment]:
89
+ """
90
+ Update the navigation property policy in admin
91
+ param body: The request body
92
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
93
+ Returns: Optional[TeamsPolicyAssignment]
94
+ """
95
+ if body is None:
96
+ raise TypeError("body cannot be null.")
97
+ request_info = self.to_patch_request_information(
98
+ body, request_configuration
99
+ )
100
+ from ....models.o_data_errors.o_data_error import ODataError
101
+
102
+ error_mapping: dict[str, type[ParsableFactory]] = {
103
+ "XXX": ODataError,
104
+ }
105
+ if not self.request_adapter:
106
+ raise Exception("Http core is null")
107
+ from ....models.teams_administration.teams_policy_assignment import TeamsPolicyAssignment
108
+
109
+ return await self.request_adapter.send_async(request_info, TeamsPolicyAssignment, error_mapping)
110
+
111
+ def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
112
+ """
113
+ Delete navigation property policy for admin
114
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
115
+ Returns: RequestInformation
116
+ """
117
+ request_info = RequestInformation(Method.DELETE, self.url_template, self.path_parameters)
118
+ request_info.configure(request_configuration)
119
+ request_info.headers.try_add("Accept", "application/json")
120
+ return request_info
121
+
122
+ def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[PolicyRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
123
+ """
124
+ Represents a navigation property to the Teams policy assignment object.
125
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
126
+ Returns: RequestInformation
127
+ """
128
+ request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
129
+ request_info.configure(request_configuration)
130
+ request_info.headers.try_add("Accept", "application/json")
131
+ return request_info
132
+
133
+ def to_patch_request_information(self,body: TeamsPolicyAssignment, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
134
+ """
135
+ Update the navigation property policy in admin
136
+ param body: The request body
137
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
138
+ Returns: RequestInformation
139
+ """
140
+ if body is None:
141
+ raise TypeError("body cannot be null.")
142
+ request_info = RequestInformation(Method.PATCH, self.url_template, self.path_parameters)
143
+ request_info.configure(request_configuration)
144
+ request_info.headers.try_add("Accept", "application/json")
145
+ request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
146
+ return request_info
147
+
148
+ def with_url(self,raw_url: str) -> PolicyRequestBuilder:
149
+ """
150
+ Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
151
+ param raw_url: The raw URL to use for the request builder.
152
+ Returns: PolicyRequestBuilder
153
+ """
154
+ if raw_url is None:
155
+ raise TypeError("raw_url cannot be null.")
156
+ return PolicyRequestBuilder(self.request_adapter, raw_url)
157
+
158
+ @property
159
+ def user_assignments(self) -> UserAssignmentsRequestBuilder:
160
+ """
161
+ Provides operations to manage the userAssignments property of the microsoft.graph.teamsAdministration.teamsPolicyAssignment entity.
162
+ """
163
+ from .user_assignments.user_assignments_request_builder import UserAssignmentsRequestBuilder
164
+
165
+ return UserAssignmentsRequestBuilder(self.request_adapter, self.path_parameters)
166
+
167
+ @dataclass
168
+ class PolicyRequestBuilderDeleteRequestConfiguration(RequestConfiguration[QueryParameters]):
169
+ """
170
+ Configuration for the request such as headers, query parameters, and middleware options.
171
+ """
172
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
173
+
174
+ @dataclass
175
+ class PolicyRequestBuilderGetQueryParameters():
176
+ """
177
+ Represents a navigation property to the Teams policy assignment object.
178
+ """
179
+ def get_query_parameter(self,original_name: str) -> str:
180
+ """
181
+ Maps the query parameters names to their encoded names for the URI template parsing.
182
+ param original_name: The original query parameter name in the class.
183
+ Returns: str
184
+ """
185
+ if original_name is None:
186
+ raise TypeError("original_name cannot be null.")
187
+ if original_name == "expand":
188
+ return "%24expand"
189
+ if original_name == "select":
190
+ return "%24select"
191
+ return original_name
192
+
193
+ # Expand related entities
194
+ expand: Optional[list[str]] = None
195
+
196
+ # Select properties to be returned
197
+ select: Optional[list[str]] = None
198
+
199
+
200
+ @dataclass
201
+ class PolicyRequestBuilderGetRequestConfiguration(RequestConfiguration[PolicyRequestBuilderGetQueryParameters]):
202
+ """
203
+ Configuration for the request such as headers, query parameters, and middleware options.
204
+ """
205
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
206
+
207
+ @dataclass
208
+ class PolicyRequestBuilderPatchRequestConfiguration(RequestConfiguration[QueryParameters]):
209
+ """
210
+ Configuration for the request such as headers, query parameters, and middleware options.
211
+ """
212
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
213
+
214
+
@@ -0,0 +1,104 @@
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
+
19
+ class CountRequestBuilder(BaseRequestBuilder):
20
+ """
21
+ Provides operations to count the resources in the collection.
22
+ """
23
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
24
+ """
25
+ Instantiates a new CountRequestBuilder and sets the default values.
26
+ param path_parameters: The raw url or the url-template parameters for the request.
27
+ param request_adapter: The request adapter to use to execute the requests.
28
+ Returns: None
29
+ """
30
+ super().__init__(request_adapter, "{+baseurl}/admin/teams/policy/userAssignments/$count{?%24filter,%24search}", path_parameters)
31
+
32
+ async def get(self,request_configuration: Optional[RequestConfiguration[CountRequestBuilderGetQueryParameters]] = None) -> Optional[int]:
33
+ """
34
+ Get the number of the resource
35
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
36
+ Returns: Optional[int]
37
+ """
38
+ request_info = self.to_get_request_information(
39
+ request_configuration
40
+ )
41
+ from ......models.o_data_errors.o_data_error import ODataError
42
+
43
+ error_mapping: dict[str, type[ParsableFactory]] = {
44
+ "XXX": ODataError,
45
+ }
46
+ if not self.request_adapter:
47
+ raise Exception("Http core is null")
48
+ return await self.request_adapter.send_primitive_async(request_info, "int", error_mapping)
49
+
50
+ def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[CountRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
51
+ """
52
+ Get the number of the resource
53
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
54
+ Returns: RequestInformation
55
+ """
56
+ request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
57
+ request_info.configure(request_configuration)
58
+ request_info.headers.try_add("Accept", "text/plain;q=0.9")
59
+ return request_info
60
+
61
+ def with_url(self,raw_url: str) -> CountRequestBuilder:
62
+ """
63
+ Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
64
+ param raw_url: The raw URL to use for the request builder.
65
+ Returns: CountRequestBuilder
66
+ """
67
+ if raw_url is None:
68
+ raise TypeError("raw_url cannot be null.")
69
+ return CountRequestBuilder(self.request_adapter, raw_url)
70
+
71
+ @dataclass
72
+ class CountRequestBuilderGetQueryParameters():
73
+ """
74
+ Get the number of the resource
75
+ """
76
+ def get_query_parameter(self,original_name: str) -> str:
77
+ """
78
+ Maps the query parameters names to their encoded names for the URI template parsing.
79
+ param original_name: The original query parameter name in the class.
80
+ Returns: str
81
+ """
82
+ if original_name is None:
83
+ raise TypeError("original_name cannot be null.")
84
+ if original_name == "filter":
85
+ return "%24filter"
86
+ if original_name == "search":
87
+ return "%24search"
88
+ return original_name
89
+
90
+ # Filter items by property values
91
+ filter: Optional[str] = None
92
+
93
+ # Search items by search phrases
94
+ search: Optional[str] = None
95
+
96
+
97
+ @dataclass
98
+ class CountRequestBuilderGetRequestConfiguration(RequestConfiguration[CountRequestBuilderGetQueryParameters]):
99
+ """
100
+ Configuration for the request such as headers, query parameters, and middleware options.
101
+ """
102
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
103
+
104
+