Skip to content

Commit 2caba82

Browse files
Microsoft Graph DevX ToolingMicrosoft Graph DevX Tooling
authored andcommitted
feat(generation): update request builders and models
Update generated files with build 213120
1 parent 873a3a4 commit 2caba82

File tree

226 files changed

+11884
-277
lines changed

Some content is hidden

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

226 files changed

+11884
-277
lines changed

msgraph/generated/admin/people/people_request_builder.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from ...models.people_admin_settings import PeopleAdminSettings
1919
from .item_insights.item_insights_request_builder import ItemInsightsRequestBuilder
2020
from .profile_card_properties.profile_card_properties_request_builder import ProfileCardPropertiesRequestBuilder
21+
from .profile_sources.profile_sources_request_builder import ProfileSourcesRequestBuilder
22+
from .profile_sources_with_source_id.profile_sources_with_source_id_request_builder import ProfileSourcesWithSourceIdRequestBuilder
2123
from .pronouns.pronouns_request_builder import PronounsRequestBuilder
2224

2325
class PeopleRequestBuilder(BaseRequestBuilder):
@@ -54,6 +56,18 @@ async def get(self,request_configuration: Optional[RequestConfiguration[PeopleRe
5456

5557
return await self.request_adapter.send_async(request_info, PeopleAdminSettings, error_mapping)
5658

59+
def profile_sources_with_source_id(self,source_id: str) -> ProfileSourcesWithSourceIdRequestBuilder:
60+
"""
61+
Provides operations to manage the profileSources property of the microsoft.graph.peopleAdminSettings entity.
62+
param source_id: Alternate key of profileSource
63+
Returns: ProfileSourcesWithSourceIdRequestBuilder
64+
"""
65+
if source_id is None:
66+
raise TypeError("source_id cannot be null.")
67+
from .profile_sources_with_source_id.profile_sources_with_source_id_request_builder import ProfileSourcesWithSourceIdRequestBuilder
68+
69+
return ProfileSourcesWithSourceIdRequestBuilder(self.request_adapter, self.path_parameters, source_id)
70+
5771
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[PeopleRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
5872
"""
5973
Retrieve the properties and relationships of a peopleAdminSettings object.
@@ -93,6 +107,15 @@ def profile_card_properties(self) -> ProfileCardPropertiesRequestBuilder:
93107

94108
return ProfileCardPropertiesRequestBuilder(self.request_adapter, self.path_parameters)
95109

110+
@property
111+
def profile_sources(self) -> ProfileSourcesRequestBuilder:
112+
"""
113+
Provides operations to manage the profileSources property of the microsoft.graph.peopleAdminSettings entity.
114+
"""
115+
from .profile_sources.profile_sources_request_builder import ProfileSourcesRequestBuilder
116+
117+
return ProfileSourcesRequestBuilder(self.request_adapter, self.path_parameters)
118+
96119
@property
97120
def pronouns(self) -> PronounsRequestBuilder:
98121
"""
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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/people/profileSources/$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+
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
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.profile_source import ProfileSource
19+
20+
class ProfileSourceItemRequestBuilder(BaseRequestBuilder):
21+
"""
22+
Provides operations to manage the profileSources property of the microsoft.graph.peopleAdminSettings entity.
23+
"""
24+
def __init__(self,request_adapter: RequestAdapter, path_parameters: Union[str, dict[str, Any]]) -> None:
25+
"""
26+
Instantiates a new ProfileSourceItemRequestBuilder 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/people/profileSources/{profileSource%2Did}{?%24expand,%24select}", path_parameters)
32+
33+
async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34+
"""
35+
Delete a profileSource object.
36+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
37+
Returns: None
38+
Find more info here: https://learn.microsoft.com/graph/api/profilesource-delete?view=graph-rest-1.0
39+
"""
40+
request_info = self.to_delete_request_information(
41+
request_configuration
42+
)
43+
from .....models.o_data_errors.o_data_error import ODataError
44+
45+
error_mapping: dict[str, type[ParsableFactory]] = {
46+
"XXX": ODataError,
47+
}
48+
if not self.request_adapter:
49+
raise Exception("Http core is null")
50+
return await self.request_adapter.send_no_response_content_async(request_info, error_mapping)
51+
52+
async def get(self,request_configuration: Optional[RequestConfiguration[ProfileSourceItemRequestBuilderGetQueryParameters]] = None) -> Optional[ProfileSource]:
53+
"""
54+
A collection of profile source settings configured by an administrator in an organization.
55+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
56+
Returns: Optional[ProfileSource]
57+
"""
58+
request_info = self.to_get_request_information(
59+
request_configuration
60+
)
61+
from .....models.o_data_errors.o_data_error import ODataError
62+
63+
error_mapping: dict[str, type[ParsableFactory]] = {
64+
"XXX": ODataError,
65+
}
66+
if not self.request_adapter:
67+
raise Exception("Http core is null")
68+
from .....models.profile_source import ProfileSource
69+
70+
return await self.request_adapter.send_async(request_info, ProfileSource, error_mapping)
71+
72+
async def patch(self,body: ProfileSource, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[ProfileSource]:
73+
"""
74+
Update the properties of a profileSource object.
75+
param body: The request body
76+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
77+
Returns: Optional[ProfileSource]
78+
Find more info here: https://learn.microsoft.com/graph/api/profilesource-update?view=graph-rest-1.0
79+
"""
80+
if body is None:
81+
raise TypeError("body cannot be null.")
82+
request_info = self.to_patch_request_information(
83+
body, request_configuration
84+
)
85+
from .....models.o_data_errors.o_data_error import ODataError
86+
87+
error_mapping: dict[str, type[ParsableFactory]] = {
88+
"XXX": ODataError,
89+
}
90+
if not self.request_adapter:
91+
raise Exception("Http core is null")
92+
from .....models.profile_source import ProfileSource
93+
94+
return await self.request_adapter.send_async(request_info, ProfileSource, error_mapping)
95+
96+
def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
97+
"""
98+
Delete a profileSource object.
99+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
100+
Returns: RequestInformation
101+
"""
102+
request_info = RequestInformation(Method.DELETE, self.url_template, self.path_parameters)
103+
request_info.configure(request_configuration)
104+
request_info.headers.try_add("Accept", "application/json")
105+
return request_info
106+
107+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ProfileSourceItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
108+
"""
109+
A collection of profile source settings configured by an administrator in an organization.
110+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
111+
Returns: RequestInformation
112+
"""
113+
request_info = RequestInformation(Method.GET, self.url_template, self.path_parameters)
114+
request_info.configure(request_configuration)
115+
request_info.headers.try_add("Accept", "application/json")
116+
return request_info
117+
118+
def to_patch_request_information(self,body: ProfileSource, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
119+
"""
120+
Update the properties of a profileSource object.
121+
param body: The request body
122+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
123+
Returns: RequestInformation
124+
"""
125+
if body is None:
126+
raise TypeError("body cannot be null.")
127+
request_info = RequestInformation(Method.PATCH, self.url_template, self.path_parameters)
128+
request_info.configure(request_configuration)
129+
request_info.headers.try_add("Accept", "application/json")
130+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
131+
return request_info
132+
133+
def with_url(self,raw_url: str) -> ProfileSourceItemRequestBuilder:
134+
"""
135+
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
136+
param raw_url: The raw URL to use for the request builder.
137+
Returns: ProfileSourceItemRequestBuilder
138+
"""
139+
if raw_url is None:
140+
raise TypeError("raw_url cannot be null.")
141+
return ProfileSourceItemRequestBuilder(self.request_adapter, raw_url)
142+
143+
@dataclass
144+
class ProfileSourceItemRequestBuilderDeleteRequestConfiguration(RequestConfiguration[QueryParameters]):
145+
"""
146+
Configuration for the request such as headers, query parameters, and middleware options.
147+
"""
148+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
149+
150+
@dataclass
151+
class ProfileSourceItemRequestBuilderGetQueryParameters():
152+
"""
153+
A collection of profile source settings configured by an administrator in an organization.
154+
"""
155+
def get_query_parameter(self,original_name: str) -> str:
156+
"""
157+
Maps the query parameters names to their encoded names for the URI template parsing.
158+
param original_name: The original query parameter name in the class.
159+
Returns: str
160+
"""
161+
if original_name is None:
162+
raise TypeError("original_name cannot be null.")
163+
if original_name == "expand":
164+
return "%24expand"
165+
if original_name == "select":
166+
return "%24select"
167+
return original_name
168+
169+
# Expand related entities
170+
expand: Optional[list[str]] = None
171+
172+
# Select properties to be returned
173+
select: Optional[list[str]] = None
174+
175+
176+
@dataclass
177+
class ProfileSourceItemRequestBuilderGetRequestConfiguration(RequestConfiguration[ProfileSourceItemRequestBuilderGetQueryParameters]):
178+
"""
179+
Configuration for the request such as headers, query parameters, and middleware options.
180+
"""
181+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
182+
183+
@dataclass
184+
class ProfileSourceItemRequestBuilderPatchRequestConfiguration(RequestConfiguration[QueryParameters]):
185+
"""
186+
Configuration for the request such as headers, query parameters, and middleware options.
187+
"""
188+
warn("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.", DeprecationWarning)
189+
190+

0 commit comments

Comments
 (0)