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,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 ..base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
9
+ from .teams_policy_user_assignment import TeamsPolicyUserAssignment
10
+
11
+ from ..base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
12
+
13
+ @dataclass
14
+ class TeamsPolicyUserAssignmentCollectionResponse(BaseCollectionPaginationCountResponse, Parsable):
15
+ # The value property
16
+ value: Optional[list[TeamsPolicyUserAssignment]] = None
17
+
18
+ @staticmethod
19
+ def create_from_discriminator_value(parse_node: ParseNode) -> TeamsPolicyUserAssignmentCollectionResponse:
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: TeamsPolicyUserAssignmentCollectionResponse
24
+ """
25
+ if parse_node is None:
26
+ raise TypeError("parse_node cannot be null.")
27
+ return TeamsPolicyUserAssignmentCollectionResponse()
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 ..base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
35
+ from .teams_policy_user_assignment import TeamsPolicyUserAssignment
36
+
37
+ from ..base_collection_pagination_count_response import BaseCollectionPaginationCountResponse
38
+ from .teams_policy_user_assignment import TeamsPolicyUserAssignment
39
+
40
+ fields: dict[str, Callable[[Any], None]] = {
41
+ "value": lambda n : setattr(self, 'value', n.get_collection_of_object_values(TeamsPolicyUserAssignment)),
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
+
@@ -14,8 +14,6 @@ from .authentication_method import AuthenticationMethod
14
14
  class TemporaryAccessPassAuthenticationMethod(AuthenticationMethod, Parsable):
15
15
  # The OdataType property
16
16
  odata_type: Optional[str] = "#microsoft.graph.temporaryAccessPassAuthenticationMethod"
17
- # The date and time when the Temporary Access Pass was created.
18
- created_date_time: Optional[datetime.datetime] = None
19
17
  # The state of the authentication method that indicates whether it's currently usable by the user.
20
18
  is_usable: Optional[bool] = None
21
19
  # Determines whether the pass is limited to a one-time use. If true, the pass can be used once; if false, the pass can be used multiple times within the Temporary Access Pass lifetime.
@@ -50,7 +48,6 @@ class TemporaryAccessPassAuthenticationMethod(AuthenticationMethod, Parsable):
50
48
  from .authentication_method import AuthenticationMethod
51
49
 
52
50
  fields: dict[str, Callable[[Any], None]] = {
53
- "createdDateTime": lambda n : setattr(self, 'created_date_time', n.get_datetime_value()),
54
51
  "isUsable": lambda n : setattr(self, 'is_usable', n.get_bool_value()),
55
52
  "isUsableOnce": lambda n : setattr(self, 'is_usable_once', n.get_bool_value()),
56
53
  "lifetimeInMinutes": lambda n : setattr(self, 'lifetime_in_minutes', n.get_int_value()),
@@ -71,7 +68,6 @@ class TemporaryAccessPassAuthenticationMethod(AuthenticationMethod, Parsable):
71
68
  if writer is None:
72
69
  raise TypeError("writer cannot be null.")
73
70
  super().serialize(writer)
74
- writer.write_datetime_value("createdDateTime", self.created_date_time)
75
71
  writer.write_bool_value("isUsable", self.is_usable)
76
72
  writer.write_bool_value("isUsableOnce", self.is_usable_once)
77
73
  writer.write_int_value("lifetimeInMinutes", self.lifetime_in_minutes)
@@ -21,5 +21,6 @@ class UsageRights(str, Enum):
21
21
  EncryptedProtectionTypeNotSupportedException = "encryptedProtectionTypeNotSupportedException",
22
22
  PurviewClaimsChallengeNotSupportedException = "purviewClaimsChallengeNotSupportedException",
23
23
  Exception = "exception",
24
+ LabelNotFoundException = "labelNotFoundException",
24
25
  UnknownFutureValue = "unknownFutureValue",
25
26
 
@@ -1,5 +1,4 @@
1
1
  from __future__ import annotations
2
- import datetime
3
2
  from collections.abc import Callable
4
3
  from dataclasses import dataclass, field
5
4
  from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
@@ -16,8 +15,6 @@ from .authentication_method import AuthenticationMethod
16
15
  class WindowsHelloForBusinessAuthenticationMethod(AuthenticationMethod, Parsable):
17
16
  # The OdataType property
18
17
  odata_type: Optional[str] = "#microsoft.graph.windowsHelloForBusinessAuthenticationMethod"
19
- # The date and time that this Windows Hello for Business key was registered.
20
- created_date_time: Optional[datetime.datetime] = None
21
18
  # The registered device on which this Windows Hello for Business key resides. Supports $expand. When you get a user's Windows Hello for Business registration information, this property is returned only on a single GET and when you specify ?$expand. For example, GET /users/admin@contoso.com/authentication/windowsHelloForBusinessMethods/_jpuR-TGZtk6aQCLF3BQjA2?$expand=device.
22
19
  device: Optional[Device] = None
23
20
  # The name of the device on which Windows Hello for Business is registered
@@ -50,7 +47,6 @@ class WindowsHelloForBusinessAuthenticationMethod(AuthenticationMethod, Parsable
50
47
  from .device import Device
51
48
 
52
49
  fields: dict[str, Callable[[Any], None]] = {
53
- "createdDateTime": lambda n : setattr(self, 'created_date_time', n.get_datetime_value()),
54
50
  "device": lambda n : setattr(self, 'device', n.get_object_value(Device)),
55
51
  "displayName": lambda n : setattr(self, 'display_name', n.get_str_value()),
56
52
  "keyStrength": lambda n : setattr(self, 'key_strength', n.get_enum_value(AuthenticationMethodKeyStrength)),
@@ -68,7 +64,6 @@ class WindowsHelloForBusinessAuthenticationMethod(AuthenticationMethod, Parsable
68
64
  if writer is None:
69
65
  raise TypeError("writer cannot be null.")
70
66
  super().serialize(writer)
71
- writer.write_datetime_value("createdDateTime", self.created_date_time)
72
67
  writer.write_object_value("device", self.device)
73
68
  writer.write_str_value("displayName", self.display_name)
74
69
  writer.write_enum_value("keyStrength", self.key_strength)
@@ -49,7 +49,7 @@ class AuthenticationMethodConfigurationsRequestBuilder(BaseRequestBuilder):
49
49
 
50
50
  async def get(self,request_configuration: Optional[RequestConfiguration[AuthenticationMethodConfigurationsRequestBuilderGetQueryParameters]] = None) -> Optional[AuthenticationMethodConfigurationCollectionResponse]:
51
51
  """
52
- Represents the settings for each authentication method. Automatically expanded on GET /policies/authenticationMethodsPolicy.
52
+ Read the properties and relationships of an externalAuthenticationMethodConfiguration object.
53
53
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
54
54
  Returns: Optional[AuthenticationMethodConfigurationCollectionResponse]
55
55
  """
@@ -92,7 +92,7 @@ class AuthenticationMethodConfigurationsRequestBuilder(BaseRequestBuilder):
92
92
 
93
93
  def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[AuthenticationMethodConfigurationsRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
94
94
  """
95
- Represents the settings for each authentication method. Automatically expanded on GET /policies/authenticationMethodsPolicy.
95
+ Read the properties and relationships of an externalAuthenticationMethodConfiguration object.
96
96
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
97
97
  Returns: RequestInformation
98
98
  """
@@ -138,7 +138,7 @@ class AuthenticationMethodConfigurationsRequestBuilder(BaseRequestBuilder):
138
138
  @dataclass
139
139
  class AuthenticationMethodConfigurationsRequestBuilderGetQueryParameters():
140
140
  """
141
- Represents the settings for each authentication method. Automatically expanded on GET /policies/authenticationMethodsPolicy.
141
+ Read the properties and relationships of an externalAuthenticationMethodConfiguration object.
142
142
  """
143
143
  def get_query_parameter(self,original_name: str) -> str:
144
144
  """
@@ -32,9 +32,10 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
32
32
 
33
33
  async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34
34
  """
35
- Delete navigation property authenticationMethodConfigurations for policies
35
+ Delete an externalAuthenticationMethodConfiguration object.
36
36
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
37
37
  Returns: None
38
+ Find more info here: https://learn.microsoft.com/graph/api/externalauthenticationmethodconfiguration-delete?view=graph-rest-1.0
38
39
  """
39
40
  request_info = self.to_delete_request_information(
40
41
  request_configuration
@@ -50,9 +51,10 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
50
51
 
51
52
  async def get(self,request_configuration: Optional[RequestConfiguration[AuthenticationMethodConfigurationItemRequestBuilderGetQueryParameters]] = None) -> Optional[AuthenticationMethodConfiguration]:
52
53
  """
53
- Represents the settings for each authentication method. Automatically expanded on GET /policies/authenticationMethodsPolicy.
54
+ Read the properties and relationships of an externalAuthenticationMethodConfiguration object.
54
55
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
55
56
  Returns: Optional[AuthenticationMethodConfiguration]
57
+ Find more info here: https://learn.microsoft.com/graph/api/externalauthenticationmethodconfiguration-get?view=graph-rest-1.0
56
58
  """
57
59
  request_info = self.to_get_request_information(
58
60
  request_configuration
@@ -70,10 +72,11 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
70
72
 
71
73
  async def patch(self,body: AuthenticationMethodConfiguration, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[AuthenticationMethodConfiguration]:
72
74
  """
73
- Update the navigation property authenticationMethodConfigurations in policies
75
+ Update the properties of an externalAuthenticationMethodConfiguration object.
74
76
  param body: The request body
75
77
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
76
78
  Returns: Optional[AuthenticationMethodConfiguration]
79
+ Find more info here: https://learn.microsoft.com/graph/api/externalauthenticationmethodconfiguration-update?view=graph-rest-1.0
77
80
  """
78
81
  if body is None:
79
82
  raise TypeError("body cannot be null.")
@@ -93,7 +96,7 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
93
96
 
94
97
  def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
95
98
  """
96
- Delete navigation property authenticationMethodConfigurations for policies
99
+ Delete an externalAuthenticationMethodConfiguration object.
97
100
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
98
101
  Returns: RequestInformation
99
102
  """
@@ -104,7 +107,7 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
104
107
 
105
108
  def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[AuthenticationMethodConfigurationItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
106
109
  """
107
- Represents the settings for each authentication method. Automatically expanded on GET /policies/authenticationMethodsPolicy.
110
+ Read the properties and relationships of an externalAuthenticationMethodConfiguration object.
108
111
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
109
112
  Returns: RequestInformation
110
113
  """
@@ -115,7 +118,7 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
115
118
 
116
119
  def to_patch_request_information(self,body: AuthenticationMethodConfiguration, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
117
120
  """
118
- Update the navigation property authenticationMethodConfigurations in policies
121
+ Update the properties of an externalAuthenticationMethodConfiguration object.
119
122
  param body: The request body
120
123
  param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
121
124
  Returns: RequestInformation
@@ -148,7 +151,7 @@ class AuthenticationMethodConfigurationItemRequestBuilder(BaseRequestBuilder):
148
151
  @dataclass
149
152
  class AuthenticationMethodConfigurationItemRequestBuilderGetQueryParameters():
150
153
  """
151
- Represents the settings for each authentication method. Automatically expanded on GET /policies/authenticationMethodsPolicy.
154
+ Read the properties and relationships of an externalAuthenticationMethodConfiguration object.
152
155
  """
153
156
  def get_query_parameter(self,original_name: str) -> str:
154
157
  """
@@ -17,6 +17,7 @@ if TYPE_CHECKING:
17
17
  from ....models.authentication import Authentication
18
18
  from ....models.o_data_errors.o_data_error import ODataError
19
19
  from .email_methods.email_methods_request_builder import EmailMethodsRequestBuilder
20
+ from .external_authentication_methods.external_authentication_methods_request_builder import ExternalAuthenticationMethodsRequestBuilder
20
21
  from .fido2_methods.fido2_methods_request_builder import Fido2MethodsRequestBuilder
21
22
  from .methods.methods_request_builder import MethodsRequestBuilder
22
23
  from .microsoft_authenticator_methods.microsoft_authenticator_methods_request_builder import MicrosoftAuthenticatorMethodsRequestBuilder
@@ -158,6 +159,15 @@ class AuthenticationRequestBuilder(BaseRequestBuilder):
158
159
 
159
160
  return EmailMethodsRequestBuilder(self.request_adapter, self.path_parameters)
160
161
 
162
+ @property
163
+ def external_authentication_methods(self) -> ExternalAuthenticationMethodsRequestBuilder:
164
+ """
165
+ Provides operations to manage the externalAuthenticationMethods property of the microsoft.graph.authentication entity.
166
+ """
167
+ from .external_authentication_methods.external_authentication_methods_request_builder import ExternalAuthenticationMethodsRequestBuilder
168
+
169
+ return ExternalAuthenticationMethodsRequestBuilder(self.request_adapter, self.path_parameters)
170
+
161
171
  @property
162
172
  def fido2_methods(self) -> Fido2MethodsRequestBuilder:
163
173
  """
@@ -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}/users/{user%2Did}/authentication/externalAuthenticationMethods/$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
+
@@ -0,0 +1,209 @@
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.external_authentication_method import ExternalAuthenticationMethod
18
+ from .....models.external_authentication_method_collection_response import ExternalAuthenticationMethodCollectionResponse
19
+ from .....models.o_data_errors.o_data_error import ODataError
20
+ from .count.count_request_builder import CountRequestBuilder
21
+ from .item.external_authentication_method_item_request_builder import ExternalAuthenticationMethodItemRequestBuilder
22
+
23
+ class ExternalAuthenticationMethodsRequestBuilder(BaseRequestBuilder):
24
+ """
25
+ Provides operations to manage the externalAuthenticationMethods property of the microsoft.graph.authentication entity.
26
+ """
27
+ def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
28
+ """
29
+ Instantiates a new ExternalAuthenticationMethodsRequestBuilder and sets the default values.
30
+ param path_parameters: The raw url or the url-template parameters for the request.
31
+ param request_adapter: The request adapter to use to execute the requests.
32
+ Returns: None
33
+ """
34
+ super().__init__(request_adapter, "{+baseurl}/users/{user%2Did}/authentication/externalAuthenticationMethods{?%24count,%24expand,%24filter,%24orderby,%24search,%24select,%24skip,%24top}", path_parameters)
35
+
36
+ def by_external_authentication_method_id(self,external_authentication_method_id: str) -> ExternalAuthenticationMethodItemRequestBuilder:
37
+ """
38
+ Provides operations to manage the externalAuthenticationMethods property of the microsoft.graph.authentication entity.
39
+ param external_authentication_method_id: The unique identifier of externalAuthenticationMethod
40
+ Returns: ExternalAuthenticationMethodItemRequestBuilder
41
+ """
42
+ if external_authentication_method_id is None:
43
+ raise TypeError("external_authentication_method_id cannot be null.")
44
+ from .item.external_authentication_method_item_request_builder import ExternalAuthenticationMethodItemRequestBuilder
45
+
46
+ url_tpl_params = get_path_parameters(self.path_parameters)
47
+ url_tpl_params["externalAuthenticationMethod%2Did"] = external_authentication_method_id
48
+ return ExternalAuthenticationMethodItemRequestBuilder(self.request_adapter, url_tpl_params)
49
+
50
+ async def get(self,request_configuration: Optional[RequestConfiguration[ExternalAuthenticationMethodsRequestBuilderGetQueryParameters]] = None) -> Optional[ExternalAuthenticationMethodCollectionResponse]:
51
+ """
52
+ Represents the external authentication methods registered to a user for authentication using an external identity provider.
53
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
54
+ Returns: Optional[ExternalAuthenticationMethodCollectionResponse]
55
+ """
56
+ request_info = self.to_get_request_information(
57
+ request_configuration
58
+ )
59
+ from .....models.o_data_errors.o_data_error import ODataError
60
+
61
+ error_mapping: dict[str, type[ParsableFactory]] = {
62
+ "XXX": ODataError,
63
+ }
64
+ if not self.request_adapter:
65
+ raise Exception("Http core is null")
66
+ from .....models.external_authentication_method_collection_response import ExternalAuthenticationMethodCollectionResponse
67
+
68
+ return await self.request_adapter.send_async(request_info, ExternalAuthenticationMethodCollectionResponse, error_mapping)
69
+
70
+ async def post(self,body: ExternalAuthenticationMethod, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[ExternalAuthenticationMethod]:
71
+ """
72
+ Create a new externalAuthenticationMethod object. This API doesn't support self-service operations.
73
+ param body: The request body
74
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
75
+ Returns: Optional[ExternalAuthenticationMethod]
76
+ Find more info here: https://learn.microsoft.com/graph/api/authentication-post-externalauthenticationmethods?view=graph-rest-1.0
77
+ """
78
+ if body is None:
79
+ raise TypeError("body cannot be null.")
80
+ request_info = self.to_post_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.external_authentication_method import ExternalAuthenticationMethod
91
+
92
+ return await self.request_adapter.send_async(request_info, ExternalAuthenticationMethod, error_mapping)
93
+
94
+ def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ExternalAuthenticationMethodsRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
95
+ """
96
+ Represents the external authentication methods registered to a user for authentication using an external identity provider.
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.GET, 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_post_request_information(self,body: ExternalAuthenticationMethod, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
106
+ """
107
+ Create a new externalAuthenticationMethod object. This API doesn't support self-service operations.
108
+ param body: The request body
109
+ param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
110
+ Returns: RequestInformation
111
+ """
112
+ if body is None:
113
+ raise TypeError("body cannot be null.")
114
+ request_info = RequestInformation(Method.POST, self.url_template, self.path_parameters)
115
+ request_info.configure(request_configuration)
116
+ request_info.headers.try_add("Accept", "application/json")
117
+ request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
118
+ return request_info
119
+
120
+ def with_url(self,raw_url: str) -> ExternalAuthenticationMethodsRequestBuilder:
121
+ """
122
+ Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
123
+ param raw_url: The raw URL to use for the request builder.
124
+ Returns: ExternalAuthenticationMethodsRequestBuilder
125
+ """
126
+ if raw_url is None:
127
+ raise TypeError("raw_url cannot be null.")
128
+ return ExternalAuthenticationMethodsRequestBuilder(self.request_adapter, raw_url)
129
+
130
+ @property
131
+ def count(self) -> CountRequestBuilder:
132
+ """
133
+ Provides operations to count the resources in the collection.
134
+ """
135
+ from .count.count_request_builder import CountRequestBuilder
136
+
137
+ return CountRequestBuilder(self.request_adapter, self.path_parameters)
138
+
139
+ @dataclass
140
+ class ExternalAuthenticationMethodsRequestBuilderGetQueryParameters():
141
+ """
142
+ Represents the external authentication methods registered to a user for authentication using an external identity provider.
143
+ """
144
+ def get_query_parameter(self,original_name: str) -> str:
145
+ """
146
+ Maps the query parameters names to their encoded names for the URI template parsing.
147
+ param original_name: The original query parameter name in the class.
148
+ Returns: str
149
+ """
150
+ if original_name is None:
151
+ raise TypeError("original_name cannot be null.")
152
+ if original_name == "count":
153
+ return "%24count"
154
+ if original_name == "expand":
155
+ return "%24expand"
156
+ if original_name == "filter":
157
+ return "%24filter"
158
+ if original_name == "orderby":
159
+ return "%24orderby"
160
+ if original_name == "search":
161
+ return "%24search"
162
+ if original_name == "select":
163
+ return "%24select"
164
+ if original_name == "skip":
165
+ return "%24skip"
166
+ if original_name == "top":
167
+ return "%24top"
168
+ return original_name
169
+
170
+ # Include count of items
171
+ count: Optional[bool] = None
172
+
173
+ # Expand related entities
174
+ expand: Optional[list[str]] = None
175
+
176
+ # Filter items by property values
177
+ filter: Optional[str] = None
178
+
179
+ # Order items by property values
180
+ orderby: Optional[list[str]] = None
181
+
182
+ # Search items by search phrases
183
+ search: Optional[str] = None
184
+
185
+ # Select properties to be returned
186
+ select: Optional[list[str]] = None
187
+
188
+ # Skip the first n items
189
+ skip: Optional[int] = None
190
+
191
+ # Show only the first n items
192
+ top: Optional[int] = None
193
+
194
+
195
+ @dataclass
196
+ class ExternalAuthenticationMethodsRequestBuilderGetRequestConfiguration(RequestConfiguration[ExternalAuthenticationMethodsRequestBuilderGetQueryParameters]):
197
+ """
198
+ Configuration for the request such as headers, query parameters, and middleware options.
199
+ """
200
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
201
+
202
+ @dataclass
203
+ class ExternalAuthenticationMethodsRequestBuilderPostRequestConfiguration(RequestConfiguration[QueryParameters]):
204
+ """
205
+ Configuration for the request such as headers, query parameters, and middleware options.
206
+ """
207
+ warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
208
+
209
+