Skip to content

Commit b371b86

Browse files
authored
Merge pull request #839 from microsoftgraph/beta/pipelinebuild/188232
Generated beta models and request builders
2 parents 2a8d30d + d9685ba commit b371b86

File tree

242 files changed

+9550
-332
lines changed

Some content is hidden

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

242 files changed

+9550
-332
lines changed

msgraph_beta/generated/admin/people/people_request_builder.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .item_insights.item_insights_request_builder import ItemInsightsRequestBuilder
2020
from .name_pronunciation.name_pronunciation_request_builder import NamePronunciationRequestBuilder
2121
from .profile_card_properties.profile_card_properties_request_builder import ProfileCardPropertiesRequestBuilder
22+
from .profile_property_settings.profile_property_settings_request_builder import ProfilePropertySettingsRequestBuilder
2223
from .pronouns.pronouns_request_builder import PronounsRequestBuilder
2324

2425
class PeopleRequestBuilder(BaseRequestBuilder):
@@ -169,6 +170,15 @@ def profile_card_properties(self) -> ProfileCardPropertiesRequestBuilder:
169170

170171
return ProfileCardPropertiesRequestBuilder(self.request_adapter, self.path_parameters)
171172

173+
@property
174+
def profile_property_settings(self) -> ProfilePropertySettingsRequestBuilder:
175+
"""
176+
Provides operations to manage the profilePropertySettings property of the microsoft.graph.peopleAdminSettings entity.
177+
"""
178+
from .profile_property_settings.profile_property_settings_request_builder import ProfilePropertySettingsRequestBuilder
179+
180+
return ProfilePropertySettingsRequestBuilder(self.request_adapter, self.path_parameters)
181+
172182
@property
173183
def pronouns(self) -> PronounsRequestBuilder:
174184
"""
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/profilePropertySettings/$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_property_setting import ProfilePropertySetting
19+
20+
class ProfilePropertySettingItemRequestBuilder(BaseRequestBuilder):
21+
"""
22+
Provides operations to manage the profilePropertySettings 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 ProfilePropertySettingItemRequestBuilder 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/profilePropertySettings/{profilePropertySetting%2Did}{?%24expand,%24select}", path_parameters)
32+
33+
async def delete(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> None:
34+
"""
35+
Delete a profilePropertySetting 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/profilepropertysetting-delete?view=graph-rest-beta
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[ProfilePropertySettingItemRequestBuilderGetQueryParameters]] = None) -> Optional[ProfilePropertySetting]:
53+
"""
54+
Read the properties and relationships of a profilePropertySetting object.
55+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
56+
Returns: Optional[ProfilePropertySetting]
57+
Find more info here: https://learn.microsoft.com/graph/api/profilepropertysetting-get?view=graph-rest-beta
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.profile_property_setting import ProfilePropertySetting
70+
71+
return await self.request_adapter.send_async(request_info, ProfilePropertySetting, error_mapping)
72+
73+
async def patch(self,body: ProfilePropertySetting, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> Optional[ProfilePropertySetting]:
74+
"""
75+
Update the properties of a profilePropertySetting object.
76+
param body: The request body
77+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
78+
Returns: Optional[ProfilePropertySetting]
79+
Find more info here: https://learn.microsoft.com/graph/api/profilepropertysetting-update?view=graph-rest-beta
80+
"""
81+
if body is None:
82+
raise TypeError("body cannot be null.")
83+
request_info = self.to_patch_request_information(
84+
body, request_configuration
85+
)
86+
from .....models.o_data_errors.o_data_error import ODataError
87+
88+
error_mapping: dict[str, type[ParsableFactory]] = {
89+
"XXX": ODataError,
90+
}
91+
if not self.request_adapter:
92+
raise Exception("Http core is null")
93+
from .....models.profile_property_setting import ProfilePropertySetting
94+
95+
return await self.request_adapter.send_async(request_info, ProfilePropertySetting, error_mapping)
96+
97+
def to_delete_request_information(self,request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
98+
"""
99+
Delete a profilePropertySetting object.
100+
param request_configuration: Configuration for the request such as headers, query parameters, and middleware options.
101+
Returns: RequestInformation
102+
"""
103+
request_info = RequestInformation(Method.DELETE, self.url_template, self.path_parameters)
104+
request_info.configure(request_configuration)
105+
return request_info
106+
107+
def to_get_request_information(self,request_configuration: Optional[RequestConfiguration[ProfilePropertySettingItemRequestBuilderGetQueryParameters]] = None) -> RequestInformation:
108+
"""
109+
Read the properties and relationships of a profilePropertySetting object.
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: ProfilePropertySetting, request_configuration: Optional[RequestConfiguration[QueryParameters]] = None) -> RequestInformation:
119+
"""
120+
Update the properties of a profilePropertySetting 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) -> ProfilePropertySettingItemRequestBuilder:
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: ProfilePropertySettingItemRequestBuilder
138+
"""
139+
if raw_url is None:
140+
raise TypeError("raw_url cannot be null.")
141+
return ProfilePropertySettingItemRequestBuilder(self.request_adapter, raw_url)
142+
143+
@dataclass
144+
class ProfilePropertySettingItemRequestBuilderDeleteRequestConfiguration(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 ProfilePropertySettingItemRequestBuilderGetQueryParameters():
152+
"""
153+
Read the properties and relationships of a profilePropertySetting object.
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 ProfilePropertySettingItemRequestBuilderGetRequestConfiguration(RequestConfiguration[ProfilePropertySettingItemRequestBuilderGetQueryParameters]):
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 ProfilePropertySettingItemRequestBuilderPatchRequestConfiguration(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)